Been a big fan of PowerShell Universal and bought it for work. Recently discovered PSMSI which I want to start utilizing but I seem to be running into an issue with CustomActions.
Trying to pass the same/similar ScriptArguments to RunOnUninstall doesn’t appear to work as RunOnInstall.
Looking at the generated WXS file shows two different PowerShell command methods (Install CustomAction = -File vs Uninstall Custom Action = -Command) and no ScriptArgument being passed for the Uninstall CustomAction:
<CustomAction Id=“CAf877bc71c53b4331ac4af05cc5d30941INSTALL” Property=“POWERSHELL” ExeCommand=“-NoExit -File "[#InstallScript]" -Message "Application Installed"" Return=“ignore” Execute=“deferred” />
<CustomAction Id=“CA2487b58486ae4f91b3d4c0ff74c440c7UNINSTALL” Property=“POWERSHELL” ExeCommand=”-NoExit -Command "{& ‘[#UninstallScript]’}"" Return=“ignore” Execute=“deferred” />
Shouldn’t it use the same method for each and the only difference be when it runs, on Install vs Uninstall?