MSI Custom Action Types

This table also shows how you should interpret the Source and Target columns for each type of custom action

Type
Description
Source
Target
1
.dll stored in a binary
Stream
Key to a row in the
Binary table
Name of the .dll
entry point.
2
.exe stored in a binary
Stream
Key to a row in the
Binary table
Command-line string
used to launch the
.exe.
5
JScript in a binary
Stream
Key to a row in the
Binary table
Name of the JScript
function to call.
6
VBScript in a binary
Stream
Key to a row in the
Binary table
Name of the VBScript
function to call
7
Installation of a
package nested inside
of the first package
Name of the substorage
containing
database of nested
application.
Properties settings
string.
17
.dll installed as part
of a product
Key to a row in the File
Table
Name of the .dll
entry point.
18
.exe installed as part
of a product
Key to a row in the File
Table
Command-line string
used to launch the
.exe.
19
Displays a specified
error message and
returns failure,
terminating the
installation
Blank
Formatted text string.
The literal message or
an index into the Error
table.
21
JScript file installed as
part of a product
Key to a row in the File
Table
Name of the JScript
function to call.
22
VBScript file installed
as part of a product
Key to a row in the File
Table
Name of the VBScript
function to call.
23
Installation of a
package that resides in
the first application’s
source tree
Path of nested
package specified
relative to the root of
the source location
Properties settings
String
34
EXE in a known
Directory
Key to a row in the
Directory table
Name of the
executable file and any
options. Use quotes to
surround long file
names.
35
Directory set via
formatted text
Key to the Directory
Table
Formatted text string
that will be set as the
directory path when
this action is executed.
37
JScript text         
Null
A string of JScript code
to execute.
38
VBScript text
Null
A string of VBScript
code to execute.
39
Installation of an
application that is
advertised or already
installed
Product Code for the
application to install
Properties settings
String
50
.exe named by a
Property
Property name or key
to a row in the Property
table
Command-line string
used to launch the
.exe.
51
Property set via
formatted text
Property name or key
to the Property table
Formatted text string
that will be stored in
the property when this
action is executed.
53
JScript text stored in a
Property
Property name or key
to a row in the Property
table
Name of the JScript
function to call.
54
VBScript text stored in
a property
Property name or key
to a row in the Property
table
Name of the VBScript
function to call.

MSI Sequence Column Values of Sequence Tables

Values for the Sequence Column of InstallUISequence, InstallExecuteSequence Tables
  • Positive number  Run the action in this sequence.
  • Zero Don’t run this action.
  • Null Don’t run this action.
  • -1 Run this action when an installation is successfully completed.
  • -2 Run this action when the user cancels during an installation.
  • -3 Run this action in case of a fatal error.
  • -4 Run this action when the installation is suspended.
  • Other negative numbers Don’t run this action.

MSI Custom Action Conditions

These conditons can be used in custom actions, in Tables, and Component installations.
You can execute a custom action or make the component install using conditions as per the requirement.
  1. Action run only during Install
    Condition: NOT Installed AND NOT PATCH
  2. Action only runs during removal of MSI
    Condition: REMOVE
  3. Action runs during Install and repair
    Condition: NOT REMOVE
  4. Action runs during Install and remove
    Condition: There must be no condition
  5. Action calls EXE installed by MSI
    Condition:NOT Installed AND NOT PATCH
  6. Run on initial installation only:
    NOT Installed
  7. Run on initial install or when repair is selected.
    NOT Installed OR MaintenanceMode="Modify"
  8. Run when being uninstalled from command line or add / remove menu.
    REMOVE~="All" OR MaintenanceMode="Remove"
  9. If you want your CA to run only if it is upgrading a previous version UPGRADE_1 (Upgrade property) 

MSI Registry Table

This table holds all the miscellaneous (that is, not directly related to COM or COM+) information that the Installer needs to write to the Registry to install the application. The Registry table is used by the WriteRegistryValues action. This table contains the following columns:



Registry:
This column is an arbitrary key for the table which is used to identify a registry record.

Root:
This column indicates the Registry hive to be written to. It must have one of the values shown in below table.

Constant

Value

Explanation

None (Empty)

-1
i) For a per-user installation, writes to HKEY_CURRENT_USER.
ii) For a per-machine installation, Writes to HKEY_LOCAL_MACHINE.

msidbRegistryRootClassesRoot

0

HKEY_CLASSES_ROOT

msidbRegistryRootCurrentUser

1
HKEY_CURRENT_USER

msidbRegistryRootLocalMachine

2
HKEY_LOCAL_MACHINE

msidbRegistryRootUsers

3
HKEY_USERS


Key:
The Registry key to be written.

Name:
This column contains the name of the Registry value being written. If the column is null, then the value is written to the default for the Registry key. If the Value column is null, then this column should contain one of the special characters
Special Character
Corresponding Action
+
To create the key when the component is
Installed.

-
To delete the key when the component is uninstalled

*
To create the key on installation and delete it on uninstallation


Value:
This is the actual data to write to the Registry value.
Special Character.
Meaning
If the value starts with #x

Stored as a hexadecimal value.

If the value starts with #%

Stored as an expandable string.

If the value starts with #

Stored as an integer.

The special string [~] is stored as a null.

If this string occurs, the value is stored as a list of strings.

If the string starts with [~]
The value is appended to any existing value.

If the string ends with [~]
The value is prepended to any existing value.

If the value starts with ##
Stored as a string starting with a single # sign.


Component:
This is a foreign key to the Component table that identifies the component controlling this Registry operation.

Upgrade Table in MSI

The Upgrade table contains information that’s used when an Installer database is used to make a major upgrade to an existing product. This table contains following columns:



UpgradeCode:
The UpgradeCode property in this column specifies the upgrade code of all products that are to be detected by the FindRelatedProducts action. Unlike the ProductCode, different products may share the same UpgradeCode.

VersionMin:
This column specifies the minimum version to be upgraded. Lower boundary of the range of product versions detected by FindRelatedProducts. A null value means there is no lower bound on the version to be upgraded.

VersionMax:
This column specifies the maximum version to be upgraded. Upper boundary of the range of product versions detected by the FindRelatedProducts action. A null value means there is no upper bound on the version to be upgraded.

Language:
This column contains the set of languages detected by FindRelatedProducts that are to be upgraded and are separated by semicolons. A null value means that any language can be upgraded.

Attributes:
This column can contain any combination of the bit flags as shown in below tables:
Bit flag ( decimal) 
Attribute
1
To enable the MigrateFeatureStates action
2
To detect but not change previous versions
4
To install the new version even if the old version can’t be removed
256
To include VersionMin in the versions upgraded
512
To include VersionMax in the version to be upgraded
1024
To upgrade all languages except those listed in the Language column

Remove:
This column contains a comma-delimited set of names of existing features to be removed.

ActionProperty:
When the FindRelatedProducts action detects a related product installed on the system, it appends the product code to the property specified in this field. The property specified in this column must be a public property and the package author must add the property to the SecureCustomPropertiesproperty. Each row in the Upgrade table must have a unique ActionProperty value. After FindRelatedProducts, the value of this property is a list product codes, separated by semicolons (;), detected on the system. 

How to Package Drive Applications using DPInst.exe

DPInst supports the following command-line switches that set the DPInst configuration flags that are described in Setting DPInst Configuration Flags and additional switches that further modify DPInst operation:

 /a
Sets the installAllOrNone flag to ON, which configures DPInst to install drivers in a driver package only if all of the drivers in the installation package can be installed.
/c
Configures DPInst, if DPInst is called at a command prompt, to display the text of log messages in the Command Prompt window.
/d
Sets the deleteBinaries flag to ON, which configures DPInst to delete the binary files that were copied to a system when a driver package was installed.

Note   Starting with Windows 7, the /d switch is ignored by the operating system. Binary files, which were copied to a system when a driver package was installed, can no longer be deleted by using DPInst.
/el
Sets the enableNotListedLanguages flag to ON, which configures DPInst to enable all of the supported languages that are not explicitly enabled by language XML elements in a DPInst descriptor file.
/f
Sets the forceIfDriverIsNotBetter flag to ON, which configures DPInst to install a driver on a device even if the driver that is currently installed on the device is a better match than the new driver.
/h/?, or /help
Configures DPInst to display help information about DPInst command-line options. If DPInst was called at a command prompt, DPInst displays the help text in the Command Prompt window; otherwise, DPInst displays the help text in a message box.
/l language-ID
Configures DPInst to display the text, bitmaps, and icon for the language that is specified by a language-ID value. The language-ID value can be specified in either hexadecimal or decimal format. For a list of the languages and corresponding language identifiers, see DPInst Localization Support.

If DPInst supports the specified language and runs on a Windows operating system in which the language is installed, DPInst will use the specified language. For more information about how to use the /L switch, see Testing Language Customization.
/lm
Sets the legacyMode flag to ON. In legacy mode, DPInst accepts unsigned driver packages without performing signature verification. However, be aware that Windows driver signing requirements apply to the installation of a driver package from the DIFx driver store. These requirements depend on the Windows version, the signature type, the driver package type, and the driver signing options that are set for a computer.
/q or /s
Sets the quietInstall flag to ON, which suppresses the display of wizard pages, user dialog boxes, and other user messages that DPInst and Windows generate. ThequietInstall flag works with the presence of an end-user license agreement (EULA) page and the suppressEulaPage flag.
/p
Sets the promptIfDriverIsNotBetter flag to ON, which configures DPInst to display a user dialog box if a new driver is not a better match to a device than a driver that is currently installed on the device. The user dialog box informs a user of this situation and provides an option to replace the driver that is currently installed on the device with the new driver.
/path DPInst-working-directory
Sets the DPInst working directory to DPInst-working-directory. DPInst searches for driver packages in the DPInst working directory and in subdirectories under the working directory that are specified by subDirectory XML elements in a DPInst descriptor file. For more information about how to set the DPInst working directory and specifying subdirectories under the working directory, see Specifying the Location of a Driver Package.
/sa
Sets the suppressAddRemovePrograms flag to ON, which configures DPInst to suppress the addition of entries to Programs and Features in Control Panel. These entries represent the driver packages and driver package groups that DPInst installs.

Note  In versions of Windows earlier than Windows Vista, DPInst added the entry for the driver package or driver package group to Add or Remove Programs in Control Panel.
/se
Sets the suppressEulaPage flag to ON, which configures DPinst to suppress the display of a EULA page. The suppressEulaPage flag works with the quietInstall flag and the suppressWizard flag.
/sh
Sets the scanHardware flag to ON, which configures DPInst to install a driver package for a Plug and Play (PnP) function driver only if the driver package matches a device that is currently configured in a computer and if the driver package is a better match for the device than the driver package that is currently installed on the device.
/sw
Sets the suppressWizard flag to ON, which suppresses the display of wizard pages and other user messages that DPInst generates. The suppressWizard flag works with the presence of a EULA page and the suppressEulaPage flag.
/u inf-file-path
Configures DPInst to uninstall a driver package whose INF file is specified by inf-file-path. The path that is specified by inf-file-path is relative to the directory that containsDPInst.exe.

Examples

The following command includes the /q and /se command-line switches, which configure DPInst to operate in quiet-install mode, whether a eula XML element is included in a DPInst descriptor file. This command suppresses all of the wizard pages, user dialog boxes, and other user messages that DPInst and Windows generate.

dpinst.exe /q /se
The following command includes the /q command-line switch, which configure DPInst to operate in quiet-install mode. However, DPInst will operate in quiet-install mode only if aeula XML element is not included in a DPInst descriptor file. If a eula element is included, DPInst does not operate in quiet-install mode.


dpinst.exe /q
The following command includes a /se command-line switch, which suppresses the display of only the EULA page.

dpinst.exe /se
The following command includes the /q and /se command-line switches, which configure DPInst to operate in quiet-install mode, including suppressing the EULA page. The command also includes the /f command-line switch, which forces the installation of a new driver package for a device that is configured in a computer, even if the driver package that is currently installed on the device is a better match for the device than the new driver package.

dpinst.exe /q /se /f
The following command includes the /sh command-line switch, which configures DPInst to install a driver package on a device that is configured in a computer only if the new driver package is a better match for the device than the driver package that is currently installed on the device. This command facilitates using an installation package to batchinstall driver packages for devices that are configured in a computer. Although the installation package might contain a large number of driver packages, DPInst will install only driver packages that are better matches for the devices than the driver packages that are currently installed on the devices.


dpinst.exe /sh

The following command includes the /u command-line switch, followed by the Abc.inf INF file, and the /d command-line switch. The /u command-line switch uninstalls the driver package that is associated with the Abc.inf INF file from all of the devices on which the package is installed. The /d command-line switch deletes the binaries that were copied to the system when the package was installed and deletes the package from the DIFx driver store. If the driver package is signed, the corresponding catalog file must be present in the same directory in which Abc.inf is located.

dpinst.exe /u abc.inf /d

5 SCCM Tools

Client Center  Config uration  Manager Here is one of my favorite SCCM tool and probably the most useful I have ever seen!  Client Cent...