cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
peterl
Level 2

IS not working in SQL scripts, On Error, Aborted Installation

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
Labels (1)
0 Kudos

(1) Reply
hidenori
Level 17

This issue has been filed under IOJ-1729395 and fixed in InstallShield 2015. If interested, the free trial version of InstallShield 2015 is available on Flexera Software website.
0 Kudos