This is a short blog post about silently installing a program that uses InstallShield silent switches. The end goal of this package will be to install a program silently or unattended on a target machine. This will allow us to automate the install on new lab machines that we recieve. For this blog we will be installing “Mathematica 8” as our example program.
- Figure out the silent install mechanism.
- Create and test a silent install script.
- Figure out the silent license activation mechanism.
- Add license configuration to install script and test.
Notes & Sites of reference:
- Unattended/Silent Installation Switches For Windows Apps.
- Mathematica 8 silent install instructions.
Install your program manually
First, I will install the Mathematica 8 program manually to familiarize myself with the application and its installer. This will also tell us where the application will install to by default.
- If you are installing on a Virtual Machine, it is a great idea to make a snapshot before you continue.This will enable us to quickly try the silent install multiple times if needed, without having to uninstall the program each time. Sometimes uninstallers don’t remove everything. This can affect the silent install package and make you think it is working when really, the silent install package created is dependent on something that the previous installer left behind. Better to start with a clean image each test.
- I have a disk image of “Mathematica 8” in an “.iso” format. Using Winrar, I extracted this to a folder located at “C:\workingtemp\mathematica8”.
- Double click the “Mathematica_8.0.4_WIN.exe” to begin the manual installation.
- Hit “Next” and this menu will allow you to set the “Destination Location” for your program.
- For the “Select Components” screen, leave everything to default.
- The will pop up the “Start Menu Folder” screen, leave everything to default.
- Hit “Next” then “Install” and this will start its installation. When finished It should look like this.
- For licensing information, it is necessary to get the information from the company. Go to http://register.wolfram.com and enter the license and MathID and you’ll get the contents for the mathpass file back via email.
- To activate “Mathematica 8”, place the license file “mathpass” in the “Licensing” directory of the program. Later we will automate this process. The “Licensing” directory will be located at “C:\Program Files\Wolfram Research\Mathematica\8.0\Configuration\Licensing”.
- Test to see that the program is working correctly.
- Before testing, it would be a great idea to “revert to snapshot” on your VM.
Creating a Batch file
- This file will install Mathematica (silently) then it will copy the licensing information to the appropriate “Licensing” directory.
- Create a Batch file and name it “Install-Mathematica8.cmd” and add it to “C:\workingtemp\mathematica8”.
- Next lets build the batch file, use the following commands in your batch file.
REM Main Install
Mathematica_8.0.4_WIN.exe /silent /suppressmsgboxes /log="C:\Windows\Temp\install.log"
xcopy /y .\mathpass "C:\Program Files\Wolfram Research\Mathematica\8.0\Configuration\Licensing\"
Testing the Batch File
- Open a command prompt as “Administrator” and input the following command.
- Input the following command to run your batch file.
- While the silent install is happening, it will look like this.
- If the license file was properly copied, the command prompt will look like this.
- Check your C:\Program Files\Wolfram Research\Mathematica\8.0″ and make sure the program and its license where properly configured.
- The license file should be in the “Licensing” directory, like so:
You should be done.