• MSI Installation Command lines, Switches

    Posted on March 20, 2012 by in Application Packaging

    MSI Installation Command Lines

    • Msiexec is the process the interprets the MSI package and runs on the OS.
    • Depending on the OS the MSIEXEC/Windows installer versions changes. You can see the version by typing msiexec in the run command.
    • In Vista SP2 Operating Systems the Windows installer version is 4.5

    • In Windows 7 the windows installer version is  5.0

    • In Windows 8 Consumer Preview the windows installer version is 5.0

    1. Installing an msi from command line
      MSIEXEC /I “PATH TO MSI”
    2. Installing an msi from command line silently
      MSIEXEC /I “PATH TO MSI” /QB  Displays progress bar and cancel button

      MSIEXEC /I “PATH TO MSI” /QB+ pops up a status windows after the installation

      MSIEXEC /I “PATH TO MSI” /QB! Displays progress bar without cancel button

      MSIEXEC /I “PATH TO MSI” /QN  Displays nothing

      MSIEXEC /I “PATH TO MSI” /QN+ pops up a status window after the installation

    3. Installing an msi from command line silently and creating a log file.
      MSIEXEC /I “PATH TO MSI” /QB /L*v “c:\logs\example.log”
    4. Installing an msi and applying a transform from command line silently and creating a log file.
      MSIEXEC /I “PATH TO MSI” TRANSFORM=EX1.MST /QB /L*v “c:\logs\example.log”

      Incase multiple transforms have to be applied then use semicolon to separate the transforms

      MSIEXEC /I “PATH TO MSI” TRANSFORM=EX1.MST;EX2.MST /QB /L*v “c:\logs\example.log”

    5. Installing an msi from command line silently, applying Public Properties, creating a log file 
      MSIEXEC /I “PATH TO MSI” ALLUSERS=1 REBOOT=REALLYSUPPRESS /QB /L*v “c:\logs\example.log”
    6. Administrative Installation of an MSI 
      MSIEXEC /A “PATH TO MSI”  (when prompted where to install specify the location to perform the administrative install)

      Administrative installation installs the package on the network.
      This is widely used in enterprise deployments.
      During admin installs the MSI is uncompressed.
       All the files are visible and if any of the file needs to be replaced we can do so without repackaging the MSI.

    7. Uninstalling an MSI Silently by creating log file
      MSIEXEC /X “PATH TO MSI” /QB /L*v “c:\logs\remove.log”
      MSIEXEC /X {productcode of MSI} /QB /L*v “c:\logs\remove.log”
    8. Advertising an application 
      MSIEXEC /J “PATH TO MSI”

      Advertising an application to the current user
      MSIEXEC /Ju “PATH TO MSI”

      Advertising an application to all users of the machine
      MSIEXEC /Jm “PATH TO MSI”

      Advertising an application to all users and applying a transform
      MSIEXEC /Jm “PATH TO MSI” /t example.mst

    9. Installing a patch on a workstation silently and creating a log file 
      MSIEXEC /P “PATH TO MSP” /QB /L*V “C:\logs\patch.log”

      Applying  Multiple patches to an installed administrative image
      MSIEXEC /P EX1.MSP;EX2.MSP /A “PATH TO ADMIN INSTALL MSI”

    10. Repairing an installed application 
      MSIEXEC /f “PATH TO MSI”
      MSIEXEC /f {product code of msi}

      In regular cases we use the following switches to repair
      MSIEXEC /faumv {product code of msi}

      f –  Repairs the product

      a –  Forces all files to be reinstalled

      u – Rewrites all user specific registry entries

      m – Rewrites all machine specific registry entries

      v –  Runs from source and re-caches the local package.

    11. Installing an msi from command line silently and Generate SMS status .mif file 
      MSIEXEC /I “PATH TO MSI” /QB /m filename
    12. Other 
      MSIEXEC /y c:\example\xyz.dll  Self registers the xyz.dll
      MSIEXEC /z c:\example\xyz.dll  
      Unregisters the xyz.dll
    13. For additional Command line options refer to the below link
      http://msdn.microsoft.com/en-us/library/windows/desktop/aa367988(v=vs.85).aspx

     

     

    Be Sociable, Share!

    Written by

    Senior Packaging Engineer with 5 years of experience in application pakcaging, scripting and deployment. As a packaging engineer worked on various technolgies right from wise package studio, Admintstudio, Microsoft App-V and VMware Thinapp. Covered Finance, Pharmaceuticals and other domains.

    View all articles by

    Email : [email protected]

    Leave a Reply