diff --git a/repertory.iss.in b/repertory.iss.in index b6175feb..bf2ddb61 100644 --- a/repertory.iss.in +++ b/repertory.iss.in @@ -32,16 +32,19 @@ WizardStyle=modern function CheckAddPath(Param: string): boolean; var CurPath: string; + PathPos: Integer; begin - if not RegQueryStringValue(HKEY_LOCAL_MACHINE, + if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', - 'Path', CurPath) + 'PATH', CurPath) then begin - Result := True; + PathPos := Pos(';' + Param + ';', ';' + CurPath + ';'); + Result := PathPos = 0; + MsgBox('Path|' + CurPath + '|Param|' + Param + '|Pos|' + IntToStr(PathPos), mbInformation, MB_OK); exit; end; - Result := Pos(';' + Param + ';', ';' + CurPath + ';') = 0; + Result := True; end; [Languages] @@ -66,4 +69,4 @@ Filename: "msiexec.exe"; WorkingDir: "{app}"; Parameters: "/a winfsp-@WINFSP_VER [Registry] Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; \ ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app};"; \ - Check: CheckAddPath('{app}') + Check: CheckAddPath("{app}")