powershell - How do you troubleshoot PS1 script execution in MSI installer? -
i've tested , ran ps1 scripts , ran find without problem. tried integrate them wix installer fail stupid installer never give meaningful on why failed...
i have these in wix wxs file:
<property id="installplugin" value=""powershell.exe -file [#installps1]"" /> <customaction id="installplugin" binarykey="wixca" dllentry="wixquietexec" execute="deferred" return="ignore" impersonate="no"/> <property id="uninstallplugin" value=""powershell.exe -file [#uninstallps1]"" /> <customaction id="uninstallplugin" binarykey="wixca" dllentry="wixquietexec" execute="deferred" return="ignore" impersonate="no"/> <installexecutesequence> <custom action="installplugin" before="installfinalize">not installed</custom> <custom action="uninstallplugin" after="installinitialize">(not upgradingproductcode) , (remove="all")</custom> </installexecutesequence>
i captured install log, can see script being called , failed code 1603, doesn't mean anything...
msi (s) (f0:b0) [11:15:45:969]: running service. msi (s) (f0:b0) [11:15:45:972]: hello, i'm 32bit elevated non-remapped custom action server. wixquietexec: entering wixquietexec in c:\windows\installer\msi19c1.tmp, version 3.11.1701.0 wixquietexec: "powershell.exe -file c:\program files (x86)\blah\install.ps1" wixquietexec: error 0x80070002: command failed execute. wixquietexec: error 0x80070002: quietexec failed wixquietexec: error 0x80070002: failed in execcommon method customaction installplugin returned actual error code 1603 translated success due continue marking
i've tried various combinations of customaction
attributes didn't @ all. love use return="check"
prevent installer finish (my installer has no problem installing else, there no errors, ps1 script somehow blocking).
if navigate installed folder, say, c:\program files (x86)\blah
, manually run script, .\install.ps1
, ran , behave expected.
can wix experts give me tips of troubleshooting this? googling around didn't help...
ps: in install.ps1
launch elevated powershell session (but shouldn't matter since person running installer must have admin rights begin with), i'm not sure if that's causing error, , if yes, how can workaround script launching script?
edit:
the script i'm trying run in question posted here in superuser forum. essentially, i'm going through windows registry trying find exchange server installed , grab built-in ems script , load it.
the wix quiet execute ca requires powershell.exe qualified , wrapped in quote.
"[systemfolder]windowspowershell\v1.0\powershell.exe" -noprofile -executionpolicy bypass -file "[#filekey]"
or that. honestly, i'd in c# / dtf or use c# / dtf create powershell pipeline , invoke way. more control on invocation, error handling, logging , on on.
Comments
Post a Comment