2012-10-14 52 views
1

我花时间寻找答案,但仍不能完全弄清楚这一点。MSI Inno参数正确传递

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

msiexec.exe /i theapp.msi /q INSTALLDIR=C:\myapp [email protected] 

随着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 [email protected] {tmp}\theapp.msi"""; Flags: runascurrentuser shellexec 

下的[运行]部分如果我用这条线我的MSI在交互模式,用户将在参数手工填写,我不希望在做正确启动。

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

在另一个帖子,我看到有人提到要使用此功能,但我无法找到如何真正使用它的任何示例代码。

function ParamStr(Index: Integer): 

感谢您的任何指示。

+0

由于张贴这一个解决方案,我想通了,就是用这个命令 文件名:“msiexec.exe的”;参数:“/ i {tmp} \ theapp.msi/qb [email protected]”;标志:runascurrentuser shellexec 我很好奇还有什么其他方式来做到这一点。 –

+0

将您的评论转换为答案,因为您找到了答案。顺便说一下,使用Inno Setup安装MSI有什么意义? –

+0

MSI是由第三方提供给我的,我给出的要求是我必须使用INNO来传入参数,并在安装MSI之后,INNO设置完成之前自动执行这些操作。 个人而言,我想直接使用Qwerty.MSI硬编码MSI中的所有内容,但这是不允许的。 –

回答

0

以下是我想出如何做我想做的事情的一种方法。

Filename: "msiexec.exe"; Parameters: "/i {tmp}\theapp.msi /qb [email protected]"; Flags: runascurrentuser shellexec 
0

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

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

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