如何强制 Inno Setup 动态设置安装文件夹

Las*_*ing 6 installation inno-setup

我正在创建一个安装包,用户应该只能在特定位置安装它。

为此,我阅读了部分中的一些注册表值[Code]以确定安装路径。

有了安装路径,我需要强制 Inno Setup 在运行时将安装文件夹设置为特定位置。

这在 Inno Setup 中可行吗?如果是这样,应该使用脚本的哪个部分?

谢谢。

Mar*_*ryl 5

[Setup]
DefaultDirName={code:GetDefaultDirName}
DisableDirPage=Yes

[Code]

function GetDefaultDirName(Param: string): string;
begin
  Result := ...;
end;
Run Code Online (Sandbox Code Playgroud)