使用Inno Setup搜索文件并安装到该位置

时间:2016-08-24 01:21:47

标签: inno-setup

我是Stackoverlow和Inno Setup的新手,以及我猜的所有内容。

我正在尝试让Inno安装程序搜索文件(在这种情况下是Wow.exe(我正在制作界面安装程序)),然后将文件夹和文件安装到该目录中。

例如:

  • 用户选择魔兽世界目录
  • 安装程序将设置目录和文件复制到魔兽世界文件夹

我的问题:

#define MyAppName "Orangepaw3 UI Installer"
#define MyAppVersion "1.1"
#define MyAppPublisher "Orangepaw3.net"
#define MyAppURL "http://www.orangepaw3.net"
#define VCLStyle "RubyGraphite.vsf"

[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={{56FE86A8-B8B8-42B6-A569-0D6D261AF486}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
InfoBeforeFile=C:\Users\user\files\instructions2.txt
InfoAfterFile=C:\Users\user\files\instructions.txt
OutputBaseFilename=OP3 UI Installer
Compression=lzma
SolidCompression=yes

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

[Code]

// Import the LoadVCLStyle function from VclStylesInno.DLL
procedure LoadVCLStyle(VClStyleFile: String); external 'LoadVCLStyleW@files:VclStylesInno.dll stdcall';

// Import the UnLoadVCLStyles function from VclStylesInno.DLL
procedure UnLoadVCLStyles; external 'UnLoadVCLStyles@files:VclStylesInno.dll stdcall';

function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('{#VCLStyle}');
LoadVCLStyle(ExpandConstant('{tmp}\{#VCLStyle}'));
Result := True;
end;

procedure DeinitializeSetup();
begin
    UnLoadVCLStyles;
end;

[Files]
Source: "D:\World of Warcraft\Interface\*"; DestDir: "{app}/Interface"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "D:\World of Warcraft\WTF\*"; DestDir: "{app}/WTF"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: VclStylesinno.dll; DestDir: {app}; Flags: dontcopy
Source: Styles\{#VCLStyle}; DestDir: {app}; Flags: dontcopy
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

很抱歉,如果上面的代码很长,我会尽力将其正确格式化。

如何更改此设置,以便安装程序在其系统上找到Wow.exe,然后安装到该目录?魔兽世界>界面>文件和WTF>文件

我希望这是有道理的。我已经在互联网上阅读过,我只是在这一点上感到困惑。

提前谢谢。

Orangepaw3

0 个答案:

没有答案