Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Setup]
- AppName=My Program
- AppVersion=1.5
- DefaultDirName={pf}\My Program
- [Code]
- const
- // our system-wide unique mutex name (at most MAX_PATH == 260 chars long,
- // case sensitive for comparison)
- MutexName = 'AAD45705-FD28-49E5-99A7-BB7638E16D3B';
- function InitializeSetup: Boolean;
- begin
- // do not continue if our mutex already exists (it means another instance
- // of this setup is running)
- Result := not CheckForMutexes(MutexName);
- // if our mutex was not found (no other instance is running), create one,
- // otherwise show a message and let the setup exit
- if Result then
- CreateMutex(MutexName)
- else
- MsgBox('Setup is already running.', mbInformation, MB_OK);
- end;
- function InitializeUninstall: Boolean;
- begin
- // here if you create our mutex, the installer won't start (it prevents to
- // start the installer when an instance of the uninstaller is running)
- CreateMutex(MutexName);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement