rectangletangle
rectangletangle

Reputation: 52911

Inno Setup Folders

I want to make an Inno Setup script that installs an .exe file, several .dll files, a zip folder, and a regular folder.

I'm fairly certain that I go about the .exe and .dll files like any ordinary file. However, how do I go about the two folders?

My script as it stands:

[Setup]
AppName=My Program
AppVersion=1.5
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
Compression=lzma2
SolidCompression=yes
OutputDir=userdocs:Inno Setup Examples Output

[Files]
Source: "MyProg.exe"; DestDir: "{app}"

Upvotes: 1

Views: 5281

Answers (1)

mirtheil
mirtheil

Reputation: 9192

If you are creating empty directories, you can add a [Dirs] section to your script. If you want to put a directory of files into the setup and install them, you can use the recursesubdirs flag on your files section. Here's an example of both.

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2CC00BF8-CC76-41A1-92AB-CD40FFC9C6E1}
AppName=My Program
AppVersion=1.5
;AppVerName=My Program 1.5
AppPublisher=My Company, Inc.
AppPublisherURL=http://www.example.com/
AppSupportURL=http://www.example.com/
AppUpdatesURL=http://www.example.com/
DefaultDirName={pf}\My Program
DefaultGroupName=My Program
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Dirs]
Name: "Examples"

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "C:\source\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "c:\source\examples\*.*"; DestDir: "{app}\examples"; Flags: recursesubdirs


; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
Name: "{commondesktop}\My Program"; Filename: "{app}\MyProg.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\MyProg.exe"; Description: "{cm:LaunchProgram,My Program}"; Flags: nowait postinstall skipifsilent

Upvotes: 6

Related Questions