2
votes

I need to create the an installer for my application. I am using Inno for doing this, I am following the GUI for doing it like from File->New...and set all the files and folders required for my application.

My application contains sub-folder and in which there are some resource file. After installer create installation package, I have tested the application installation, but it seems all the files are copied to same folder of exe, no sub-folder creating.

Here the complete script which generated by Inno

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

#define MyAppName "APP"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "AppName.exe"

[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={{E327E502-E384-48AA-A190-82DD14B6FE07}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "C:\Users\me\Desktop\InstallerCreation\App\App.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\me\Desktop\InstallerCreation\App\avcodec-55.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\me\Desktop\InstallerCreation\App\Resources\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

You can see a folder name Resources inside App directory, which should be created while installation with it's content. But right now no folder get created and all content of Resource folder is copied exe directory.

Platform: Windows8 64 bit.

1

1 Answers

3
votes

The script creation wizard puts all the added stuff into the application destination base folder, {app}. The subfolder would be created if you added the whole deployment folder:

C:\Users\me\Desktop\InstallerCreation\App\

That would create entry like this:

[Files]
Source: "C:\Users\me\Desktop\InstallerCreation\App\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

The recursesubdirs flag there instructs the setup that for this folder should be recursively included all the files matching the * pattern. That would include also your \Resources subfolder.

At this time you can for example specify the target subfolder in the DestDir parameter:

[Files]
Source: "C:\Users\me\Desktop\InstallerCreation\App\Resources\*"; DestDir: "{app}\Resources"; Flags: ignoreversion recursesubdirs createallsubdirs

But the best you can do is making a dedicated folder for deployment and add everything it contains by a single entry like this:

[Files]
Source: "C:\MyApp\Deployment\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs