[Files]
Source: "C:\MyProg.exe"; DestDir: "{app}"; BeforeInstall: GetHome(); Flags: ignoreversion
[INI]
Filename: "{myVarFromPascal}\.MyProg\settings.ini"; Section: "Settings"; Key: "sound"; String: "1"; Flags: createkeyifdoesntexist
[Code]
procedure GetHome();
var
myPascalVar: String;
begin
RegQueryStringValue(HKEY_CURRENT_USER, 'Volatile Environment','USERPROFILE', myPascalVar);
MsgBox('Value is "' + myPascalVar + '"', mbInformation, MB_OK);
end;
These are my three example sections in INNO Setup. I want to use myPascalVar
in the INI Section. How can I do it?
{reg:...}
constant instead. Though be aware that reading from HKCU during install may not give you the results you are expecting if you're running as admin. – Miral