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 powershell action only when installing (not when uninstalling)
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Nov 28, 2019
10:31 AM
Execute powershell action only when installing (not when uninstalling)
I run a powershell script when installing my stuff.
Is there a way to tell InstallShield 2018 not to run the script when uninstalling ?
Or maybe there is a property I can test to avoid execution of the commandlets of my powershell script.
(5) Replies
Dec 02, 2019
09:09 AM
Ok, and is there a way to test a property in the powershell that would make it possible to write something like .
$action = Get-Property -name <some property>
switch ( $action){
Installing
{
# do something to install my stuff
}
Uninstalling
{
# do something to uninstall my stuf
}
Patch
{
# do something whe patching
}
}
Dec 03, 2019
04:33 AM
If I understand this well, I could write something like
if (Get-Property -name REMOVE){
# we are uninstalling
} elif (Get-Property -name REMOVE) {
# we are upgrading
} else {
# we are installing (from scratch)
}
if (Get-Property -name REMOVE){
# we are uninstalling
} elif (Get-Property -name REMOVE) {
# we are upgrading
} else {
# we are installing (from scratch)
}
Dec 03, 2019
04:52 AM
Hello,
REMOVE -> uninstallation
Not REMOVE And Installed -> it could be update (? please check it on test system)
Not Installed -> new installation
Regards
Roman