PDA

View Full Version : Running a batch only during installation (not uninstall)



Dark-Jedi
09-17-2007, 02:59 AM
How to run a batch (.bat) in the custom action, "only during installation"? (not during uninstall)

I know for uninstall only, i just need to use (remove="ALL") in the installation exec condition.
How for installation only?

Thanks.

heiner_violet
09-17-2007, 04:31 AM
In Installshield, you can use the condition "Not Installed". (I don't know if this condition exists in AdminStudio). The CA is then executed only while the first installation - not while uninstalling or while a minor upgrade.

greetings, H.

Dark-Jedi
09-17-2007, 07:07 AM
In Installshield, you can use the condition "Not Installed". (I don't know if this condition exists in AdminStudio). The CA is then executed only while the first installation - not while uninstalling or while a minor upgrade.

greetings, H.

i confirm that CA execute my batch during uninstall :s

Ok if i have understand i must put in installation exec condition :
remove="Not installed"
Right?

heiner_violet
09-17-2007, 08:31 AM
No, I meant to set the condition "Not Installed" for your CA.
As I said, I don't know AdminStudio, but in Installshield the REMOVE condition is in capital letters. So you could also use condition REMOVE="" to prevent the CA from being executed while uninstalling.

Cary R
09-17-2007, 11:13 AM
Hi,

In AdminStudio/InstallShield (or, more generally, Windows Installer), the following conditions are usually what works well:

First Time-install only: NOT Installed AND NOT REINSTALL
Uninstall-only: Installed AND REMOVE~="ALL"
Patch Operation: Installed AND PATCH
Maintenance: Installed AND NOT PATCH AND NOT REMOVE~=ALL
Auto-Repair: REINSTALLMODE="pocmus"

REMOVE="" might actually not work well for you, since this would not evaluate correctly when in maintenance mode and removing a feature.

If you're curious as to how these properties are set, and what data they hold, I'd recommend searching MSDN for "(name of property) property". Good information on understanding what they do and how they work.

heiner_violet
09-17-2007, 03:09 PM
Thank you for a clear illustration of these properties. H.

Dark-Jedi
09-18-2007, 06:57 AM
Ok very thanx for all your answer, it works as i want :)