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
- :
- SQL Script Error Handling Bug
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 20, 2008
05:46 PM
SQL Script Error Handling Bug
I've observed something which is very undesirable.
I created an install with:
many sqlscripts scheduled for install and On Error Abort ( ISWiErrorHandling.esehAbort )
one sqlscript scheduled for uninstall and error handling of On Error goto next statement.( ISWiErrorHandling.esehGotoNextScript ).
When I run the uninstall from Add/Remove Programs, if the SQL custom actions can't connect to the database I get a pop-up telling me so and the uninstall is rolled back.
This is despite me telling it to ignore errors. This is really, really bad as it blocks the uninstall. The sql scripts I need to run are `best effort` and shouldn't block the transaction.
Any work arounds?
I created an install with:
many sqlscripts scheduled for install and On Error Abort ( ISWiErrorHandling.esehAbort )
one sqlscript scheduled for uninstall and error handling of On Error goto next statement.( ISWiErrorHandling.esehGotoNextScript ).
When I run the uninstall from Add/Remove Programs, if the SQL custom actions can't connect to the database I get a pop-up telling me so and the uninstall is rolled back.
This is despite me telling it to ignore errors. This is really, really bad as it blocks the uninstall. The sql scripts I need to run are `best effort` and shouldn't block the transaction.
Any work arounds?
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2008
11:17 AM
InstallShield has included support for a new Windows Installer property called IS_SQLSERVER_CXNS_ABSENT_FROM_INSTALL since InstallShield 2008. You can use this property to specify one or more SQL connections that should be skipped during installation or uninstallation. To specify more than one SQL connection, separate each with a semicolon ;. To skip all of the SQL connections, set the value of this property to ALL. Using this property is helpful if you cannot uninstall a product because of a SQL scripting error.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2008
11:48 AM
If I have a script scheduled for uninstall, using connection 1 with error handling errorNextStatement and I set the property you mention to include connection 1, will it still attempt to run the schedule script against connection 1?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2008
12:26 PM
No, the connection 1 will be completely ignored when you specify the connection name in the property. My assumption is that your login credentials have been changed since your setup was installed because you mentioned that "the SQL custom actions can't connect to the database". If you still want to run your script during uninstall in the scenario, you need to specify the new login information from the command line as follows:
Setup.exe /v"IS_SQLSERVER_DO_NOT_USE_REG=1 IS_SQLSERVER_SERVER=NewServerName IS_SQLSERVER_DATABASE=NewDBName IS_SQLSERVER_AUTHENTICATION=1 IS_SQLSERVER_USERNAME=NewUserName IS_SQLSERVER_PASSWORD=NewPwd"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2008
01:01 PM
The goal is to schedule a script for uninstall and make it `best effort`. If the connection can validate and the script can be run without error, great.
If some unknown error occurs ( maybe sqlserver is down, network problem, password changed whatever.. ) then we want to fail gracefully and proceed with the uninstall.
We can do that if the script itself fails ( for example it tries to call a stored proc that doesn't exist ) but if there is a connection problem then we get a pop-up and rollback.
Setting the property doesn't sound like it'll meet my needs. Perhaps the only thing that can be done is to have a dialog that asks if we want to attempt to run the uninstalls scripts then condition the sql pattern on that.
If some unknown error occurs ( maybe sqlserver is down, network problem, password changed whatever.. ) then we want to fail gracefully and proceed with the uninstall.
We can do that if the script itself fails ( for example it tries to call a stored proc that doesn't exist ) but if there is a connection problem then we get a pop-up and rollback.
Setting the property doesn't sound like it'll meet my needs. Perhaps the only thing that can be done is to have a dialog that asks if we want to attempt to run the uninstalls scripts then condition the sql pattern on that.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 21, 2008
02:08 PM
The Script Error Handling setting only applies to SQL scripting errors. It has nothing to do with SQL connection errors. I filed the feature enhancement work order #IOC-000075988 so that we will take it into consideration for a future release. Perhaps, we will provide a new option called something like "Allow installation to continue when connection fails".
Thank you for your feedback.
Thank you for your feedback.