View Full Version : check for a running process
tdexter
07-18-2007, 04:41 PM
If there a way to check if a process(.dll) is running before the install gets going ? If a user has the product running and trying to install a new version of the product, things will go badly.
alexzfirm
07-19-2007, 06:46 PM
Stuff like that should be put into FAQ... I had to ask here as well and then dork around writing the working script...
If I understand correctly it can be done via bootstrapper only
Here is what I did
- Add code below to "C:\Program Files\Setup Factory for Windows Installer Trial\Bootstrap\Data\default_embed_setup.lua" (somewhere close to the top)
- In the build settings set "bootstrapper = Standard"
- Compiled .EXE will be aware about running process, the .MSI will not
processes = Window.EnumerateProcesses();
if (processes ~= nil) then
for index in processes do
nFoundPos = String.Find(processes[index], "notepad.exe");
if (nFoundPos ~= nil) then
if (nFoundPos >= 0) then
Dialog.Message( "Found notepad.exe " .. processes[index], "Tada " .. nFoundPos );
Application.Exit();
end;
end
end
end
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.