check whether application is running using innosetupsome times it is necessary to quit the installation if old version of your application is running or you may want to install the patch and patch may not be installed correctly if the application is running in the background and the process will be locking all the dll's so here is the simple way of doing this in innosetup by pvince.dll you can download this dll click here
below is the sample script for doing this just tuck it in your innosetup script as needed and dont forget to download and put the dll in c: folder
[Setup]
AppName=PSVince
AppVerName=PSVince 1.0
DisableProgramGroupPage=true
DisableStartupPrompt=true
OutputDir=.
OutputBaseFilename=testpsvince
Uninstallable=false
DisableDirPage=true
DefaultDirName={pf}\PSVince
[Files]
Source: c:\psvince.dll; Flags: dontcopy
[Code]
function IsModuleLoaded(modulename: String ): Boolean;
external 'IsModuleLoaded@files:psvince.dll stdcall';
function InitializeSetup(): Boolean;
begin
if(Not IsModuleLoaded( 'yourappname.exe' )) then
begin
MsgBox('Application is not running', mbInformation, MB_OK);
Result := true;
end
else
begin
MsgBox('Application is Running so exitting', mbInformation, MB_OK);
Result := false;
end
end;
this is the easiest way of detecting the running applications during the installation of application by using innosetup installer kit... if you are using innosetup you may also be interested in below article http://probedeep.blogspot.com/2008/03/check-dotnet-framework-using-innosetup.html
Search
Monday, May 5, 2008
innosetup Script to detect whether the program is running during installation ?
Posted by
Manjunath
at
11:17 PM
Labels: programming
Subscribe to:
Post Comments (Atom)
3 comments:
Thank you so much for the post!!!
Doesn't work, always says not loaded when blatantly is.
Doesn't work on Windows 2012 x64 :-(
I tried with a 32 and 64 bit application and it wouldn't work.
Has anybody an idea to fix it?
Post a Comment