引用安装路径的子文件夹,而无需重复整个脚本

问题描述 投票:0回答:1

当您在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}
inno-setup installation-path
1个回答
2
投票

#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"

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.