Inno Setup:下载后如何执行多个文件?

时间:2017-11-06 14:49:17

标签: inno-setup inno-download-plugin

我是Inno设置和编程的新手。我还下载了Inno Download Plugin。这是我的代码:

#include <idp.iss>

[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={{03266F5E-17A0-4473-BC18-EF511BDFDB5A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
SetupIconFile="C:\Desktop\appIcon.ico"

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

[Types]
Name: "full"; Description: "Without Requirements"
Name: "custom"; Description: "With Requirements"; Flags: iscustom

[Components]
Name: "program"; Description: "My Program"; Types: full custom; Flags: fixed
Name: "framework4"; Description: "Microsoft .NET Framework 4 Client Profile"; Types: custom
Name: "sqlServer32"; Description: "SQL Server 2012 (32 bits) English"; Types: custom
Name: "sqlServer64"; Description: "SQL Server 2012 (64 bits) English"; Types: custom
Name: "sqlServerManagment32"; Description: "SQL Server Managment Studio (32 bits)"; Types: custom
Name: "sqlServerManagment64"; Description: "SQL Server Managment Studio (64 bits)"; Types: custom
Name: "crystalReports"; Description: "Crystal Reports"; Types: custom

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

[Files]
All my program files... with Components: program;

[Code]
procedure InitializeWizard();
begin
 idpDownloadAfter(wpReady);
end;

function NextButtonClick(CurPage: Integer): Boolean;
begin
  if CurPage = wpSelectComponents then
  begin
    idpClearFiles;
    if IsComponentSelected('sqlServer64') then idpAddFile('http://download.microsoft.com/download/8/D/D/8DD7BDBA-CEF7-4D8E-8C16-D9F69527F909/ENU/x64/SQLEXPRWT_x64_ENU.exe',ExpandConstant('{tmp}\SqlServer201264Eng.exe'));
    if IsComponentSelected('crystalReports') then idpAddFile('http://downloads.businessobjects.com/akdlm/crnetruntime/clickonce/CRRuntime_32bit_13_0_21.msi',ExpandConstant('{tmp}\CrystalReport32bit.msi'));
  end; 
  Result := True;
end;

我想要做的是让用户选择他/她想要安装的组件,下载设置并在安装程序之前执行它们。
我现在所拥有的是下载设置的部分,但我不知道如何执行它们 我对此并不了解,因此对代码的任何改进都将受到赞赏。 感谢。

0 个答案:

没有答案