惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
罗磊的独立博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
云风的 BLOG
云风的 BLOG
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
A
About on SuperTechFans
WordPress大学
WordPress大学
B
Blog
Martin Fowler
Martin Fowler
Jina AI
Jina AI
I
InfoQ
P
Proofpoint News Feed
小众软件
小众软件
S
SegmentFault 最新的问题
V
V2EX
B
Blog RSS Feed
量子位
大猫的无限游戏
大猫的无限游戏
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
MongoDB | Blog
MongoDB | Blog
美团技术团队

博客园 - Joey Liang

[译稿]微软过去30年做对了5件事_Microsoft 微软_cnBeta.COM Galin Iliev [Galcho] Blog! - Rule "Previous releases of Microsoft Visual Studio 2008" failed - Joey Liang The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) - Powered By Kayako SupportSuite - Joey Liang 随笔 文章 新闻 日记 有啥区别~ - 博问 - 博客园社区 Save (Not Permitted) Dialog Box yongwnet - 博客园 笔记:编程的一些建议 - 时间伙伴 - 博客园 编译原理学习导论 - ★★★TINYUE的专栏★★★ - CSDNBlog 编译原理学习指导 - ★★★TINYUE的专栏★★★ - CSDNBlog System.Data.SqlServerCE load problem - MSDN Forums Connect WM5 emulator to the network A nice gift from SQL Server 2005 SP2 to sync developers(转自http://blogs.msdn.com/synchronizer/default.aspx) - 江南白衣 - 博客园 微软一年从中国挣走8亿美金 - 老杳 - 网易博客 UIP Forums (Logged in as: v-yilian) 一份比较详细的DOS命令说明! (上)_小不 FIX: Error message when you try to install a large Windows Installer package or a large Windows Installer patch package in Windows Server 2003 or in Windows XP: "Error 1718. File was rejected by digital signature policy" HTC Home with 5/6 tabs on ELF [Archive] - xda-developers How to sync all tasks information from desktop to device in Windows Mobile 5 Test Embedded : CE 6.0 - why the codename "Yamazaki" ?
MSI Silent Mode Installations for InstallScript MSI Projects
Joey Liang · 2008-01-21 · via 博客园 - Joey Liang

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