How to get Inno Setup to dynamically set the installation folder

I am creating an installation package, and the user should be able to install it only in a specific place.

To do this, I read some registry values ​​in the section [Code]to determine the installation path.

After setting the path, I need to force Inno Setup to install the installation folder to a specific location at runtime.

Is this possible in Inno Setup? Which section of the script should be used, if so?

Thank.

+4
source share
1 answer
[Setup]
DefaultDirName={code:GetDefaultDirName}
DisableDirPage=Yes

[Code]

function GetDefaultDirName(Param: string): string;
begin
  Result := ...;
end;
+4

Source: https://habr.com/ru/post/1654381/


All Articles