Msi

From wikinotes
(Redirected from Windows msi)

Native Windows Installer format.

Documentation

official
table reference https://docs.microsoft.com/en-us/windows/win32/msi/database-tables
examples https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-examples
msi docs https://docs.microsoft.com/en-us/windows/desktop/Msi/windows-installer-portal
windows installer SQL https://docs.microsoft.com/en-us/windows/win32/msi/sql-syntax
language ids https://www.symantec.com/connect/blogs/windows-installer-language-ids
windows-installer docs https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-guide
error codes
windows installer https://docs.microsoft.com/en-us/windows/win32/msi/windows-installer-error-messages
CAB (FCICreate) https://docs.microsoft.com/en-us/windows/win32/api/fci/nf-fci-fcicreate
https://docs.microsoft.com/en-us/windows/win32/api/fdi_fci_types/ns-fdi_fci_types-erf
msiexec https://docs.microsoft.com/en-us/windows/win32/msi/error-codes
books
The Definitive Guide to Windows Installer https://www.amazon.com/Definitive-Guide-Windows-Installer-Experts/dp/1590592972
Tools
win10 SDK (see ISO contents for orca.exe installer) https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk

Tutorials

adding files to msi https://www.symantec.com/connect/articles/adding-external-file-existing-msi

Overview

An MSI file is composed of 2x parts:

  • an SQL database (what you want to install -- let windows decide how to install)
  • CAB files (compressed file archives with files to install, scripts to run)


Within the database, the msi Sequences Tables determine:

  • what happens when the MSI is run (what gets installed? are UIs displayed? etc)
  • the order of install (background-jobs, UIs, registry, copied files... everything)


Every install action has an entry in the msi component table (registry modifications, copied files, etc)
Components are grouped into msi Feature table entries.

Beyond that, simply look up the table that corresponds with the action you would like to take.

Tables

MSI files are composed of .cab files and sql tables.
Notes on Table Usage:

Core
Sequences

Schedule Actions for running during install process. (multiple tables).
In UI sequence tables, this also determines the order that dialogs are presented to the user.
(These tables are editable, but generally the defaults are fine)

Properties global variables within msi
Directory install-directories
Feature features that can be chosen/installed (ex: maya, arnold, satellite, ...)
Component master-index representing every item in installer
CustomAction Run Scripts during installation, builtin or embedded. (also set properties).
Items
Environment set environment variables
Registry modifying windows registry
GUI
control buttons, checkboxes, etc.
ControlEvent define what happens when controls are clicked/checked/selected

Tools

General Purpose
python msilib thin wrapper around microsoft's MSI API
orca.exe Create MSI installers using GUI. (installed from Windows SDK iso image -- mount and look for installer)
wix Create MSI installers using XML.
Language Specific
python setuptools create simple installers using python setup.py bdist_msi


Troubleshooting

See msi troubleshooting