Hi all,
What SQL error does InstallShield expects?
The installation is using default settings for SQL scripts, 'On Error, Abort Installation'.
When sql script RAISERROR(.....) with error severity = 16, error state = -1 (or 1), installshield continues and does not catch the error; thus did not abort the installation.
Here is the code snippet.
BEGIN TRY
SET XACT_ABORT ON
RAISERROR (N''*** Testing: Force failure ... ***'', 16, 1)
// ..............
END TRY
BEGIN CATCH
DECLARE @errorMessage VARCHAR(1000)
SET @errorMessage = 'ERROR ' + CAST(ERROR_NUMBER() AS VARCHAR(10)) + ': ' + ERROR_MESSAGE() + ' AT ' + CAST(ERROR_LINE() AS VARCHAR(10))
PRINT @errorMessage
INSERT INTO InstallationErrors (time, descriptions) VALUES (GETUTCDATE(), @errorMessage)
RAISERROR (@errorMessage, 16, -1)
END CATCH
What SQL error does InstallShield expects?
The installation is using default settings for SQL scripts, 'On Error, Abort Installation'.
When sql script RAISERROR(.....) with error severity = 16, error state = -1 (or 1), installshield continues and does not catch the error; thus did not abort the installation.
Here is the code snippet.
BEGIN TRY
SET XACT_ABORT ON
RAISERROR (N''*** Testing: Force failure ... ***'', 16, 1)
// ..............
END TRY
BEGIN CATCH
DECLARE @errorMessage VARCHAR(1000)
SET @errorMessage = 'ERROR ' + CAST(ERROR_NUMBER() AS VARCHAR(10)) + ': ' + ERROR_MESSAGE() + ' AT ' + CAST(ERROR_LINE() AS VARCHAR(10))
PRINT @errorMessage
INSERT INTO InstallationErrors (time, descriptions) VALUES (GETUTCDATE(), @errorMessage)
RAISERROR (@errorMessage, 16, -1)
END CATCH