当您在Inno设置安装程序中提供文件夹位置时,它将其设置为常数
{app}
。如果将文件夹位置作为C:\Program Files\Test1
给出,则将其设置为{app}
变量。当用户提供此路径时,是否可以添加到这样的{app}
变量C:\Program Files\Test1\MyApp-3.1
??
如果用户将文件夹位置作为
C:\Program Files\Test1
提供,然后单击next按钮,则应将其更改为C:\Program Files\Test1\MyApp-3.1
。这可能吗?
to to this page{app}
,例如,[Icons]
[Run]
[InstallDelete]
[UninstallRun]
{app}\Run.exe
更改为{app}\Run.exe
。
我有一个程序,该程序总是需要从文件夹结构
{app}\Program\Run.exe
{app}
。如果用户选择安装文件夹为
C:\Program Files\Test1\MyApp-3.1
,则需要将文件夹设置为
MyApp-3.1\Run.exe
。简单的方法是用其中的C:\Program Files\Test1
创建文件夹
C:\Program Files\Test1\MyApp-3.1
,然后将该文件夹添加到安装程序中。因此它将安装
MyApp-3.1
文件夹。问题是,如果文件夹名称更改为
Run.exe
,则必须在代码中更改批次。问题是在单击文件夹选择对话框中的下一个按钮后,您可以设置
MyApp-3.1
变量吗?
看起来您实际上需要一个Preprocessor宏观:
MyApp-3.2
{app}
#define DestPath "{app}\MyApp-3.1"
[Files]
Source: "Run.exe"; DestDir: "{#DestPath}"
Source: "Otherfile"; DestDir: "{#DestPath}"
[Icons]
Name: "{commondesktop}\My Program"; Filename: "{#DestPath}\Run.exe"; \
WorkingDir: "{#DestPath}"
[Run]
Filename: "{#DestPath}\Run.exe"; Parameters: "/install"
[UninstallRun]
Filename: "{#DestPath}\Run.exe"; Parameters: "/uninstall"