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

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.

Labels (1)
0 Kudos
(5) Replies
roman2
Level 7

Set condition to Custom Action "Not Installed"

 

 

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
  }
}
0 Kudos

 

Look at Installer Property

Property

Patch, Installed, REMOVE

0 Kudos

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)
}
0 Kudos

Hello,

REMOVE -> uninstallation

Not REMOVE And Installed -> it could be update (? please check it on test system)

Not Installed -> new installation

Regards

Roman

 

 

 

0 Kudos