Inno Setup MS Access 2010静默安装

时间:2017-03-23 17:31:38

标签: ms-access ms-access-2010 inno-setup

我想使用Inno Setup为Access 2010运行时创建安装程序。

当我尝试编译文件时,我从Inno Setup收到此错误:

  

文件:xxxx \ config.xml
  第1行:
  无法识别的参数名称“”

我已经创建了推荐的config.xml文件,如下所示(实际上我只是逐字复制)。

config.xml文件:

<Configuration Product="AccessRT">
        <Display Level="Basic" CompletionNotice="no" SuppressModal="yes" AcceptEula="yes" />
        <Setting Id="SETUP_REBOOT" Value="IfNeeded" />
</Configuration>

Inno设置文件:

#include <idp.iss>

[Files]
Source: C:\Users\john.eggHeadLtd\OneDrive\blueEggShare\config.xml; \
    DestDir: {tmp}; Flags: ignoreversion

[Run]
Filename: {tmp}\AccRt.exe /extract:{tmp}\AccRT; 
#include "config.xml"
Filename: {tmp}\setup.exe; Parameters: /config {tmp}\config.xml;
Filename: {tmp}\accsp2.exe
[Code]
procedure InitializeWizard();
begin
  { Let's download two zipfiles from my website.. }
  idpaddfile('https://download.microsoft.com/download/2/6/0/260AA63A-A275-4A92-950D-CE20B490D0B9/AccessRuntime.exe',expandconstant('{tmp}\accRt.exe'));
  idpaddfile('https://download.microsoft.com/download/C/C/2/CC28BC00-1AF0-44B9-8A5D-9D8C8E4899BB/accessrtsp2010-kb2687444-fullfile-x86-en-us.exe',expandconstant('{tmp}\accSp2.exe'));

  { Start the download after the "Ready to install" screen is shown }
  idpdownloadafter(wpReady);
end;

1 个答案:

答案 0 :(得分:0)

首先,您需要提取AccessRuntime.exe(您下载/保存到{tmp}\accRt.exe):

[Run]
Filename: {tmp}\accRt.exe; Parameters: /extract:{tmp}\accRt /quiet

然后,您必须使用配置文件运行解压缩的setup.exe

[Files]
Source: C:\source\path\config.xml; DestDir: {tmp}

[Run]
Filename: {tmp}\accRt\setup.exe; Parameters: "/config ""{tmp}\config.xml"""

对我的代码修改几点评论:

  • ignoreversion标志对.xml文件没有任何影响
  • 如果{tmp}包含空格,最好将配置文件的路径包装为引号。