how to kill msiexec.exe in wix?
I have a wix application running.and when i am trying to uninstall it,it should prompt for close the application.I would like to kill the msiexec.exe after it prompts.Right now it prompts to close but as soon as i close the dialog box it shows there is some problem in the script and later Fatal error during installation comes.Please help me...
<CustomAction Id="Show" Script="vbscript">
<![CDATA[
set service = GetObject ("winmgmts:")
for each Proc开发者_JS百科ess in Service.InstancesOf ("Win32_Process")
If Process.Name = "CAS.exe" or Process.Name = "CMSS.exe"
then
msgbox "CAS is running...Please close it before uninstalling"
WScript.quit
End If
next
]]>
</CustomAction>
<InstallExecuteSequence>
<Custom Action="Show" After="FindRelatedProducts">REMOVE</Custom>
</InstallExecuteSequence>
You can create an msi log file to determine which specific custom action failed during installation.
I would recommend not using
WScript.Quit
Instead, use
Exit For
for example.
If CMSS.exe and CAS.exe are not running, then set an msi property and then in your wxs file, specify a condition that checks the value of that property to determine if the next dialog should be displayed for example.
精彩评论