Bienvenido! - Willkommen! - Welcome!

Bitácora Técnica de Tux&Cía., Santa Cruz de la Sierra, BO
Bitácora Central: Tux&Cía.
Bitácora de Información Avanzada: Tux&Cía.-Información
May the source be with you!

Sunday, September 5, 2010

msiexec.exe

The basic syntax of msiexec is as follows:
msiexec /Option [Optional Parameter]
The usual option is to install (the /i parameter is for installing) a system with a command like this (program_name is the name of the .msi file).
msiexec /i program_name
There is also an uninstall option:
msiexec /x program_name


How to specify install language
setup.exe /L1031 for German install
With InstallShield's multi-language output, you'll point to the appropriate language transform:
msiexec /i Programabc.msi TRANSFORMS=1033.mst
Standard example:
msiexec /qb /i myusbonly_setup.msi ENABLE_ADMIN=1 SERIAL_NUMBER="12345-12345-12345" 
Few ways to uninstall an MSI package.
Uninstalling an MSI file from the command line without using msiexec

  • If you have access to the original MSI used for the installation, you can simply right click it in Windows Explorer and select Uninstall.
  • As stated above you can do the same by command line: msiexec /x filename.msi /q

  • Just got to mention the normal approach though it is obvious
  • Go start -> run -> appwiz.cpl -> ENTER in order to open the add/remove programs applet (or click add/ remove programs in the control panel)
  • Click "Remove" for the product you want to uninstall.

  • You can locate the required code to pass to msiexec.exe /x by opending regedit.exe at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall and search for the application name (or just browse through each sub folder till u find it).
  • When you have found it you can pass it to msiexec as explained above: msiexec.exe /x {0077A7C7-3333-2222-1111-111111111000}

  • MSI strips out all cabs and caches each MSI installed in a super hidden system folder at %SystemRoot%\Installer (you need to show hidden files to see it).
  • All the MSI files here will have a random name assigned, but you can get information about each MSI by showing the Windows Explorer status bar (View -> Status Bar) and then selecting an MSI. The summary stream from the MSI will be visible at the bottom of the Windows Explorer window.
  • Once you find the right MSI, just right click it and go Uninstall.

  • Finally you can uninstall an MSI via the Windows Installer Automation api
    Const msiUILevelNone = 2
    Set objInstaller = CreateObject("WindowsInstaller.Installer") objInstaller.UILevel = msiUILevelNone objInstaller.InstallProduct( "product.msi", "REMOVE=ALL") Set objInstaller = Nothing

No comments: