This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- IS not working in SQL scripts, On Error, Aborted Installation
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Aug 25, 2015
02:49 PM
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
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
(1) Reply
Aug 27, 2015
12:48 PM
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.