[英]Inno Installer not creating sub-folder after installation
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. 我正在使用Inno进行此操作,正在按照GUI进行操作,就像从File-> New ...一样,并设置应用程序所需的所有文件和文件夹。
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. 安装程序创建安装包后,我已经测试了应用程序的安装,但是似乎所有文件都被复制到exe的同一文件夹中,没有创建子文件夹。
Here the complete script which generated by Inno 这里是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. 您可以在App目录中看到一个名为Resources
的文件夹名称,该文件夹名称应在安装时与其内容一起创建。 But right now no folder get created and all content of Resource
folder is copied exe directory. 但是现在没有文件夹被创建, Resource
文件夹的所有内容都被复制到exe目录。
Platform: Windows8 64 bit. 平台:Windows8 64位。
The script creation wizard puts all the added stuff into the application destination base folder, {app}
. 脚本创建向导将所有添加的内容放入应用程序目标基本文件夹{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. 那里的recursesubdirs
标志指示安装程序应将此文件夹递归包括所有与*
模式匹配的文件。 That would include also your \\Resources
subfolder. 那还将包括您的\\Resources
子文件夹。
At this time you can for example specify the target subfolder in the DestDir
parameter: 此时,您可以例如在DestDir
参数中指定目标子文件夹:
[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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.