MSI Inno参数正确传递

时间:2012-10-14 21:09:48

标签: windows-installer

我花时间寻找答案,但仍然无法弄明白。

我有这个MSI文件,我可以运行此命令来静默安装它。

msiexec.exe /i theapp.msi /q INSTALLDIR=C:\myapp CLIENTDATA=34542@localhost.com

使用Inno,我尝试了以下内容,我的MSI将无法安静地安装。我收到的是这个窗口image会自动弹出,所以很明显将问题传递给msiexec进程时会出现问题。

#define MyAppName "fooApp"
#define MyAppVersion "1.0"
#define MyAppPublisher "fooUser"
#define MyAppURL "http://foo.com"
#define MyAppExeName "MyProg.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={{E633BAE8-81C7-4190-9964-D86287FAA8F4}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
CreateAppDir=no
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
ShowTasksTreeLines=True

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

[Files]
Source: "D:\theapp.msi"; DestDir: "    {tmp}";
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Run]
Filename: "msiexec.exe"; Parameters: "/i /q CLIENTDATA=34542@localhost.com    {tmp}\theapp.msi"""; Flags: runascurrentuser shellexec

如果我使用这一行,在[Run]部分下面我可以在交互模式下正确启动MSI,用户将手动填写参数,我不想这样做。

Filename: "msiexec.exe"; Parameters: "/i ""{tmp}\theapp.msi"""

在另一篇文章中,我看到有人提到使用此功能,但我找不到任何关于如何实际使用它的示例代码。

function ParamStr(Index: Integer):

感谢您的任何指示。

2 个答案:

答案 0 :(得分:0)

这是我弄清楚如何做我想做的事情的一种方式。

Filename: "msiexec.exe"; Parameters: "/i {tmp}\theapp.msi /qb CLIENTDATA=34542@localhost.com"; Flags: runascurrentuser shellexec

答案 1 :(得分:0)

在“msiexec.exe”行上使用“/ passive”参数。

实施例: 来源:“D:\ Onedrive \ vbfiles \ InstaladorCrystal \ CRRedist2005_x86.msi”; DestDir:{tmp}; CopyMode:alwaysoverwrite;

文件名:“msiexec.exe”;参数:“/ i”“{tmp} \ CRRedist2005_x86.msi”“ /被动”; WorkingDir:“{tmp}”; StatusMsg:“安装Crystal Reports 32bits ...”;检查:不是IsWin64();标志:skipifsilent

相关问题