Unattended Install of EMA OrCAD 16.6

This post will teach you how to create an unattended installation of EMA OrCAD 16.6. OrCAD’s setup program is built on InstallShield.  Normally an InstallShield installation can be automated by recording a manual install to a script file (setup.exe /r /f1 “setup.iss”) and playing it back (setup.exe /s /f1 “setup.iss”), but EMA does things a little bit differently.

Configuring the Installation

If you glance through the Install Guide (which you can download with your OrCAD software) you’ll see that the installation is configured by using a silent installation file called silentinstall-SPB.ini. You can tell setup.exe to use the file by running the command setup.exe !quiet=path_to_silentinstall-SPB.ini. Rather than messing with multiple copies of the file, I just edit the one provided and reference it in my install script. Below is a copy of my own silentinstall-SPB.ini file.

[State] ; Ignore the fact that there is far to much junk on my drive IKNOWBEST=YES ; ; defines the install location ; TargetDir=C:\Cadence\SPB_16.6-silent ; ; Reboots if required at conclusion of installation ; RebootIfReqd=N ; ;File Server Location ; ;FileServerLocationDir=G:\SPB_16.6 ; ; identifies desired maintenance behavior ; possible values are: REMOVEALL, MODIFY, REPAIR ; OnMaintenance=REMOVEALL ; ; If REMOVEALL is selected for maintenance, this flag ; determines if rollback (if applicable) should ; be performed ; ;Rollback=N ;Do you want to backup the files updated in ISR install ;Y indicates yes ;IsrBackup=Y ;Allusers identifies the alluesr vs Cuurent user installation ; A value of NO means current user and YES meas for All Users ALLUSERS=YES ;First time installation MODE ;You can CHOOSE COMPLETE too MODE=COMPLETE ;Crystal reports should be updated ;Y- yes ;N - skipped UPDATE_CRSTAL=Y ;.NET Framework should be updated ;Y- yes ;N - skipped UPDATE_NET_FRAMWRK =Y ;VC Redistribution package should be updated ;Y- yes ;N - skipped UPDATE_VC_REDIST=Y ;Fire wall entries to be done ;Y- yes ;N - skipped UPDATE_FIREWALL=Y ;Should setup overwrite the existing Installation ;Y- yes ;N - no ALWAYS_OVERWRITE=Y ;This option determines whether a disk space check is required ; Possible values are YES and NO. Yes means dont check NO means check IKNOWBEST=YES ;Should Setup Overwrite the HOME Environment variable ;Y - yes ;N - no OVERWRITE_HOME=Y [Features] ; ; Identifies feature list that should be manipulated. ; If the features is not listed here it is NOT ; selected for installation. ; Feature0=ALL OrCAD 166 Products ;Feature1=ALL OrCAD 166 Products\OrCAD_Capture_CIS ;Feature2=ALL OrCAD 166 Products\OrCAD_EE_Designer ;Feature3=ALL OrCAD 166 Products\OrCAD_FPGA_System_Planner ;Feature4=ALL OrCAD 166 Products\OrCAD_PCB_Designer ;Feature5=ALL OrCAD 166 Products\OrCAD_PCB_SI ;Feature6=ALL OrCAD 166 Products\PSpice Feature7=ALL SPB 166 Products ;Feature8=ALL SPB 166 Products\Allegro_AMS_Simulator ;Feature9=ALL SPB 166 Products\Allegro_Design_Authoring ;Feature10=ALL SPB 166 Products\Allegro_Design_Authoring_CIS ;Feature11=ALL SPB 166 Products\Allegro_Design_Authoring_Multi_Style ;Feature12=ALL SPB 166 Products\Allegro_Editor_Router ;Feature13=ALL SPB 166 Products\Allegro_FPGA_System_Planner ;Feature14=ALL SPB 166 Products\Allegro_PCB_Librarian ;Feature15=ALL SPB 166 Products\Allegro_PCB_Router ;Feature16=ALL SPB 166 Products\Allegro_PCB_SI ;Feature17=ALL SPB 166 Products\Allegro_Package_Designer_Cadence_SiP ;Feature18=ALL SPB 166 Products\Allegro_Physical_Viewer Feature19=ALL Documentation [Data] ; ; The data section stores any other properties required by ; the installation. This list varies based on product. ; ; ;The working Directory ; WorkingDir=C:\SPB_Data-Silent ; ; ;For setting FOOTPRINT Path ; ;FootprintPath=D:\Cadence\SPB_16.6-silent\share\pcb\pcb_lib\symbols ; ;SETTING LICENSE FILE ; ;Specifying the port and host information for the license server(s) sets the CDS_LIC_FILE environment variable used by Cadence applications to access the license server(s). ; ;You can get this information from the Cadence license file as follows: ; ; SERVER host1 83065c2 5280 ; ;Where, host name = host1 port = 5280 ; ; ;If you have multiple license servers and you want to access all of them, you can specify the port and host information for each of the license server ;delimited by a semi-colon as follows: port1@host1;port1@host2;port1@host3 For example: 5280@sunny;5280@blue;5280@sky ; ;If your license server has a fault-tolerant server configuration, you can specify the port and host information for each server separated by a ;comma as follows: port@host1,port@host2,port@host3 For example: 5280@sunny,5280@blue,5280@sky ; ; ;You can get the host and port information for a fault-tolerant server from the Cadence license file as follows, ; ; SERVER host1 83065c2 5280 ; ; SERVER host2 83055b2 5280 ; ; SERVER host3 82045c4 5280 ; ;If you uncomment the following line, your CDS_LIC_FILE will be set to 5280@flexserver ;overwrite-lic-path=5280@flexserver ; ;If you uncomment the following line 5280@flexserver1 will be appended to current value of CDS_LIC_FILE variable. ;append-lic-path=5280@flexserver1

 Scripting a Silent Installation

Unfortunately running OrCAD’s setup application doesn’t quite get the job done.  There are a couple of issues I had to work out along the way create a successful, unattended install.

Use the Setup.exe Under the \Disk1 Folder

The main setup.exe opens the interactive menu.  When you script your silent installation, you need to call the setup.exe from within the \Disk1 folder, which is actually responsible for installing the applications.

Copy silentinstall-SPB.ini Somewhere “Simple”

When I passed a complicated path to the silentinstall-SPB.ini file, setup didn’t like it. I’m running the entire installation from a UNC path, and when I passed that network path as !quiet=”\\server\share\EMA OrCAD\Disk1\documents\silentinstall-SPB.ini” the installation would stop without error or warning, or any log that I could locate.  In my silent install script I got around this problem by copying the file to the system Temp folder (referenced by the %TEMP% environment variable), then referencing it from there.

Make Setup.exe Wait Until the Installation Completes Before it Exits

OrCAD’s setup.exe was created with InstallShield.  InstallShield works by using it’s own interface to configure the installation, then spawning a bunch of msiexec processes to actually install the software.  The problem is that setup.exe quits before the MSI installations complete, so unless you account for this behavior your silent install script will exit before the installation is actually completed.  In most situations this isn’t the behavior your going to want.  OrCAD may be one of several applications you want to install in a series.  If your OrCAD install script exist before the installation is completed, your next install will probably fail.  I account for this behavior by running setup.exe from a new command shell (using cmd /c) and specifying the InstallShield switches /w /clone_wait. The /w switch is supposed to make setup.exe wait until installation is completed, but it doesn’t seem to get the job done itself.  The /clone_wait switch tells setup.exe to wait until all of it’s cloned processes (several instances of msiexec) complete.  The combination of the two switches finally made my installation work the way it was supposed to.

Configure Licensing

EMA’s own instructions for unattended installation state that you must manually configure licensing after the installation is completed.  That’s, like, the exact opposite of what unattended means.  Running the License Configuration Utility just creates an environment variable called CDS_LIC_FILE that points to the license server you should already have in place.  We’ll account for this by setting the variable ourselves.

The Final Script

Below is the completed unattended installation script that I’ve created.  It accounts for all of the quirky behaviors discussed above, and returned an error code of “0” so it can be used in a chain of installations through products like Microsoft Deployment Toolkit.

@REM ************************************************************************** @REM ** install.zip ** @REM ** ** @REM ** Silently installs EMA OrCAD 16.6. ** @REM ** ** @REM ** Save this file to the root of your OrCAD installation files (at the ** @REM ** same level as setup.exe, Disk1, Disk2, etc). Modify the variable ** @REM ** below called "ORCAD_LICENSING" to reflect the port and name of your ** @REM ** EMA OrCAD licensing server. Open the file called ** @REM ** silentinstall-SPB.ini under Disk1\documents\ and modify it with the ** @REM ** appropriate settings for your environment as per the EMA's install ** @REM ** guide, or base it off my own file (http://goo.gl/gbng84). The ** @REM ** installer will copy the file to your local temp folder, run the ** @REM ** setup unattended (not silent!), and wait for installation to ** @REM ** Once the install completes the temporary copy of the silent install ** @REM ** file is removed, and licensing is configured via the @ECHO OFF @REM Change this to reflect your licensing environment SET ORCAD_LICENSING=5280@orcad @REM CP holds the directory where you ran install.zip from. SET CP=%~DP0 ECHO Installing OrCAD @REM Copy the silent install file locally so setup doesn't choke on path. COPY "%CP%Disk1\documents\silentinstall-SPB.ini" %TEMP% @REM The following line invokes setup.exe from a new command shell and instructs @REM InstallShield to wait (/w) for all cloned processes to complete (/clone_wait) @REM It also tells InstallShield to use the silent install file. @REM See http://helpnet.installshield.com/installshield18helplib/ihelpsetup_execmdline.htm cmd /c "%CP%\Disk1\Setup.exe" /w /clone_wait !quiet=%TEMP%/silentinstall-SPB.ini @REM Set the machine-level environment variable for the license server. SETX CDS_LIC_FILE "%ORCAD_LICENSING%" /M @REM Clean up, clean up, everybody, everywhere... DEL %TEMP%\silentinstall-SPB.ini EXIT 0