【问题标题】:Inno setup script doesn't run accessruntime after installing .netInno 安装脚本在安装 .net 后不运行 accessruntime
【发布时间】:2017-03-10 19:36:44
【问题描述】:

我在安装程序脚本方面遇到了一些问题 我想安装我的应用程序,它需要在主机上安装 .net 4.5。它还需要 AccessRuntime2007。

我有一些麻烦,因为 Accessruntime 不会使用脚本安装。 也许顺序有问题?谁能帮帮我?

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

#define MyAppName "JazzNotes"
#define MyAppVersion "1.0"
#define MyAppPublisher "EMDEE TECH"
#define MyAppURL "www.jazznotes.com"
#define MyAppExeName "JazzNotes.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={{2F4E8FD6-6151-45A1-A421-8CA123E312CF}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\license.txt
OutputDir=C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\inno output
OutputBaseFilename=Install Jazznotes
SetupIconFile=C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\icons\Itzikgur-My-Seven-Music-Piano-Chello.ico
Compression=lzma
SolidCompression=yes

[Types]
Name: "full"; Description: "Full installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom


[Components]
Name: "program"; Description: "Program Files"; Types: full custom; Flags: fixed
Name: "help"; Description: "Help File";    Types: full
Name: "Net"; Description: ".NET 4.5 Framework";   Types: full
Name: "Acrobat" ; Description: "Acrobat Reader 8"; Types: full
Name: "Access" ; Description: "Access runtime files"; Types: full

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

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

[Files]
Source: "dependencies\AccessRuntime.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework2; Components: Access
Source: "dependencies\AdbeRdr11010_en_US.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework3; Components: Acrobat
Source: "dependencies\dotnetfx45_full_x86_x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall; AfterInstall: InstallFramework; Check: FrameworkIsNotInstalled ;Components: Net



Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\JazzNotes.exe"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\AxInterop.AcroPDFLib.dll"; DestDir: "{app}"; Flags: ignoreversion      ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\AxInterop.WMPLib.dll"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\Interop.AcroPDFLib.dll"; DestDir: "{app}"; Flags: ignoreversion  ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\Interop.WMPLib.dll"; DestDir: "{app}"; Flags: ignoreversion  ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\JazzNotes.exe.config"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\NAudio.dll"; DestDir: "{app}"; Flags: ignoreversion  ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\bin\x86\Release\UltraID3Lib.dll"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Microsoft.VisualBasic.Compatibility.dll"; DestDir: "{app}"; Flags: ignoreversion  ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Core.dll"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.DataSetExtensions.dll"; DestDir: "{app}"; Flags: ignoreversion     ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Data.dll"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Deployment.dll"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Design.dll"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.dll"; DestDir: "{app}"; Flags: ignoreversion     ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Drawing.dll"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Net.Http.dll"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Web.dll"; DestDir: "{app}"; Flags: ignoreversion      ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Windows.Forms.dll"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.XML.dll"; DestDir: "{app}"; Flags: ignoreversion      ; Components: program
Source: "C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\System.Xml.Linq.dll"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
Source: "C:\Program Files (x86)\Microsoft.NET\Primary Interop Assemblies\stdole.dll"; DestDir: "{app}"; Flags: ignoreversion       ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPE.TTF"; DestDir: "{app}"; Flags: ignoreversion      ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPEB.TTF"; DestDir: "{app}"; Flags: ignoreversion      ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPEBO.TTF"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\MusiCAT\LTYPEO.TTF"; DestDir: "{app}"; Flags: ignoreversion   ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\jingle.wav"; DestDir: "{app}"; Flags: ignoreversion     ; Components: program
Source: "C:\Users\donnersm\Documents\Visual Studio 2015\Projects\MusiCAT\musica.accdb"; DestDir: "{app}"; Flags: ignoreversion    ; Components: program
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Code]
function FrameworkIsNotInstalled: Boolean;
begin
  Result := not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\.NETFramework\policy\v4.5');
end;

procedure InstallFramework;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := 'Installing .NET framework...';
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    if not Exec(ExpandConstant('{tmp}\dotnetfx45_full_x86_x64.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
       // you can interact with the user that the installation failed
       MsgBox('.NET installation failed with code: ' + IntToStr(ResultCode) + '.',
         mbError, MB_OK);
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;
  end;
end;

procedure InstallFramework2;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := 'Installing Access Runtime files...';
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    if not Exec(ExpandConstant('{tmp}\AccessRuntime.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
       // you can interact with the user that the installation failed
       MsgBox('Access Runtime installation failed with code: ' + IntToStr(ResultCode) + '.',
         mbError, MB_OK);
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;
  end;
end;


procedure InstallFramework3;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := 'Installing Acrobar Reader';
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    if not Exec(ExpandConstant('{tmp}\AdbeRdr11010_en_US.exe'), '/q /noreboot', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
       // you can interact with the user that the installation failed
       MsgBox('Acrobat installation failed with code: ' + IntToStr(ResultCode) + '.',
         mbError, MB_OK);
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;
  end;
end;






[Icons]
Name: "{commonprograms}\{#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

【问题讨论】:

  • 如果 AccessRuntime 需要 .NET(我不知道,但您的问题标题暗示了这一点),那么您必须在 .NET 框架之后安装它。你现在先安装它。另外,您应该告诉我们安装失败的原因。我们不会为你猜测。只需删除/q 开关,您就会看到问题所在。 -1,直到你给我们一些合理的细节。
  • 好的,我删除了 /q 并正在编译...我将运行它并提供反馈。关于应用程序...我的应用程序需要 Access 运行时库、.net 4.5 运行时库和 acrobat 阅读器...

标签: inno-setup


【解决方案1】:

谢谢马丁!您删除 /q 的建议有帮助!原来 accessruntime.exe 不允许 /noreboot....我将其更改为 /norestart... 并且它起作用了!

【讨论】:

    猜你喜欢
    • 2016-12-29
    • 1970-01-01
    • 2018-05-28
    • 1970-01-01
    • 2022-07-08
    • 1970-01-01
    • 1970-01-01
    • 2010-11-06
    • 2014-08-07
    相关资源
    最近更新 更多