Tuesday, 21 June 2011

Executing KillProcess VBS in CustomAction.

1. Go to MSI Script in CustomAction section

2. Select Normal Installation and goto Execute Deferred.

3. Above InstallFiles and Under MoveFiles

   Put If condition and set the condition as "REMOVE = "ALL""
4. Under that select "Call VBScript from Embedded Code"
1. CustomActionName : CA_KillProcess
2. Enter the VBScript to Execute :
strComputer = "."
Set b= GetObject("winmgmts:\\" & strComputer)
Set a= b.ExecQuery("SELECT * FROM Win32_Process WHERE Name ='AnalyzeGuard.exe'")
For Each c in a
    c.Terminate()
Next

Under Properties Tab
-------------------------

Processing : Synchronous, Ignores ExitCode
Scheduling options : Always Execute.

No comments:

Post a Comment