230 likes | 561 Views
Scripting Automated Solutions for Siemens PLM Software. By: Daniel Cortez Jet Propulsion Laboratory, California Institute of Technology. Intro. AUTOMATION – noun
E N D
Scripting Automated Solutions for Siemens PLM Software By: Daniel Cortez Jet Propulsion Laboratory,California Institute of Technology
Intro • AUTOMATION – noun • The technique, method, or system of operating or controlling a process by highly automatic means, as by electronic devices, reducing human intervention to a minimum.
JPL Product Management • The Mechanical CAE Group at JPL manages configuration for 180+ workstations with various SIEMENS products (NX, Teamcenter Engineering, Nastran, Ideas, etc…) • MCAE has automated the installation of all SIEMENS products via web links and small installation programs. • Cost Saving with the automated installation was 90% reduction in installation times, per single installation.
Automating Installations, Why? • Allow user to download and run installation On Demand • Scripted installation identifies all necessary parameters. • Install only licensed modules • Standardize workstation installations
JPL Typical Design Installation Package: CAD/CAM Design Engineers • installation package for Design Engineering: • NX Base • NX Translators (pre NX5) • NX Maintenance Release Update • NX Maintenance Pack Update • JPL Custom Configuration Files • Teamcenter Engineering Base • Teamcenter Engineering Portal Client • Teamcenter Engineering Portalviewer (JT, CGM,..) • Teamcenter Engineering Base Update • Teamcenter Engineering Portal Client Update • Teamcenter Engineering Portalviewer Update • JPL Custom Configuration Files
Knowledge Required This session will require user to be experienced and knowledgeable in the following. Command Shell / Windows Batch Scripting (.BAT, .CMD) Windows Registry Editing Application Installation NX Teamcenter Engineering Client Nastran FEMAP, etc… 6
Scripting Languages • Batch Scripting • Windows Batch file scripting - useful for running a sequence of executables automatically • Scripting Concepts and Technologies • VBScripting - easy-to-use scripting language that enables you to create powerful tools for managing computers. • WSH - is a powerful multi-language scripting environment ideal for automating system administration tasks • WMI - primary management technology for Microsoft Windows OS. It enables consistent and uniform management, control, and monitoring of systems throughout your enterprise.
Identifying Install executables Most product installation come packaged in either ‘.MSI’ or ‘.EXE’ format. Each format has methods which can be used to perform silent or unattended installations. MSI The Windows Installer (aka Microsoft Installer) is an engine for the installation, maintenance, and removal of software on Windows systems. The installation information, and often the files themselves, are packaged in installation packages The package files have a .msi extension, and you manipulate them using the msiexec utility. EXE The InstallShield setup.exe allows for a response file (.iss) to be used for unattended installations (silent installation) Note: not all installation will are capable of using scripted file. 8
Example: NX • NX can be deployed in one of two methods • Setup.exe • UGS NX 4.0.msi • SETUP.EXE • This is Manual installation. The installation will run with full windows dialog interaction, requires input for all fields. • UGS NX 4.0.msi • Allows for manual or scripted installation. If parameters are not provided it defaults to manual mode installation.
Automated Installation Options • Reference: “NX Installation Guide” • The unattended installation is controlled by the Windows system component, msiexec.exe. In order to install silently you must pass switches and NX specific configurable properties to msiexec.exe on the command line. The msiexec.exe program has several command line switches. For full documentation on these switches, see the Microsoft help documentation “Help and Support” for msiexec
MSIEXEC Line Switches • /I - specifies the input .msi file to be used • msiexec.exe /i “UGS NX 4.0.msi” • /q - specifies the UI level. • /qn+ specifies no dialogs except for the ending “install done” dialog {recommended}. • /qn specifies a silent installation with no dialogs. • no indication when the install completes • /L – specifies a log file to be created • msiexec /L*v “logfile” • /x - specifies the msi file use for uninstallation. • msiexec.exe /x “UGS NX 4.0.msi”
NX MSI Installation Parameters • The configurable properties for the NX install are: • ADDLOCAL – This property selects the features to be installed. • ”ALL” same as a typical installation. • SETUPTYPE - matches the addlocal parameter • SETUPTYPE=typical. • LICENSESERVER • This property sets the value of the NX license server. • Set the environment variable UGII_LICENSE_FILE • LANGUAGE • User interface language for NX. • INSTALLDIR • This property sets the directory where NX will be installed.
MSI Example Installation: NX 4 • Product: NX 4 Note: The msiexec.exe examples below may appear on multiple lines because of document formatting but they must be entered on your computer as one line. msiexec /qn+ /i "NX 4.msi" ADDLOCAL="all” INSTALLDIR=“C:\UGS\NX30“ LICENSESERVER=27000@hostname msiexec /qn+ /i "NX 4.msi" ADDLOCAL="all” INSTALLDIR=“C:\UGS\NX30“ LICENSESERVER=27000@hostname
Example: FEMAP • FEMAP can be deployed in one of two methods • Setup.exe • Setup.exe (with response file) • Reponse file: filename.iss • SETUP.EXE • This is Manual installation. The installation will run with full windows dialog interaction, requires input for all fields. • A response file can be used to pass all the parameters. Admin install must be performed first to create the response.
Generate the ISS Response File • InstallScript Installations (EXE) • For an InstallScript-based installer, The user performs a complete installation inputting all the necessary values. Instead of directly passing the values of variables to the installer, • Perform the following steps: • 1. On a test system, run the installation in record mode (/r), which generates a response file (filename.iss) • 2. On an end user's system, run the installation in silent mode, using the data from the response file.
Example: Generate Response File • To generate the response file, you run the InstallScript setup.exe with the /rswitch. This displays the installer's dialog boxes, and additionally records the data you enter in the dialog boxes. A response file uses the .iss (for "InstallShield silent") file name extension; you can specify the name and location of the response file using the /f1switch. setup /r /f1"C:\sample\setup.iss"
InstallShield Example: FEMAP 9.3.1 • Product: FEMAP 9.3.1 Note: The msiexec.exe examples below may appear on multiple lines because of document formatting but they must be entered on your computer as one line. Setup.exe /s /f1”FEMAP931_Setup.iss"
Batch File: Create automatic • Create a windows batch file ‘.bat’ to capture all the parameters to automate an installation. • Use notepad to create a new text file with the extension ‘.bat’ • The first line in the batch file • @ECHO OFF
Example Batch File: FEMAP FILE: SETUP_FEMAP.bat @echo off Setup.exe /s /f1”FEMAP931_Setup.iss"
Example Batch File: NX FILE: INSTALL_NX4.bat @echo off msiexec /qn+ /i "NX 4.msi" ADDLOCAL="all” INSTALLDIR=“C:\UGS\NX30“ LICENSESERVER=27000@hostname
References Online Microsoft Scripting Guide: http://www.microsoft.com/technet/scriptcenter/guide Microsft Script Center http://www.microsoft.com/technet/scriptcenter Books MSDN Forums Free downloads Activestate Microsoft powershell 21
Daniel Cortez decortez@jpl.nasa.gov Questions