joyceck
Posts: 5
Joined: Wed Aug 22, 2007 7:50 pm

Custom Actions to check processes

Anyone have a custom action that checks to see if a program is running
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can see if a process is running by using this custom action:

Code: Select all

Dim objWMIService, objProcess, colProcess
Dim strComputer 
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _ 
& strComputer & "\root\cimv2") 

Set colProcess = objWMIService.ExecQuery _
("Select * from Win32_Process")

For Each objProcess in colProcess
if objProcess.Name = "thunderbird.exe" then
	MsgBox objProcess.Name
End If
Next
You can modify this custom action in order to fit your needs.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Pepa
Posts: 15
Joined: Fri Jul 07, 2006 7:59 pm
Location: USA
Contact: Website

Is there any way to modify this script to abort this installation if the process is detected to be running?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

I have answered to this questions on another thread, please take a look:
http://www.advancedinstaller.com/forums ... php?t=5427

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”