cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cornel_gav
Level 5

Uninstall problem

My installer has multiple components.
At uninstall if one of this components (.exe) is running, what should I do? InstallShield offers some automation for this?

Do I need to write InstallScript code? If, yes, some example will be great.
Thanks
Labels (1)
0 Kudos
(3) Replies
cornel_gav
Level 5

No answer for this question?
0 Kudos
ChristopheOce
Level 7

Hi cornel_gav,

if you UNINSTALL your project and for example an exe is running the installer will tells you => close the exe and retry NORMALLY !!!!

Now, you can execute and script for to stop your exe !
for example if your exe is a service there is some installscript function as
startTheService, stopTheservice who take parametres.

you create a installscript function and a custom action who start this installscript with the condition REMOVE="ALL"

don't forget to place this action in the execute sequence BETWEEN installInitialize and installfiniliaze.

Have a nice day
Christophe
0 Kudos
rfitzpat
Level 4

Cornel_gav,
Not sure if you are doing a installscript or MSI install, but the main InstallShield IDE has 3 tabs, when you are in the Installation Designer tab, click on the General Information->Product Properties, there is a ‘Executable File’ field. Enter the executable file of your product that you want to make sure is not running during the uninstall. InstallShield will check this file is running during uninstall, I believe.
If you have multiply executables, you will have to add code to handle each one.
For Installscript you could do something like this:
(Here I have stored the path to our executable in the registry during install, retrieve the path during the uninstall, check to see if file is there, then check to see if it is locked. If locked, stop the uninstall, all inside the OnMaintUIBefore() function.)

bFileThere = Is(FILE_EXISTS, g_svZehIBDir ^ "prg\\zm.exe");
if (bFileThere) then
bLocked = Is(FILE_LOCKED, g_svZehIBDir ^ "prg\\zm.exe");
if (bLocked) then
MessageBox(IFX_PRODUCT_NAME + " is in use, please exit application.", SEVERE);
abort;
endif;
endif;

Robert
0 Kudos