Home  /  Resources & support  /  FAQs  /  Automate installation of Stata
Note: This FAQ is intended for users of Stata 9. It is not relevant for more current versions.

How can I automatically install Stata under Windows?

Title   Automate installation of Stata
Author Kevin S. Turner, StataCorp

Starting with Stata 9, the Windows installer was developed using Microsoft’s installer format (MSI). For the average user, whether the installer is built using MSI matters little. MSI provides certain facilities to aid with advanced upgrading or automating installations over many machines. These tasks are particularly useful for system administrators.

The MSI format specifies several command-line arguments for automating an install process, and all of these are available to the Stata installer. You can view these command-line arguments by running the msiexec command, which can be run from any DOS window or from the Run option on the Start menu.

Although explaining every command-line argument is beyond the scope of this FAQ, there are some that are important for automating an install.

/qn Turns off any visual user interface.
[PROPERTY=PropertyValue] Allows you to preset some variables that the installer uses internally.

The properties are typically installation-specific variables, so, before you can set them, you must know what they are. There are three installation properties you need to know to automate the Stata installer. They are

INSTALLDIR Specifies the path where Stata will be installed. Default value is: C:\Program Files\Stata9.
STATAFLAVOR Specifies the flavor of Stata to install. Possible values are: mp, se, intercooled, and small, where se is the default.
EXECUTABLETYPE Indicates either 32-bit or 64-bit executable. Possible values are: 32 and 64, where 32 is the default.

With just the /qn option set and no properties specified, the Stata installer will use the default property values. You can override as many or as few of the properties as you want. From the command line or a scripting language, you could issue the following command to silently install Stata/MP for 64-bit Windows (drive E: is arbitrary and represents the CD drive):

       E:\setup.exe /qn EXECUTABLETYPE=64 STATAFLAVOR=mp

While this installer runs, you might notice some extra processes in the Task Manager or simply notice that the computer is working on something, but, because of the /qn switch, you should see no visual evidence of the installer. When the application is installed, you will find it via the Start menu under All Programs. Logging is available via the MSI specification should you need confirmation of installation.