cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Christopher_Pai
Level 16

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?
Labels (1)
0 Kudos
(5) Replies
hidenori
Level 17

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.
0 Kudos
Christopher_Pai
Level 16

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?
0 Kudos
hidenori
Level 17

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"
0 Kudos
Christopher_Pai
Level 16

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.
0 Kudos
hidenori
Level 17

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.
0 Kudos