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
- :
- Re: How Do I prevent SQL script from running on Uninstall?
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
‎Mar 18, 2009
04:57 PM
How Do I prevent SQL script from running on Uninstall?
I have a Basic MSI Installer that runs a sql script to create a database. In the original version I also had a sql script that ran on uninstall to drop the database.
Currently I am creating an major upgrade and I have realized that this will perform an uninstall of the old version. The problem, of course, is that the database will be dropped and recreated as part of the upgrade. How do I prevent this from happening?
Currently I am creating an major upgrade and I have realized that this will perform an uninstall of the old version. The problem, of course, is that the database will be dropped and recreated as part of the upgrade. How do I prevent this from happening?
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2009
10:41 AM
Hello Joseph
Did you find a solution to the issue?
I ma struggling with a similar issue and haven't found a solution yet.
Please let me know if you did.
Thanks
Did you find a solution to the issue?
I ma struggling with a similar issue and haven't found a solution yet.
Please let me know if you did.
Thanks
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2009
11:06 AM
I ended up having to leave the script in place for one upgrade, but render it harmless. So, I created a major upgrade that does not run an uninstall before continuing (see attached screenshot). Then went to the sql script and unchecked the "Run script during uninstall" checkbox (Runtime tab). And, just for good measure, I changed the text of the script to something harmless like "select 1".
This will leave the script on the machine, but render it harmless. So, the next time you create an upgrade, you can let it uninstall (the better option IMO). However, it will no longer run the script on uninstall.
At this point you can safely remove the sql script from the install altogether.
In my case, I needed this result immediately, so I had to send my guys out with two upgrades. One to render the script harmless, and one to do some actual upgrades. It was less than ideal, but did the job in a pinch.
This will leave the script on the machine, but render it harmless. So, the next time you create an upgrade, you can let it uninstall (the better option IMO). However, it will no longer run the script on uninstall.
At this point you can safely remove the sql script from the install altogether.
In my case, I needed this result immediately, so I had to send my guys out with two upgrades. One to render the script harmless, and one to do some actual upgrades. It was less than ideal, but did the job in a pinch.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2009
04:20 PM
Joseph,
Thanks for sharing your solution.
One question: My old product 1.0.123 has been deployed at several client locations. Now i am doing a major upgrade 2.0.98.
When the user runs the setup for 2.0.98, it first uninstalls the old version 1.0.123.
My question is, whether the uninstall sequence/actions in the 1.0.123 are executed or the ones in 2.0.98 ?
Is there a better way you know of that could retain the SQL Server data/database when doing a major upgrade?
thnx
Thanks for sharing your solution.
One question: My old product 1.0.123 has been deployed at several client locations. Now i am doing a major upgrade 2.0.98.
When the user runs the setup for 2.0.98, it first uninstalls the old version 1.0.123.
My question is, whether the uninstall sequence/actions in the 1.0.123 are executed or the ones in 2.0.98 ?
Is there a better way you know of that could retain the SQL Server data/database when doing a major upgrade?
thnx
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 18, 2009
04:28 PM
To avoid an uninstall on a major upgrade, you must choose the "Install Setup then remove unneeded files" option as shown in the screenshot on my previous post. That will leave you with 2.0.98 without explicitly uninstalling 1.0.123. Basically, you are overwriting everything. After that, an uninstall will run the 2.0.98 uninstall (1.0.123 no longer exists on that machine).
That said, I hope you plan on thoroughly testing your upgrade package to test these statements.
Unfortunately, I do not have a better way. I was forced to take this route because of time constraints.
That said, I hope you plan on thoroughly testing your upgrade package to test these statements.
Unfortunately, I do not have a better way. I was forced to take this route because of time constraints.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 21, 2009
11:12 AM
Joseph,
Thanks for the solution. Your solution works as required with a few minor tweaks, because the product was not being completely uninstalled if i chose the 2nd option ie) "Install Setup then remove unneeded files" .
Anyway, for the database uninstall to not run during a Major Upgrade, your solution works !!
Thnx
Thanks for the solution. Your solution works as required with a few minor tweaks, because the product was not being completely uninstalled if i chose the 2nd option ie) "Install Setup then remove unneeded files" .
Anyway, for the database uninstall to not run during a Major Upgrade, your solution works !!
Thnx
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎May 21, 2009
11:16 AM
Glad I could help 🙂 .