Logo
programming4us
programming4us
programming4us
programming4us
Windows XP
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone
 
 
programming4us
Windows 7

Deploying Applications (part 2) - Automating Installation

2/20/2013 5:19:40 PM

4. Automating Installation

To achieve a fully automated deployment process, the packages you install must support unattended installation. Many setup programs support /s or /q command-line options for silent or quiet installations; others don't.

Often you can find out if the package supports unattended installation by typing setup /? at the command prompt, where setup is the file name of the setup program. If the setup program doesn't provide clues, you need to know which vendor's product was used to create the package. You can usually tell by running the setup program and looking for logos, for example, or checking the file properties. Armed with that information, read the following sections to learn how to install packages created by different packaging software automatically. Table 1 summarizes the necessary commands.

Table 1. Unattended Package Installation

PACKAGE TYPE

COMMAND FOR UNATTENDED INSTALLATION

Windows Installer

msiexec.exe /i package.msi /qn ALLUSERS=2

InstallShield Windows Installer

setup.exe /s /v"/qn"

Optionally, you can extract the Windows Installer database from the compressed file and use the command msiexec.exe /i setup.msi ISSETUPDRIVEN=1 /qn to install it.

Legacy InstallShield

setup.exe /s /sms

To create the Setup.iss file necessary to run setup silently, type setup.exe /r to create a Setup.iss from your responses to the setup program's dialog boxes and then copy Setup.iss from %SystemRoot% to the folder containing the package.

Legacy InstallShield PackageForTheWeb

setup.exe /a /s /sms

To create the Setup.iss file necessary to run setup silently, type setup.exe /a /r to create the Setup.iss based on your responses and then copy Setup.iss from %SystemRoot% to the folder containing the package.

Legacy Wise Installation System

setup.exe /s

Useful Deployment Web Sites

The following Web sites are outstanding resources for automating the installation of applications, as well as other deployment topics:

  • AppDeploy.com at http://www.appdeploy.com

    This Web site provides comprehensive information about deploying applications that are packaged using a variety of technologies.

  • SourceForge at http://unattended.sourceforge.net

    This visually nondescript Web site contains a wealth of information, including information about automating the installation of many legacy installers.

  • Real Men Don't Click at http://isg.ee.ethz.ch/tools/realmen

    Don't let the name or odd URL detract from this Web site's usefulness. It describes how to automate a variety of processes, including software installation.

  • Acresso Software at http://www.acresso.com/services/education/publications_3812.htm

    This Web page contains the e-book The Administrator Shortcut Guide to Software Packaging for Desktop Migrations. This guide is an excellent resource for learning about packaging applications for deployment.

Windows Installer

Windows Installer is an installation and configuration service that helps reduce ownership costs by providing a component-based application installation architecture. Installation is consistent across all applications packaged for Windows Installer. Packages are easily customizable, installations are protected from errors, and a rollback mechanism provides for recovery in case of failure. Windows Installer supports application and feature advertising. Windows Installer provides many other benefits, and most Independent Software Vendors (ISVs) are now using it to package their applications. Windows 7 includes Windows Installer 5.0. For more information about its new features, see http://msdn.microsoft.com/en-us/library/aa372796.aspx.

Windows Installer 5.0 is compatible with User Account Control (UAC) in Windows 7. By using elevated installation, an administrator can authorize Windows Installer to install applications or security updates on behalf of users who aren't members of the Administrators group. 

Windows Installer packages provide the following to enable flexible application deployment:

  • Command-line options You use command-line options to specify options, file names, and path names, as well as control the action of the installation at run time.

  • Properties (variables) on the command line Properties are variables that Windows Installer uses during an installation. You can set a subset of these, called public properties, on the command line.

  • Transforms A transform is a collection of changes you can apply to a base Windows Installer package (.msi) file. You can customize applications by using Windows Installer transform (.mst) files. You configure transforms to modify a Windows Installer package to dynamically affect installation behavior according to your requirements. You associate transforms with a Windows Installer package at deployment time. Transforms for Windows Installer package files are similar to answer files that you might have used to automate the installation of an operating system such as Windows Vista.

The number of applications packaged as Windows Installer databases is multiplying rapidly. Nearly all software vendors are packaging their applications using this technology. And what often looks like a self-contained, self-extracting setup program with a file name such as Setup.exe is often a file that decompresses to a Windows Installer database. You can usually extract the database by using a tool such as WinZip (from WinZip Computing at http://www.winzip.com) or by running the setup program and looking in %UserProfile%\Local Settings\Temp for the package file. Windows Installer databases have the .msi file extension.

To install Windows Installer databases unattended using Msiexec.exe, use the /qb command-line option for a basic user interface or the /qn command-line option for no user interface. Also, to ensure that the package installs for all users, add the ALLUSERS=2 property. For example, the command

msiexec.exe /i program.msi /qn ALLUSERS=2

installs the package file Program.msi with no user interaction and for use by all users who share the computer.

InstallShield

Some Windows Installer databases that Macrovision InstallShield (http://www.acresso.com/products/is/installshield-overview.htm) creates require that you install them by running Setup.exe. Trying to install the .msi file using Msiexec.exe results in a message that you must run Setup.exe to start the installation. When the developer uses InstallShield Script, this requirement is enforced to ensure that the needed version of the InstallShield Script Engine (ISScript.msi) is installed on the computer before proceeding. If it is not detected, the required version of InstallShield Script Engine is installed automatically before starting Windows Installer. You can automate this installation a couple of ways:

  • Use InstallShield's command-line support that Setup.exe offers. Not only does Setup.exe provide command-line option support, but you may also pass options to the Windows Installer setup database by using the /v command-line option. Following /v, you may specify any options you want to pass to the Windows Installer setup database within double quotation marks. For example, the following command installs the application silently and passes the /qn option.

    setup.exe /s /v"/qn"
  • Deploy the InstallShield Script Engine separately as part of your core applications before any setup files that require it. You may then safely bypass running Setup.exe by installing the Windows Installer setup database with Msiexec.exe and including the ISSETUPDRIVEN public property. You can extract the embedded Windows Installer setup database by looking in the %Temp% folder after the welcome message for the installation wizard is displayed. Then, use the following command to install it.

    msiexec.exe /i setup.msi ISSETUPDRIVEN=1 /qn

Legacy InstallShield

Packages created using legacy InstallShield technologies usually have the file name Setup.exe. To create an unattended installation for a legacy InstallShield package, you need to create an InstallShield script, which has the .iss file extension. Many applications come with such a file, but they are also easy to create.

To create an InstallShield response file, perform the following steps:

  1. Run the setup program using the /r command-line option. This creates a Setup.iss file based on how you configure the installation as you step through the setup program. The result is the file Setup.iss in %SystemRoot%.

  2. Copy Setup.iss from %SystemRoot% to the folder containing the package.

  3. Run the setup program using the /s command-line option. The setup program runs silently using the responses provided by the Setup.iss file.

Note

IMPORTANT Packages created by InstallShield will spawn a separate process and then return immediately to the calling program. This means that the setup program runs asynchronously, even if you start the setup program using start /wait. You can add the /sms command-line option to force the setup program to pause until installation is finished, however, making the process synchronous.

Legacy InstallShield PackageForTheWeb

PackageForTheWeb is an InstallShield-packaged application contained in a self-contained, self-extracting file. You create a Setup.iss file and use it in almost the same way as described in the previous section. The difference is that you must use the /a command-line option to pass the command-line options to the setup program after the file extracts its contents. For example, a file that you downloaded called Prog.exe will expand its contents into the temporary folder and then run Setup.exe when finished. To pass command-line options to Setup.exe, you must use the /a command-line option. The following procedure demonstrates how this extra option changes the steps.

To create an InstallShield PackageForTheWeb response file, perform the following steps:

  1. Run the setup program using the /a /r command-line options: Type setup.exe /a /r. This creates a Setup.iss file based on the way you configure the installation as you step through the setup program. The Setup.iss file is in %SystemRoot%.

  2. Copy Setup.iss from %SystemRoot% to the folder containing the package.

  3. Run the setup program using the /a /s command-line options: Type setup.exe /a /s. The setup program runs silently using the responses in the Setup.iss file.

Legacy Wise Installation System

Packages created using the legacy Wise Installation System recognize the /s command-line option for unattended installation. No tool is available to script the installation, however.

Windows Script Host

Some applications cannot be automated with command-line options. These applications might provide a wizard-based setup routine but require the user to click buttons or press keys on the keyboard to install the application. If a user can complete the installation by using only the keyboard, you can automate the installation by creating a script (a series of text commands) that simulates keystrokes. This technique is called screen scraping.

You can screen scrape by using Windows Script Host. Specifically, you use the SendKeys() method to send keystrokes to an application. For more information about the SendKeys() method and an example that you can use to quickly create your own screen-scraping scripts, see http://windowssdk.msdn.microsoft.com/en-us/library/8c6yea83.aspx.

Note

ON THE COMPANION MEDIA The companion media contains the sample script Sendkeys.vbs, which provides a shell for using the SendKeys() method without having to write your own script. It accepts two command-line options: sendkeys.vbs program textfile, where program is the path and file name of the program you want to drive, and textfile is the path and file name of the text file containing the keystrokes, one keystroke per line, to send to the program. See http://windowssdk.msdn.microsoft.com/en-us/library/8c6yea83.aspx for a list of key codes. If you need to pause before sending more keystrokes, add a line to the file that contains sleep. Each line that contains sleep will pause for 1 second. The file Sendkeys.txt is a sample textfile you can use with Sendkeys.vbs; for example, type sendkeys.vbs notepad.exe sendkeys.txt and watch what happens.

Other -----------------
- Maintaining Windows 7 : Restore Backed-Up Files
- Maintaining Windows 7 : Back Up Files
- Maintaining Windows 7 : Check Your Hard Drive for Errors
- Maintaining Windows 7 : Defragment Your Hard Drive on a Schedule
- Maintaining Windows 7 : Delete Unnecessary Files
- Maintaining Windows 7 : Check Hard Drive Free Space
- Protecting Windows from Viruses and Spyware : Antimalware Strategy: Defense in Depth (part 4) - User Account Control Options
- Protecting Windows from Viruses and Spyware : Antimalware Strategy: Defense in Depth (part 3) - Data Execution Prevention
- Protecting Windows from Viruses and Spyware : Antimalware Strategy: Defense in Depth (part 2) - Windows Defender for Spyware Protection
- Protecting Windows from Viruses and Spyware : Antimalware Strategy: Defense in Depth (part 1) - Windows Action Center
 
 
Video tutorials
- How To Install Windows 8 On VMware Workstation 9

- How To Install Windows 8

- How To Install Windows Server 2012

- How To Disable Windows 8 Metro UI

- How To Change Account Picture In Windows 8

- How To Unlock Administrator Account in Windows 8

- How To Restart, Log Off And Shutdown Windows 8

- How To Login To Skype Using A Microsoft Account

- How To Enable Aero Glass Effect In Windows 8

- How To Disable Windows Update in Windows 8

- How To Disable Windows 8 Metro UI

- How To Add Widgets To Windows 8 Lock Screen
programming4us programming4us
Popular tags
Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Biztalk Exchange Server Microsoft LynC Server Microsoft Dynamic Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 windows Phone 7 windows Phone 8
programming4us programming4us
 
Popular keywords
HOW TO Swimlane in Visio Visio sort key Pen and Touch Creating groups in Windows Server Raid in Windows Server Exchange 2010 maintenance Exchange server mail enabled groups Debugging Tools Collaborating
programming4us programming4us
 
programming4us
Women
programming4us
Windows Vista
programming4us
Windows 7
programming4us
Windows Azure
programming4us
Windows Server
programming4us
Windows Phone