选择C:\ CustomFolder安装路径后,安装路径应为子文件夹C:\ CustomFolder \ Parent \ Child

时间:2019-01-28 12:46:15

标签: installer inno-setup

当用户更改安装文件夹,例如更改为C:\CustomFolder时,我基于Inno Setup的安装程序应使用以下子文件夹进行安装:C:\CustomFolder\Parent\Child

到目前为止,我发现有一个AppendDefaultDirName选项,该选项将DefaultDirName的最后一个部分附加到所选的文件夹名称中。但这不是我需要的行为。

1 个答案:

答案 0 :(得分:1)

一种简单的解决方案是在脚本中的所有位置使用{app}\Parent\Child,而不是普通的{app}

#define TheAppPath "{app}\Parent\Child"

[Setup]
UninstallFilesDir={#TheAppPath}

[Files]
Source: "MyProg.exe"; DestDir: "{#TheAppPath}"
Source: "MyProg.dat"; DestDir: "{#TheAppPath}"