[wix-users] Running PowerShell script after installer finishes

manish duggal duggal_sunny at yahoo.com
Thu Jun 14 17:22:54 PDT 2018


Hi
I have a requirement to launch a powershell script after my installer finishes. My requirement is to launch it and ask for elevation if needed. I was able to invoke my script manually and it does ask for the elevation. However, the custom action in installer doesn't somehow launching the script. 
Here is my custom action detail
<Property Id='LaunchAction' Value='TO_BE_OVERRIDDEN' />        <SetProperty Id='LaunchAction'                      Value='"powershell.exe" -NoProfile -NonInteractive -InputFormat None -ExecutionPolicy Bypass -Command "& '[INSTALLDIR]Script.ps1' -InstallDir '[INSTALLDIR]';"'                     Before='LaunchAction                      Sequence='execute' />        <CustomAction Id='LaunchAction'                      BinaryKey='WixCA'                      DllEntry='CAQuietExec64'                      Execute='immediate'                      Return='ignore'                      Impersonate='no'/>
Why it is not getting invoked correctly after installer finishes? I looked at "WixShellExecTarget" but not sure if this could really be used to run a PowerShell script with parameters. 
Appreciate help in this regard. 
ThxManish 


More information about the wix-users mailing list