[wix-users] Running PowerShell script after installer finishes

manish duggal duggal_sunny at yahoo.com
Fri Jun 15 16:01:30 PDT 2018


 The link got messed up in my email. But it is "https://www.firegiant.com/wix/tutorial/events-and-actions/extra-actions/"


| 
| 
|  | 
Extra Actions

FireGiant

WiX tutorial
 |

 |

 |




    On Friday, June 15, 2018, 3:58:19 p.m. PDT, manish duggal via wix-users <wix-users at lists.wixtoolset.org> wrote:  
 
  Thx Nir and Edwin for your help here. I was able to figure out how to run the script and would like to share the details :)
From: Extra Actions 

| 
| 
|  | 
Extra Actions

FireGiant

WiX tutorial
 |

 |

 |


We can also launch any other executable on the user's machine if we provide its name in a property:
<Property Id='NOTEPAD'>Notepad.exe</Property><CustomAction Id='LaunchFile' Property='NOTEPAD' ExeCommand='[SourceDir]Readme.txt' Return='asyncNoWait' />


So I just used the similar kind of detail in my WIX as<Property Id='POWERSHELL'>powershell.exe</Property>
<CustomAction Id='LaunchUpdaterCmdlet'                       Property='POWERSHELL'                      ExeCommand='-NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -File "[INSTALLDIR]UpdaterScript.ps1" "'                       Return='ignore'                    />
With this, I was able to run my script after InstallFinalize and as expected it prompts for elevation if needed. 
ThxManish 
    On Friday, June 15, 2018, 12:27:12 a.m. PDT, Nir Bar <nir.bar at panel-sw.com> wrote:  
 
 You can use

https://www.nuget.org/packages/PowerShellWixExtension/

Sent from my ASUS  

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/  


More information about the wix-users mailing list