Share via


Authoring to Windows Installer 4.0 Features mentioned at PDC 2005

As Tyler recently mentioned, you can find the Professional Developers Conference 2005 session and presentation of the Windows Installer 4.0. Here's a preliminary view of how to author to these features. Note: This documentation is preliminary and is subject to change.

Restart Manager Support

As Tyler presented in the slide titled "Windows Installer 4.0: Fewer Reboots", Restart Manager support in MSI just requires MsiRMFilesInUse be present in the package when installing on Windows Vista. This dialog looks a lot like the FilesInUse dialog with a couple of radio buttons added under the list box to represent the new Restart Manager Option along with the fallback option to the old behavior.

Control Table

Dialog_ Control Type X Y Width Height Attributes Property Text Control_Next Help
MsiRMFilesInUse DlgLine Line 0 234 294 0 1
MsiRMFilesInUse Banner Bitmap 0 0 374 44 1 NewBinary1
MsiRMFilesInUse DlgDesc Text 21 23 292 25 65539 Some files that need to be updated are currently in use.
MsiRMFilesInUse DlgTitle Text 13 6 292 25 65539 {&MSSansBold8}Files in Use
MsiRMFilesInUse DlgText Text 21 49 348 17 3 The following applications are using files that need to be updated by this setup.
MsiRMFilesInUse BannerLine Line 0 44 374 0 1
MsiRMFilesInUse RadioButtonGroup1 RadioButtonGroup 19 187 343 40 16777219 ShutdownOption List
MsiRMFilesInUse List ListBox 21 66 331 118 7 FileInUseProcess OK
MsiRMFilesInUse OK PushButton 228 244 66 17 3 OK Cancel
MsiRMFilesInUse Cancel PushButton 299 244 66 17 3 Cancel RadioButtonGroup1

ControlEvent Table

Dialog_ Control_ Event Argument Condition Ordering
MsiRMFilesInUse OK EndDialog Return 1 1
MsiRMFilesInUse OK RMShutdownAndRestart 0 ShutdownOption="ShutdownOption1" 2
MsiRMFilesInUse Cancel EndDialog Exit 1 1

Dialog Table

Dialog HCentering VCentering Width Height Attributes Title Control_First Control_Default Control_Cancel
MsiRMFilesInUse 50 50 374 266 19 [ProductName] OK OK Cancel

Property Table

Property Value
ShutdownOption ShutdownOption1

RadioButton Table

Property Order Value x Y Width Height Text Help
ShutdownOption 1 1 6 9 331 14 Automatically close all applications and attempt to restart them after setup is complete.
ShutdownOption 2 2 6 21 322 17 Do not close applications. (A reboot will be required.)

Elevation Privleges Not Required

As Tyler presented in the slide titled "What's new in MSI: UAP Elevation and Installs and Patches", you can set the msidbSumInfoSourceTypeLUAPackage bit in the Summary Information Stream of a MSI and prevent the Windows Installer from invoking the UAP elevation prompt. To do this, one just needs to set the 4th position (0x08) in the Word Count property. You can do this with the Windows Installer SDK tool msiinfo.exe. As an example, here's the command and output before setting the bit

 

c:\>msiinfo product.msi

ClassId = {000C1084-0000-0000-C000-000000000046}
[ 1][/c] Codepage = 1252
[ 2][/t] Title = Installation Database
[ 3][/j] Subject = Testing
[ 4][/a] Author = Microsoft Corp.
[ 5][/k] Keywords = Installer,MSI,Database
[ 6][/o] Comments = Contact:  Your local administrator
[ 7][/p] Template(MSI CPU,LangIDs) = Intel;1033
[ 9][/v] Revision = {62B8B42B-9D2E-49C2-A791-C90F212940B8}
[12][/r] Created = 2005/10/25 23:00:48
[13][/q] LastSaved = 2005/10/25 23:00:48
[14][/g] Pages(MSI Version Used) = 200
[15][/w] Words(MSI Source Type) = 0
<snip>

Then one runs msiinfo with the /W switch to set the Word Count property like so

 
c:\msiinfo product.msi /W 8

Then rerun the view to confirm the setting took like so

 

c:\>msiinfo product.msi

ClassId = {000C1084-0000-0000-C000-000000000046}
[ 1][/c] Codepage = 1252
[ 2][/t] Title = Installation Database
[ 3][/j] Subject = Testing
[ 4][/a] Author = Microsoft Corp.
[ 5][/k] Keywords = Installer,MSI,Database
[ 6][/o] Comments = Contact:  Your local administrator
[ 7][/p] Template(MSI CPU,LangIDs) = Intel;1033
[ 9][/v] Revision = {62B8B42B-9D2E-49C2-A791-C90F212940B8}
[12][/r] Created = 2005/10/25 23:00:48
[13][/q] LastSaved = 2005/10/25 23:00:48
[14][/g] Pages(MSI Version Used) = 200
[15][/w] Words(MSI Source Type) = 8
<snip>

Windows Vista Multilingual User Interface (MUI) Shortcut Support

As Tyler presented in the slide titled "What's new in MSI: More...", you can now add Windows Vista Multilingual User Interface (MUI) Shortcut support to your MSI. The way you do this is to add for new columns to the Shortcut Table of your MSI. These are rows DisplayResourceDLL, DisplayResourceId, DescriptionResourceDLL, DescriptionResourceId placed as follows:

Column Type Key Nullable
Shortcut Identifier Y N
Directory_ Identifier N
Name Filename N
Component_ Identifier N
Target Shortcut N
Arguments Formatted Y
Description Text Y
Hotkey Integer Y
Icon_ Identifier Y
IconIndex Integer Y
ShowCmd Integer Y
WkDir Identifier Y
DisplayResourceDLL Formatted Y
DisplayResourceId Integer Y
DescriptionResourceDLL Formatted Y
DescriptionResourceId Integer Y

Both the DisplayResourceDLL and DescriptionResourceDLL values represent fully qualified paths to files on disk that the MUI system will load (per the Windows Vista protocol) to get the localized strings. Both the DisplayResourceDId and DescriptionResourceId represent the resource index of the string of interest. This integer is non-negative and will be negated before the call to the Shell API to reguster the MUI shortcuts.

[Author: Robert Flaming]

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at https://www.microsoft.com/info/cpyright.htm.

Comments