Skip to content

Commit 9f4ce1e

Browse files
committed
Use HKA registry key instead of HKLM/HKEY_LOCAL_MACHINE in Windows installer.iss.in file.
1 parent efd0dd2 commit 9f4ce1e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

pkg/win32/installer.iss.in

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,7 @@ var
153153
begin
154154
sUnInstRegKey := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#MyAppName}{#CheckOldInstallerVersion}_is1';
155155
sUnInstPath := '';
156-
if not RegQueryStringValue(HKLM, sUnInstRegKey, 'UninstallString', sUnInstPath) then
157-
RegQueryStringValue(HKCU, sUnInstRegKey, 'UninstallString', sUnInstPath);
156+
RegQueryStringValue(HKA, sUnInstRegKey, 'UninstallString', sUnInstPath);
158157
Result := sUnInstPath;
159158
end;
160159

@@ -188,18 +187,18 @@ function CheckPgAdminAlreadyInstalled: Boolean;
188187
var
189188
Version: String;
190189
begin
191-
if RegKeyExists(HKEY_LOCAL_MACHINE,'Software\{#MyAppName}\{#CheckOldInstallerVersion}') then
190+
if RegKeyExists(HKA,'Software\{#MyAppName}\{#CheckOldInstallerVersion}') then
192191
begin
193192
if UnInstallOldVersion() < 3 then
194193
begin
195194
Result := False;
196195
end;
197196
end;
198197

199-
if RegValueExists(HKEY_LOCAL_MACHINE,'Software\{#MyAppName}', 'Version') then
198+
if RegValueExists(HKA,'Software\{#MyAppName}', 'Version') then
200199
begin
201200
UpgradeMode := True;
202-
RegQueryStringValue(HKEY_LOCAL_MACHINE,'Software\{#MyAppName}', 'Version', Version);
201+
RegQueryStringValue(HKA,'Software\{#MyAppName}', 'Version', Version);
203202
if CompareVersions(Version, '{#MyAppFullVersion}') = 1 then
204203
begin
205204
MsgBox(ExpandConstant('{cm:NewerVersionExists}' + '(v' + Version + ') is already installed' ), mbInformation, MB_OK);

0 commit comments

Comments
 (0)