mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-05-23 02:34:08 +02:00
Fix installation path detection via registry in update installer
This commit is contained in:
parent
00acc677e6
commit
fadd95f3e6
@ -166,14 +166,20 @@ end;
|
|||||||
{ Returns a validated installation path (including trailing backslash) using the /UPDATEPATH parameter or installation info in registry. Returns empty string on failure. }
|
{ Returns a validated installation path (including trailing backslash) using the /UPDATEPATH parameter or installation info in registry. Returns empty string on failure. }
|
||||||
function TDFindUpdatePath: String;
|
function TDFindUpdatePath: String;
|
||||||
var Path: String;
|
var Path: String;
|
||||||
|
var RegistryKey: String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
Path := ExpandConstant('{param:UPDATEPATH}')
|
Path := ExpandConstant('{param:UPDATEPATH}')
|
||||||
|
|
||||||
if (Path = '') and not IsPortable and not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{{#MyAppID}}_is1', 'InstallLocation', Path) then
|
if (Path = '') and not IsPortable then
|
||||||
begin
|
begin
|
||||||
Result := ''
|
RegistryKey := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{{#MyAppID}}_is1'
|
||||||
Exit
|
|
||||||
|
if not (RegQueryStringValue(HKEY_CURRENT_USER, RegistryKey, 'InstallLocation', Path) or RegQueryStringValue(HKEY_LOCAL_MACHINE, RegistryKey, 'InstallLocation', Path)) then
|
||||||
|
begin
|
||||||
|
Result := ''
|
||||||
|
Exit
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if not FileExists(Path+'{#MyAppExeName}') then
|
if not FileExists(Path+'{#MyAppExeName}') then
|
||||||
|
Loading…
Reference in New Issue
Block a user