Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have about 20 applications that need to be run in a specific order. I want to script them so that I can do this remotely.

Each one of the applications has a Setup.exe and an MSI.

I was hoping just to have a simple script that called the MSIs with an answer file, but it has been years since I have done it. However, I do not remember how to create an answer file.

Is this a good way to do it? Or would there be a simpler way?

share|improve this question

3 Answers 3

Talk about a loaded question...

For starters, ignore the setup.exe. Odds are it just calls the MSI. Or sometimes they extract a bunch of stuff THEN call the MSI, you can usually watch your temp directory when you run setup and get an idea of what its doing.

I always cheated and did a dry run of the install (msiexec /i path/to-install.msi /l*v /qn) with logging cranked up, then went through the log and picked out the properties I wanted to set and set them via the command line. Answer files never worked, or weren't worth the trouble of going through the process to make them.

Then I found InstEdit and used it a boatload. It will let you edit properties of an MSI and generate a Transform you can then pass in as an argument in your script: msiexec /i path/to/installer.msi /t path/to/transform.mst I recommend giving it a shot first, there's a free version that does just about everything.

You might also take a look here for all the switches msiexec has.

share|improve this answer
    
+1 but unfortunately the switches don't seem to work with all MSIs. Haven't looked into why but it's definitely the case with some. –  Ciaran Feb 16 '11 at 22:11
    
Depends on how the MSI was created. There are some properties you can set to ignore certain parameters, IIRC. Typically using Instedit and building a Transform always worked, the only errors i encountered were usually human. –  peelman Feb 17 '11 at 4:04
1  
+1 for InstEdit –  user66001 Jul 31 '13 at 4:22
1  
The log method worked for me. It's important to note though that the properties will be listed as Property(S) : PROPERTY_NAME... –  druciferre Mar 15 at 20:39

Msiexec is the tool you need. It has a -q parameter to let it install stuff "quiet":

/qn : Displays no user interface.

/qb : Displays a basic user interface.

/qr : Displays a reduced user interface with a modal dialog box displayed at the end of the installation.

/qf : Displays the full user interface with a modal dialog box displayed at the end.

/qn+ : Displays no user interface, except for a modal dialog box displayed at the end.

/qb+ : Displays a basic user interface with a modal dialog box displayed at the end.

/qb- : Displays a basic user interface with no modal dialog boxes.

You can also provide named options (or "properties") at the end of the command line; which properties are supported depends on the package. For example, this command:

msiexec /qb /l* perl-log.txt /i ActivePerl.msi PERL_PATH=Yes PERL_EXT=Yes

...is how you install ActiveState Perl, instructing the MSI package to add Perl.exe to your PATH and to associate .pl files with it. (source)

share|improve this answer
    
Note that a developer can choose to disable the /q option in their msi installer. –  Joel Coehoorn Feb 22 '11 at 7:13

Most applications can be installed silently and therefor scripted. Each Setup.exe can have a number of potential switches, so calling the vendor or searching their web site is a must. Sometimes you can get the info by starting setup with a /?, /h /help switch. MSI files can also have any number of switches but this article MSI command line parameters provides a list.

When scripting the process you may run into an app that installs with setup.exe and then launches another file like an MSI. One example was MS Office XP. When this occurs your script may think that the file you launched is complete and start the next setup which fails causing everything to go south. To get around this try bypassing the setup file and go straight to the actual installer (potentially an MSI) with command line options. If that is not possible you may need to create some sort of timer pause. I used to use a little utility called wait.exe that I found on the internet but there are a million ways to do this. The key to the scripting though is to be able to identify that an application installed correctly so that the next installation can begin.

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.