1

I spent time searching for an answer but still can't quite figure this out.

I have this MSI file that I can run this command to silent install it.

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

With Inno, I attempted the following and my MSI will not silently install. What I do receive is this window image will pop up automatically so obvious there is a probleming passing the commands to the msiexec process.

#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

Underneath the [Run] section if I use this line I the MSI is launched correctly in interactive mode where the user will fill in the parameters manually which I don't want the m doing.

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

In another post, I saw someone mention to use this function but I couldn't find any sample code on how to actually use it.

function ParamStr(Index: Integer):

Thanks for any direction here.

4

2 回答 2

0

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

Filename: "msiexec.exe"; Parameters: "/i {tmp}\theapp.msi /qb CLIENTDATA=34542@localhost.com"; Flags: runascurrentuser shellexec
于 2012-10-16T01:37:33.677 回答
0

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

示例:来源:“D:\Onedrive\vbfiles\InstaladorCrystal\CRRedist2005_x86.msi”;目标目录:{tmp};复制模式:总是覆盖;

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

于 2017-02-15T16:00:05.350 回答