Inno安装程序安装后未创建子文件夹
问题描述:
我需要为我的应用程序创建安装程序。我正在使用Inno做这件事,我正在按照图形用户界面进行操作,例如从文件 - >新建...并设置我的应用程序所需的所有文件和文件夹。Inno安装程序安装后未创建子文件夹
我的应用程序包含子文件夹,其中有一些资源文件。安装程序创建安装包后,我已经测试了应用程序的安装,但似乎所有的文件都被复制到exe文件夹中,没有创建子文件夹。
这里它由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
产生你可以看到应用程序目录,同时安装与它的内容应创建一个文件夹里面的名字Resources
完整的剧本。但是现在没有文件夹被创建,并且Resource
文件夹的所有内容都被复制到了exe目录中。
平台:Windows8 64位。
答
脚本创建向导将所有添加的东西放入应用程序目标基文件夹{app}
。如果添加了整个部署文件夹的子文件夹将被创建:
C:\Users\me\Desktop\InstallerCreation\App\
那将造成这样的条目:
[Files]
Source: "C:\Users\me\Desktop\InstallerCreation\App\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
的recursesubdirs
标志有指示安装,对于这个文件夹应该是递归包括所有与*
模式匹配的文件。这也包括您的\Resources
子文件夹。
这时例如,您可以指定在DestDir
参数相符的目标子文件夹:
[Files]
Source: "C:\Users\me\Desktop\InstallerCreation\App\Resources\*"; DestDir: "{app}\Resources"; Flags: ignoreversion recursesubdirs createallsubdirs
但是你可以做的最好的就是做一个专门的文件夹进行部署,并通过像一个单一的条目添加它包含了一切这样的:
[Files]
Source: "C:\MyApp\Deployment\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
嗨感谢您的回答,我使用它错了,现在它的工作时,我给专门的文件夹为整个应用程序,我有一个更多的问题,是安装在桌面上创建快捷方式,但没有对图标快捷键,我已经设置了图标wh通过向导创建脚本。 – Haris
该快捷方式应该从应用程序中获取图标。只能选择为输出设置指定图标,而不是该脚本创建向导中主要可执行文件的快捷方式。你只能说如果你想创建一个主要的可执行桌面图标或不在那里。如果你想为你的桌面快捷方式明确指定图标(给它与可执行文件不同的图标),你需要修改脚本,更具体的说,添加IconFilename和/或IconIndex参数'[图标]'部分。 – TLama
好吧,我会检查它。 – Haris