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

launching a batch file during uninstall of a basic msi project

CChong
By Level 11 Flexeran
Level 11 Flexeran
I am trying to launch a batch file during the uninstall process but cannot figure it out. I am using a Basic MSI project in AdminStudio 3.5.

I have tried to modify the registry key "HKLM/Software/Microsoft/Windows/CurrentVersion/Uninstall" in the MSI project for the destination computer to contain the path to the batch file. The batch file has the MSIExec uninstall program as the first line followed by some other cleanup code. When I install the application, the change is not registered in the registry.

I have run the batch file to verify that it uninstalls the application and runs the clean up code.

Does anyone know how to configure the MSI project to do this?
(2) Replies
Use a custom action with condition REMOVE="ALL" to launch your batchfile. (Not directly, use InstallScript/vbScript/wrapper).
CChong
By Level 11 Flexeran
Level 11 Flexeran
I'm a big fan of using installscript:

LaunchAppAndWait ( "c:\\winnt\\system32\\cmd.exe" , "/c " , WAIT );


and make the condition &=2

*******
But I think what you are trying to do is change the uninstall key to be something else - this will get overwritten by the action publics product, or install finalise, (i'm not sure which) which is further down the execute list than reg write. You can either
1. Move the regwrite action to below these (not advised)
2. Create a custom action that writes this registry after these.

or more cleanly

Use the install script mentioned above to run the other clean up actions in your batch file, and leave the uninstall reg key well alone.

MikeG