开发者

how to kill msiexec.exe in wix?

开发者 https://www.devze.com 2023-02-14 02:37 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消