Inno Setup: pack folder with all subfolders

2019-01-23 22:18发布

I have this line in .iss file:

Source: "..\Tcl\*"; DestDir: "{app}\Tcl"; Flags: ignoreversion

which packs folder Tcl. But it takes only files inside folder, but does not take subfolders inside Tcl. Is there a way to take entire folder Tcl with all subfolders and files? (without listing all that subfolders line by line).

Inno Setup 5.4.2.

标签: inno-setup
2条回答
Lonely孤独者°
2楼-- · 2019-01-23 23:01

Yes, there is. Simply include the recursesubdirs flag to your [Files] section entry. The help says about this flag the following:

Instructs the compiler or Setup to also search for the Source filename/wildcard in subdirectories under the Source directory.

So, all you should do is modify your [Files] section entry this way:

[Files]
Source: "..\Tcl\*"; DestDir: "{app}\Tcl"; Flags: ignoreversion recursesubdirs
查看更多
男人必须洒脱
3楼-- · 2019-01-23 23:18

You can also use the Inno Wizard, but you'll need to correct the script afterwards if you would like those files to stay in the folder they're imported from, because the Wizard will put them in the app default folder.

The wizard wil generate:

 [Files]
 Source: "..\Tcl\*"; DestDir: "{app}; Flags: ignoreversion recursesubdirs

If you need to maintain the folder structure you'll need:

 [Files]
 Source: "..\Tcl\*"; DestDir: "{app}\Tcl"; Flags: ignoreversion recursesubdirs

Inno Wizard Update as of 5.6.1 (08/14/2018)
The Inno Setup Script Wizard now has the option to specify a subfolder. On the Application Files step of the wizard, use the Add Folder... button, then after you select the folder you would like to add, make sure it is selected in the list and then click Edit... and under the Destination Subfolder textbox, specify where you would like the previously selected folder contents to go.

查看更多
登录 后发表回答