当用户更改安装文件夹,例如更改为C:\CustomFolder
时,我基于Inno Setup的安装程序应使用以下子文件夹进行安装:C:\CustomFolder\Parent\Child
。
到目前为止,我发现有一个AppendDefaultDirName
选项,该选项将DefaultDirName
的最后一个部分附加到所选的文件夹名称中。但这不是我需要的行为。
答案 0 :(得分:1)
一种简单的解决方案是在脚本中的所有位置使用{app}\Parent\Child
,而不是普通的{app}
。
您可以为此创建一个preprocessor define以避免重复。
您可能还想使用UninstallFilesDir
directive将卸载文件移动到那些子文件夹。
#define TheAppPath "{app}\Parent\Child"
[Setup]
UninstallFilesDir={#TheAppPath}
[Files]
Source: "MyProg.exe"; DestDir: "{#TheAppPath}"
Source: "MyProg.dat"; DestDir: "{#TheAppPath}"