This is a short blog post about silently installing a program that uses Windows Installer or .msi files. The end goal of this post 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 “ChemBioOffice” 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:
First, I will install the ChemBioOffice program manually to 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.
- Double click the “cbdu1202.exe” and the setup will start. The first menu will ask you to “have your serial number ready”, hit “OK” to continue.
- Immediatily after hitting “OK”, setup will start extracting files.
- The setup wizard will appear, followed by the “CambridgeSoft Software Activation” screen. Fill this out and click “Activate over internet”.
- The message box “Software Activation Complete” will appear, click “OK” to continue.
- Next, the ChemBioOffice install wizard should appear. Click “Next”.
- Accept the license agreement and click “Next”.
- On the “Setup Type” screen, leave the defaults and click “Next”.
- On the “Select Features – CambridgeSoft” screen, uncheck the box next to “E-Notebook 12.0”, then click “Next”.
- On the “Select Features -Third Party” screen, uncheck the “MNova NMR Lite” option and click “Next”.
- On the “Ready to Install” screen, click “Install”.
- The installation will begin and should look similar to the following image.
- When finished the “Installation Complete” screen will appear, click “Finish”.
- Check which directory the “ChemBioOffice” program installed to.
- Open your “ChemBioDraw” application to see if it works. It should look similar to the screen below.
Get Licensing Information
- To silently register ChemBioOffice licensing information, CambridgeSoft requires that you email support fora custom registry file. At the end of the silent installation of ChemBioOffice you will import the registry file. Email Cambridge support at “firstname.lastname@example.org” for your activation file.
- Save this file to your “C:\workingtemp\ChemBioOffice” folder and name it “importChemLicense.reg”
Preparing your Source Directory
- Make a new folder called “ChemBioMedia” at “C:\workingtemp\ChemBioMedia”.
- Extract the “cbdu1202.exe” file, using 7zip to C:\workingtemp\ChemBioMedia.
- The ChemBioMedia folder should look like this after you extract the setup file.
- The file tree for this folder will look like this, the objects bolded and in Italics are the files that we need.
- \DatatManagement Server Setup
- Now to make life easy copy the following code into a batch file and run it. This will put all the neccessary installer files into “C:\workingtemp\ChemBioOffice”.
REM Copy FIles
xcopy /y "C:\workingtemp\ChemBioMedia\Cambridgesoft\ChemOffice\CambridgeSoft_ChemBioDraw_Ultra_12.0.msi" "C:\workingtemp\ChemBioOffice\"
xcopy /y "C:\workingtemp\ChemBioMedia\Cambridgesoft\ChemOffice\CambridgeSoft_ChemDraw_ActiveX_Enterprise_Constant_12.0.msi" "C:\workingtemp\ChemBioOffice\"
xcopy /y "C:\workingtemp\ChemBioMedia\Cambridgesoft\SharedAddIn\SharedAddIn.msi" "C:\workingtemp\ChemBioOffice\"
- Note: For my installation I needed to install only 3 parts of the ChemBioOffice. These 3 parts are; ChemBioDraw Ultra 12.0, ChemDraw ActiveX Enterprise and SharedAddIn. These and the registry file should be the only 4 things in your “C:\workingtemp\ChemBioOffice” folder.
- Your folder will look like this.
Creating a Batch File
- Navigate to your “C:\workingtemp\ChemBioOffice” folder.
- Create a new text document in this folder and name it “Install_ChemBioOffice.cmd”. The ending “.cmd” will make this a batch file.
- Copy and paste the following commands into your batch file.
REM Installing ChemBioOffice
REM Main Install
start /wait msiexec /i CambridgeSoft_ChemBioDraw_Ultra_12.0.msi /qb
start /wait msiexec /i CambridgeSoft_ChemDraw_ActiveX_Enterprise_Constant_12.0.msi /qb
start /wait msiexec /i SharedAddIn.msi /qb
REGEDIT /s importChemLicense.reg
At this point your batch file should be ready to test.
Testing the batch file
- Navigate to “C:\workingtemp\ChemBioOffice”.
- Open a command prompt as “Administrator” and type the following command to change directories.
- Now that we are in the correct directory type in the batch file name we are using.
- Hit Enter and the installation will begin, it will look similar to the following image.
- Next, the application should start just as it did after the manual installation we did earlier.
If there are any problems\concerns\questions with this post, please leave a comment!