cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CChong
Level 11 Flexeran
Level 11 Flexeran

Triggering a Small update rollback

Hi Folks,

I have created a small update for my install which works great.
It contains 3 C++ DLLs and a database script.
I want to trigger a rollback of the Small Update if the running of the SQL database script fails.
Currently if the SQL database script fails, the Small Update carries on regardless. This is not what I want, because the three DLLs are installed while the database script fails.
I use SQLCMD to run the SQL script.
Is it possible to create a rollback event for the Small Patch that I can initiate on my own error message?
Labels (1)
0 Kudos
(4) Replies
manomatt
Level 8

If you use the SQL Scripts view provided by install shield itself this rollback thing could be handled swiftly. There you can provide the sql script that you wanted to use during the rollback and you can condition it accordingly also.

In your case you are using SQLCMD to run the SQL script from a customaction i suppose and can you tell me how are planning to initiate the rollback on your own error message?
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

mano.n.s75 wrote:
If you use the SQL Scripts view provided by install shield itself this rollback thing could be handled swiftly. There you can provide the sql script that you wanted to use during the rollback and you can condition it accordingly also.

In your case you are using SQLCMD to run the SQL script from a customaction i suppose and can you tell me how are planning to initiate the rollback on your own error message?

Hi mano.n.s75,
If the SQL script fails in SQLCMD, an error message is logged in the registry using TSQL RegWrite command.
Installscript will check this registry entry and hopefully rollback the whole small update on SQL failure.
Is there a specific Installscript call to trigger a Small Update rollback at this stage?
0 Kudos
manomatt
Level 8

If you are using Install Script or Install Script MSI check this "SQLRTDoRollbackAll()".
0 Kudos
CChong
Level 11 Flexeran
Level 11 Flexeran

Hi mano,
I have a Basic MSI project.
SQLRTDoRollbackAll() is just to rollback any SQL scripts , but we already have "Rollback Transaction" implemented in our TSQLscript.
The problem is I want the whole small update to be rolled back when the SQL script fails.
is there a command for doing that, like MSIRollbackpatch() that can be called from InstallScript or something along those lines so that the new dlls are removed and application and SQL server are back in sync?
0 Kudos