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: Execute batch file during installation and uninstallation
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
‎Dec 11, 2009
03:30 AM
Execute batch file during installation and uninstallation
Hi,
I have 2 batch files. One should be executed as a last step of Installation process and another as first step of Uninstallation process. I got to know about the custom actions, but please let me know the sequence of actions and the place where my 2 batch files should be called.
The batch files starts and stops some windows services. I have a batch file as there are many services(11 services).
I have 2 batch files. One should be executed as a last step of Installation process and another as first step of Uninstallation process. I got to know about the custom actions, but please let me know the sequence of actions and the place where my 2 batch files should be called.
The batch files starts and stops some windows services. I have a batch file as there are many services(11 services).
4 Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 14, 2009
06:34 PM
First, is it an option to use the built-in Windows Installer service functionality? (You mention custom actions, so I assume this is an MSI project...) That way you don't have to worry as much about permissions, rollback, and all that kind of thing.
Otherwise, batch files that make system changes should be scheduled for "deferred execution", somewhere between InstallInitialize and InstallFinalize. To detect a first-time installation, you can use the condition Not Installed; to detect complete uninstallation, you can use REMOVE="ALL" anywhere after InstallValidate.
Otherwise, batch files that make system changes should be scheduled for "deferred execution", somewhere between InstallInitialize and InstallFinalize. To detect a first-time installation, you can use the condition Not Installed; to detect complete uninstallation, you can use REMOVE="ALL" anywhere after InstallValidate.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 21, 2009
08:28 AM
Thanks robert, I could call my batch file during installation. but i'm not able to call another batch file during uninstall process.
These batch files are part of my installer. I remove them during uninstall. let me know the sequence where i should call this batch file.
These batch files are part of my installer. I remove them during uninstall. let me know the sequence where i should call this batch file.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 28, 2009
04:44 PM
Hey Lost.
I have a few of these things as well going on in some of my installs, like using a vb script to create a desktop icon that points to a network location off of the system. Seems the msi cant validate network mappings as the system account. (duh) So. then i had to create a batch file to delete the desktop icon on uninstall. First do you know the syntax for the batch file in the CA if not i can get that for you from some of my projects. (not off top of head and at home bored reading these forums.) Ya Geeky! So if thats the case if you want it to run at uninstall i dont think this needs to be deferred but on install yes it must be run deferred.
Will edit tomorrow...
syntax systemfolder cmd.exe
/c [INSTALLDIR]batchfile.bat.cmd
If memory serves me.
If you have other systems with different drive mappings like our term servers use t.
put a condition on it for terminal servers and not tsremoteadmin i think. i can get these for you to.
set one up for c:\ t:\ etc and put conditions on the CA's
I have a few of these things as well going on in some of my installs, like using a vb script to create a desktop icon that points to a network location off of the system. Seems the msi cant validate network mappings as the system account. (duh) So. then i had to create a batch file to delete the desktop icon on uninstall. First do you know the syntax for the batch file in the CA if not i can get that for you from some of my projects. (not off top of head and at home bored reading these forums.) Ya Geeky! So if thats the case if you want it to run at uninstall i dont think this needs to be deferred but on install yes it must be run deferred.
Will edit tomorrow...
syntax systemfolder cmd.exe
/c [INSTALLDIR]batchfile.bat.cmd
If memory serves me.
If you have other systems with different drive mappings like our term servers use t.
put a condition on it for terminal servers and not tsremoteadmin i think. i can get these for you to.
set one up for c:\ t:\ etc and put conditions on the CA's
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 28, 2009
10:39 PM
If you're installing, run after InstallFiles in deferred mode. If uninstalling, before RemoveFiles.
