Created
March 22, 2011 05:06
-
-
Save topher200/880804 to your computer and use it in GitHub Desktop.
In Inno Setup, figure out if we're running an upgrade or a fresh install
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used to determine if we are running a new install or an upgrade by checking | |
// for the AppID in the registry. | |
function IsNewInstall(): Boolean; | |
var | |
AppID: String; | |
UninstallPath: String; | |
begin | |
AppID := '{enter-AppID-here}' | |
UninstallPath := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\' + AppID + '_is1'; | |
Result := not (RegKeyExists(HKEY_CURRENT_USER, UninstallPath) | |
OR RegKeyExists(HKEY_LOCAL_MACHINE, UninstallPath)); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment