MSI Silent Mode Installations for InstallScript MSI Projects

 

MSI Silent Mode Installations for InstallScript MSI Projects

InstallShield DevStudio

If you need to silently install an InstallScript MSI project without using Setup.exe, you can use the MSI silent mode.

Launching MSI Silent Installations for InstallScript MSI Setups

The MSI silent installation is launched in the following cases:

  • The installation is launched at the command line by typing msiexec product.msi /qn.
  • The installation is activated from an advertised shortcut.
  • The installation is activated from install-on-demand.
  • When the product is removed when an update package is running.

Unlike the traditional silent mode, the MSI silent mode does not follow the regular logic provided through script. It simply runs through the InstallExecuteSequence table. (To see this table, navigate to the Direct Editor.) As a result, some events are not fired, including the following:

  • All UI installation events—OnFirstUIBefore and OnFirstUIAfter
  • All Feature events
The OnMsiSilentInstall Event
What the Event Does

In an InstallScript MSI project installation, InstallShield DevStudio runs the OnMsiSilentInstall event handler if the product is not already installed on the target system. This happens if the installation is launched by msiexec product.msi /qn or if the installation is activated from an advertised shortcut.

You need to override the OnMsiSilentInstall event if you want to support the MSI silent installation mode. This allows you to perform tasks that are normally performed in the OnFirstUIBefore, OnFirstUIAfter, and feature event handlers.

Overriding the Event

By default, OnMsiSilentInstall displays a message and then aborts the installation. You can override this event handler by writing your own implementation of the function. The prototype of this function is as follows:

external prototype OnMsiSilentInstall(HWND hInstall);

where hInstall is the handle to the installation.

The simplest thing you can do is to implement an empty body of this event so installation will not abort, as:

function OnMsiSilentInstall(hInstall)
begin
	//Do nothing and allow installation to continue.
end;

Again, OnMsiSilentInstall will be fired on MSI silent installation and on activation of an advertised shortcut. It will not be fired on Install-On-Demand, auto-repair, and uninstall mode.

Using MsiExec.exe Directly

If you want to use MsiExec.exe directly, you need to first use MsiExec.exe to install ISScript.msi (unless you are certain that the latest script engine files are available on the target system). You can do this by typing MsiExec.exe /qn /i ISScript.msi at the command line.

Detecting the Mode in which a Silent Install is Running

To detect whether a traditional silent install is running from InstallShield script, use

if (MODE = SILENTMODE)

To detect whether an MSI silent mode installation (including /q, advertise, auto-repair, uninstall, or install-on-demand) is running from InstallShield script, check the MSI property "ISSETUP_UISEQUENCE_PROCESSED" using the MsiGetProperty Windows Installer API function. If this property is not set, then it is a silent install. (It indicates that the InstallUISequence is not executed.)

See Also

Silent Installations

MSI Silent Mode Installations for InstallScript MSI Projects

转载于:https://www.cnblogs.com/joeyliang/archive/2008/01/21/1047217.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值