do not create a double semi colon when adding to path (#202583)
* do not create a double semi colon when adding to path fixes #202268 * parens * bad signature * hmpull/202306/head
parent
0692340700
commit
85d3cd0eef
|
@ -1296,7 +1296,7 @@ Root: {#SoftwareClassesRootKey}; Subkey: "Software\Classes\Drive\shell\{#RegValu
|
|||
#define Uninstall32RootKey "HKLM32"
|
||||
#endif
|
||||
|
||||
Root: {#EnvironmentRootKey}; Subkey: "{#EnvironmentKey}"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Tasks: addtopath; Check: NeedsAddPath(ExpandConstant('{app}\bin'))
|
||||
Root: {#EnvironmentRootKey}; Subkey: "{#EnvironmentKey}"; ValueType: expandsz; ValueName: "Path"; ValueData: "{code:AddToPath|{app}\bin}"; Tasks: addtopath; Check: NeedsAddToPath(ExpandConstant('{app}\bin'))
|
||||
|
||||
[Code]
|
||||
function IsBackgroundUpdate(): Boolean;
|
||||
|
@ -1553,7 +1553,7 @@ begin
|
|||
until Length(Text)=0;
|
||||
end;
|
||||
|
||||
function NeedsAddPath(Param: string): boolean;
|
||||
function NeedsAddToPath(VSCode: string): boolean;
|
||||
var
|
||||
OrigPath: string;
|
||||
begin
|
||||
|
@ -1562,7 +1562,19 @@ begin
|
|||
Result := True;
|
||||
exit;
|
||||
end;
|
||||
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
|
||||
Result := Pos(';' + VSCode + ';', ';' + OrigPath + ';') = 0;
|
||||
end;
|
||||
|
||||
function AddToPath(VSCode: string): string;
|
||||
var
|
||||
OrigPath: string;
|
||||
begin
|
||||
RegQueryStringValue({#EnvironmentRootKey}, '{#EnvironmentKey}', 'Path', OrigPath)
|
||||
|
||||
if (Length(OrigPath) > 0) and (OrigPath[Length(OrigPath)] = ';') then
|
||||
Result := OrigPath + VSCode
|
||||
else
|
||||
Result := OrigPath + ';' + VSCode
|
||||
end;
|
||||
|
||||
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
|
||||
|
|
Loading…
Reference in New Issue