PDA

View Full Version : SQL Script not running on Unintstall



olegkap
06-03-2005, 09:41 AM
Hi!

I am running SQL script when installation is running and it runs well,
but when I am tring to run another script when perfomring uninstall it seems like script never runs, it never gets to a database so I assuming installshield not executing any SQL related commands on unistallation.

Is there anything special about running SQL script when uninstalling ?
Does anybody has an example ?

Thanks in advance,
Oleg.

hidenori
06-03-2005, 10:40 AM
Are you using the SQL Scripts view to run your scripts? If so, do you check the "Run Script During Uninstall" checkbox in the Runtime tab? Also, do you use an InstallScript or InstallScript MSI project?

olegkap
06-03-2005, 01:21 PM
I am using InstallScript project,
Yes, "Run Script During Uninstall" checkbox is selected.
Oleg.

Are you using the SQL Scripts view to run your scripts? If so, do you check the "Run Script During Uninstall" checkbox in the Runtime tab? Also, do you use an InstallScript or InstallScript MSI project?

hidenori
06-03-2005, 01:25 PM
If you create a new InstallScript project, and add a connection and a script with the "Run Script During Uninstall" option, is the problem reproduced?

olegkap
06-03-2005, 02:19 PM
No,
I just create empty InstallScript projetc, with all default parameters,
created new database connection,
added SQL script and all it does is simple PRINT command
and this script checked to run for install and uninstall,
I run setup,
on install, I could see installshiled comunicating with SQL server
but on uninstall there were no comunication at all.

I was using SQL Profiler to catch all SQL requests.

Any other ideas ?

Thanks,
Oleg.

If you create a new InstallScript project, and add a connection and a script with the "Run Script During Uninstall" option, is the problem reproduced?

hidenori
06-03-2005, 06:27 PM
I found the bug that the "Run Script During Uninstall" option does not work when you select both the "Run Script During Install" and "Run Script During Uninstall" options in an InstallScript project. I submit the work order #1-1BRRNH so that we can address the issue in a future release.

At this time, please have 2 script nodes and link to the same script file. Then check the "Run Script During Install" option for one and the "Run Script During Uninstall" option for the other one.

Thank you for reporting this.
Best Regards.

olegkap
06-06-2005, 08:27 AM
Thanks,

I tried that exactly as you said,
but installation crashed, and I think it because I see the second script to be set as "Run on uninstall". Also it seems to crush that way that when I run installation for a second time it working as first installation and not as maintance.
I solved this problem for now as a custom SQL execution using osql.exe utility and providing it with parameters, but may be is the a way of executing SQL directly from installshield, and may be receive some result back?

Thanks,
Oleg.


I found the bug that the "Run Script During Uninstall" option does not work when you select both the "Run Script During Install" and "Run Script During Uninstall" options in an InstallScript project. I submit the work order #1-1BRRNH so that we can address the issue in a future release.

At this time, please have 2 script nodes and link to the same script file. Then check the "Run Script During Install" option for one and the "Run Script During Uninstall" option for the other one.

Thank you for reporting this.
Best Regards.

scbutler1
06-15-2005, 10:53 AM
How is it possible to link the same script to two different node and have them activate two diiferent sets of scripts??? I am running into this same issue of the uninstall not working.

If you say this is a bug, is there any way that we can track the status of it?

Thanks!

hidenori
06-15-2005, 11:11 AM
There are 2 ways that you can do.

If you are adding new nodes:
1. Right-click on a connection and select Insert Script Files... menu option.
2. Select a SQL script file and click OK.
3. Right-click on a connection and select Insert Script Files... menu option.
4. Select the same SQL script that you specified in step 2.

If you already have the 2 nodes:
1. Select the first node and specify the path to your SQL script file in the SQL Script File Name field of the General tab.
2. Select the second node and specify the path to the same SQL script file that you specified in step 2 in the SQL Script File Name field of the General tab.

The work order #1-1BRRNH will be fixed in the next version of InstallShield 11.

Hope this helps.

scbutler1
06-15-2005, 01:05 PM
So let me see if I've got this correct. You can use InstallShield 11 to run SQL Installation Scripts, but no uninstallation scripts will run, and this is what that work order is for?

If I am incorrect in my understanding of this issue, please let me know how I can run an sql script during uninstallation. There has to be a work around for this.....

hidenori
06-15-2005, 01:23 PM
The work order #1-1BRRNH is for the issue that a SQL script is not run during the uninstallation when you select both the Run Script During Install and the Run Script During Uninstall options in an InstallScript project. You can run your script during the uninstallation if you only select the Run Script During Uninstall option.

scbutler1
06-15-2005, 01:36 PM
OK, my issue is that my script doesnt seem to run when I have only the run during uninstallation checked.

My script is simply:

use master
drop DATABASE RMS_StoreOps
GO

Is there anything else that I need to do to have this kick off during uninstallation? I am working with InstallShield for the first time so much of this is new to me.

Is there a installation log that gets created or that I can turn on/off?

hidenori
06-15-2005, 01:53 PM
Do you receive any errors? Or the uninstallation is complete but your script is not run?

hidenori
06-15-2005, 02:08 PM
I am able to run a script and drop my database during uninstallation on my side. If you can send me your sample project at hidenoriy@macriovision.com, I will look into it.

scbutler1
06-15-2005, 05:38 PM
Its rather big so i cant email you the solution. Is there an alternative manner in which I can send the project to you?

hidenori
06-15-2005, 05:43 PM
Would it be possible for you to create a new project with a connection and a SQL script that reproduces the problem and send it me?

Thank you for your patience and cooperation.

Snoopstah
07-17-2005, 08:30 PM
I have a similar problem where my sql scripts will not run on Modify mode. The component is set to execute during installation. But when a use chooses Modify I want the scripts to run again. I can't get this working.

Musashi
08-26-2005, 03:28 AM
Hi, Snoopstach!
How did you resolve the problem? SQL Condition doesn't work in maintenance mode, if the condition is dinamically.
Thank you,
Musashi


I have a similar problem where my sql scripts will not run on Modify mode. The component is set to execute during installation. But when a use chooses Modify I want the scripts to run again. I can't get this working.