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
- ChromeRegKey = 'Software\Microsoft\Windows\CurrentVersion\App Paths\chrome.exe';
- FirefoxRegKey = 'Software\Mozilla\Mozilla Firefox';
- // based on http://stackoverflow.com/a/22538486/960757
- function IsChromeInstalled: Boolean;
- begin
- // check if there's the Chrome app registration entry under the 32-bit registry
- // view of HKCU or HKLM key
- Result := RegKeyExists(HKCU32, ChromeRegKey) or RegKeyExists(HKLM32, ChromeRegKey);
- end;
- // based on http://stackoverflow.com/a/7135283/960757
- function IsFirefoxInstalled: Boolean;
- begin
- // check if there's the Firefox reg key under the 32-bit registry view of HKLM
- Result := RegKeyExists(HKLM32, FirefoxRegKey);
- end;
- function InitializeSetup: Boolean;
- begin
- // we won't continue if either of these is installed
- Result := not (IsChromeInstalled or IsFirefoxInstalled);
- // if we won't continue, show up a message box
- if not Result then
- MsgBox('You have installed Chrome and/or Firefox. Uninstall them and run this setup again.', mbError, MB_OK);
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement