문제

I have to make a Inno Setup script to write to the registry the {app} path with forward slashes instead of backslashes

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType:string; ValueName:"APP_HOME"; ValueData:"{app}"; Flags: preservestringtype

How to get {app} value with forward slashes (inno by default write it with backslashes)?

도움이 되었습니까?

해결책

You have to make a custom function for a {code:} scripted constant, e.g. this way:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "APP_HOME"; ValueData: {code:GetRegistryData}; Flags: preservestringtype

[Code]
function GetRegistryData(Value: string): string;
begin
  Result := ExpandConstant('{app}');
  StringChangeEx(Result, '\', '/', True);
end;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top