简体   繁体   English

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

[英]How to force Inno Setup to set the installation folder dynamically

I am creating an installation package and user should be able to install it on a specific location only.我正在创建一个安装包,用户应该只能在特定位置安装它。

In order to do so I read some registry values in the [Code] section to determine the installation path.为此,我阅读了[Code]部分中的一些注册表值以确定安装路径。

Having the installation path I need to force Inno Setup to set the installation folder to a specific location at run-time.有了安装路径,我需要强制 Inno Setup 在运行时将安装文件夹设置为特定位置。

Is this possible in Inno Setup?这在 Inno Setup 中可行吗? Which section of script should be used if so?如果是这样,应该使用脚本的哪个部分?

Thanks.谢谢。

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

[Code]

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM