Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

We have several web sites that we deploy using an MSI package. One package per website.

This works fine manually:

  • we go into the control panel
  • uninstall the old version
  • then run the MSI, filling out some values, to install the new version

We would like to be able to run a batch file to do this.

  • Can this be automated?
  • How to uninstall the old version?
  • How to fill in the values that are normally added manually
share|improve this question

3 Answers 3

up vote 3 down vote accepted

You can use msiexec however you will likely end up re-writing that MSi with orca (or any other msi editor) WPKG is fairly worthless once you realize that any MSI can be automated if you've set up the MSI to take properties (set the MSi up to take PROPERTY=PropertyValue.) there are also some default properties that can be set (listed here). It's then as simple as running msiexec /qn /uninstall product.msi then msiexec /i product.msi /qn MYPROPERTY=propertyvalue. You can use pstools or powershell to run the commands remotely

share|improve this answer

msiexec.exe is the command-line program to install and uninstall MSI files. For automating it, I suggest WPKG which allows you to automate software installation, including MSIs. To fill in the values, I think you'll need to create a MST file, which can be done with several tools, including InstEd or Orca, then specify it on the command line with TRANSFORMS=package.mst.

share|improve this answer

There are good answers here, but I just want to add some clarifications:

  • Automatic uninstall: By authoring the Upgrade table inside the MSI to implement a "major upgrade" you eliminate the need to manually or separately uninstall the previous version. The install of the new MSI will then silently remove the old MSI prior to installing the new one. Here is a starting point for implementing a major upgrade: http://msdn.microsoft.com/en-us/library/aa372374(v=vs.85).aspx. It is also OK to invoke an uninstall of the old MSI via msiexec.exe, but I find it more elegant that the new MSI removes the old one automagically.
  • Command Line install: The msiexec.exe command line feature is very extensive and generally allows you to specify all required details for each MSI so that the install can happen silently. Only public properties (recognized by UPPERCASE captioning) can be specified at the command line. As stated before there are also "default properties" that can be set: http://support.microsoft.com/kb/230781

There is a tool available that helps you interactively build an msiexec.exe command line. Download the MSI command line builder tool from Wise: http://www2.wise.com/filelib/WICLB.exe

Sample screen from Wise's msiexec.exe command line builder

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.