0% found this document useful (0 votes)
33 views

Network Install Scripts

Uploaded by

Rotari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

Network Install Scripts

Uploaded by

Rotari
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Autodesk Extensions

White Paper

Use Scripts to Install AutoCAD-Based


Products on a Network
With AutoCAD® 2000i, Autodesk started using the Microsoft® Windows® Installer (MSI)
technology. With this new installer technology, you can use scripts to install products
without any need for user participation other than starting the script. You can also use
scripts to deploy service packs, extensions, and even your own customization tools.
A script is a command or a set of commands that are executed sequentially. Scripts are
similar to batch files but more flexible. Installation scripts are most useful for stand-alone
installation of programs on computers connected to a network. If you use the Network
Setup Wizard to deploy AutoCAD seats, scripts are useful for installing service packs,
extensions, and enablers on a network.
The system requirements for VBS Scripts include
• Microsoft Windows® 95 or later
• Microsoft Internet Explorer 4 or later
• Microsoft Windows Installer
• Microsoft Scripting Engine
• Administrator permissions (on all computers using Windows NT 4.0 or Windows
2000)
The Microsoft Windows Installer is an installation and configuration program that is installed
on your system when you install AutoCAD 2000i, AutoCAD 2002, or products based on
those releases. It is also included with Windows 2000 and is provided via a service pack to
Windows 95, Windows 98, and Windows NT® 4.0. You can find out more about Microsoft
technology on the Microsoft website.
The sample scripts in this paper are based on Microsoft Scripting Engine 5.5, which works
with both VBScript and JavaScript. If you don’t have the scripting engine installed, you can
download it free from the Microsoft website at msdn.microsoft.com/scripting. Sample scripts
and help files are also available for download.

How to Create Scripts That Install Programs


A script is one command or a set of commands to be executed sequentially. You create a
script using a text editor such as Notepad and then save it in ASCII format in a file with the
file extension .vbs. The script consists of one or more commands, command switches that
specify options, and flags that modify the options. An installation script also contains path
names.
An installation script points to the location of the appropriate product MSI file. You can find
the name of the MSI file for a program in the root directory of the installation CD. For
example, the following MSI files point to specific Autodesk products.

www.autodesk.com 1
Use Scripts to Install AutoCAD-Based Products on a Network

MSI file name Product


®
acad.msi AutoCAD 2002
aclt.msi AutoCAD LT® 2002
acadmap.msi Autodesk® Map 5
adt.msi Autodesk® Architectural Desktop 3.3
LDT.msi Autodesk® Land Desktop 3
CD.msi Autodesk® Civil Design 3
Survey.MSI Autodesk® Survey 3
acad.msi Autodesk® Mechanical Desktop® 6

A Sample Installation Script


A simple script for a silent installation of AutoCAD 2002 uses the following syntax. (This
script is the same as sample script 3 at the end of the paper.) Any line preceded by an
apostrophe is a comment. The script itself starts with the line that begins with shell.Run.
No comments are permitted between that line and the INSTALLLEVEL line.
' Typical installation of AutoCAD 2002.

' Using a UNC path for the location of the MSI install file.
PathOfMSI = "\\acme\apps\acad.msi"

Set shell = CreateObject("WScript.Shell")

' Creating a variable to store an installation location with a long file name.
dim strADSKPath
strADSKPath = "c:\Autodesk\AutoCAD 2002"

' Creating a variable to store a company name with a space in it.


dim strADSKName
strADSKName = "ABC Graphics"

' Creating a variable to store the dealer name.


dim strADSKCompany
strADSKCompany = "Autodesk Inc."

shell.Run "msiexec /i " + _


PathOfMSI + " " + _
"/l*v acadinstall.log" + " " + _
"INSTALLDIR=""" & strADSKPath & """" + " " + _
"/qb ACAD_SILENT_LICENSE=YES" + " " + _
"ACADSERIALPREFIX=111" + " " + _
"ACADSERIALNUMBER=12345678" + " " + _
"ACADSERIALKEY=ABCXYZ" + " " + _
"ACADFIRSTNAME=John" + " " + _
"ACADLASTNAME=Doe" + " " + _
"ACADORGANIZATION=""" & strADSKName & """" + " " + _
"ACADDEALERPHONE=800-123-4567" + " " + _
"ACADDEALER=""" & strADSKCompany & """" + " " + _
"INSTALLLEVEL=3"

www.autodesk.com 2
Use Scripts to Install AutoCAD-Based Products on a Network

Windows 98 and Windows NT 4.0: The preceding sample script uses variables in order
to accommodate long file names (or other items with spaces). Scripts such as this one do
not run on Windows 98 and Windows NT 4.0. To use an installation script successfully on
Windows 98 and Windows NT 4.0, avoid using spaces in folder names, file names, and other
items, and use a simple script like the one below. A script like the sample below uses the
same switches and flags, but the script itself must be all on one line.
msiexec /i \\acme\apps\autocad2002\acad.msi /l*v acadinstall.log /qb
INSTALLDIR=c:\AutoCAD2002 ACAD_SILENT_LICENSE=YES ACADSERIALPREFIX=123
ACADSERIALNUMBER=12345678 ACADSERIALKEY=123ABC INSTALLLEVEL=3
Explanation of the Sample Installation Script
Each line of the script must end with a plus sign. The lines above the shell.Run line are
setting up variables. The first variable uses a UNC path for the location of the MSI file rather
than a mapped drive letter so that it is not necessary for each user to have the same
mapped drive letter on a server. To use a mapped drive letter in the script, change \\acme
to the actual share on the server, for example, PathOFMSI="J:\acme\apps\acad.msi".
The next sections set up variables. Variables make it possible to use long file names and
other strings with spaces in them in the script.
The first section of the script itself begins with the VBScript command shell.Run that runs
the script, the command msiexec, and the /i (install) switch:
shell.Run "msiexec /i " + _
The next line is the variable specifying the location of the MSI file for the product to install:
PathOfMSI + " " + _
The next line uses the switch /l and the flag *v to specify creation of a log file each time
the script is run that includes all available information. You can use any name for the log
file, and you can store it wherever you like by specifying a path name; the default location
is the folder from which the script is running.
"/l*v acadinstall.log" + " " + _
The next line uses a variable to specify where to install the product:
"INSTALLDIR=""" & strADSKPath & """" + " " + _
The next line uses a switch to specify silent installation:
"/qb ACAD_SILENT_LICENSE=YES" + " " + _
The next lines use switches to fill in personalization information. The company and dealer
lines use variables for names that include spaces:
"ACADSERIALPREFIX=111" + " " + _
"ACADSERIALNUMBER=12345678" + " " + _
"ACADSERIALKEY=ABCXYZ" + " " + _
"ACADFIRSTNAME=John" + " " + _
"ACADLASTNAME=Doe" + " " + _
"ACADORGANIZATION=""" & strADSKName & """" + " " + _
"ACADDEALERPHONE=800-123-4567" + " " + _
"ACADDEALER=""" & strADSKCompany & """" + " " + _
"INSTALLLEVEL=3"
When you save the script, use the file extension .vbs, and be sure to give the file a name
that tells you what product you’re installing.

www.autodesk.com 3
Use Scripts to Install AutoCAD-Based Products on a Network

Switches
The following table lists all of the switches relevant to installation, including the /x switch,
which is used to uninstall.
Switch Description
/i Installs or configures a product.
/x Uninstalls a product.
/l Creates a log file and specifies the path to the log file; flags
specify what is included in the log file. (See the log file flags
table.)
/q Sets the user interface level using flags. (See the UI flags table.)
INSTALLDIR= Specifies the location to install the AutoCAD product.
ACAD_SILENT_LICENSE=YES Sets the silent license agreement.
ACADSERIALPREFIX= Specifies the numbers that precede the hyphen in the serial
number.
ACADSERIALNUMBER= Specifies the serial number.
ACADSERIALKEY= Specifies the CD key number.
INSTALLLEVEL= Specifies the type of installation: 1=Compact, 3=Typical, 5=Full
ACADFIRSTNAME= Specifies the first name personalization.
ACADLASTNAME= Specifies the last name personalization.
ACADORGANIZATION= Specifies the company name.
ACADDEALER= Specifies the dealer name.
ACADDEALERPHONE= Specifies the dealer phone number.

Log Files
You can specify what information to log and how the log file is constructed by using the
flags in the following table. The plus sign flag appends the log information to an existing file
rather than starting a new file each time the script is run.
Log file flag Description
i Status messages
w Nonfatal warnings
e All error messages
a Startup of actions
r Action-specific records
u User requests
c Initial UI parameters
m Out-of-memory or fatal exit message
o Out-of-disk-space messages
p Terminal properties
v Verbose output
+ Information appended to existing file
! Each line flushed to the log
* Wildcard: All information except verbose output
logged; to include verbose output, use /l*v

www.autodesk.com 4
Use Scripts to Install AutoCAD-Based Products on a Network

The User Interface


You can specify the user interface that is displayed during installation by using the flags in
the following table.
UI flag Description
q or qn No UI.
qn+ No UI except a modal dialog box displayed at the end of the installation.
qb Basic UI.
qb+ Basic UI with a modal dialog box displayed at the end of the installation.
(The dialog box is not displayed if the user cancels the installation.)
qb– Basic UI with no modal dialog boxes.
qf Full UI with a modal dialog box displayed at the end of the installation.
qr Reduced UI with a modal dialog box displayed at the end of the installation.

Scripts for Custom Installations


To create a script for a custom installation, first you specify a full installation and then
specify which components to remove. The flags for all the AutoCAD components are listed in
the table below. Use the syntax ADDLOCAL=ALL REMOVE=switch. See sample script 1 below.

Flag Component
VVE Volo View Express
ACS AutoCAD Samples
Batch_Plotting Batch Plotting
Database Database (DBCONNECT)
DCS Design Center Samples
Dictionaries Dictionaries
AmericanEnglish_Dictionary American English Dictionary
Fonts Fonts
French_Canadian_Dictionary French Canadian Dictionary
Samples Sample files
TM Texture Maps
Tutorials Tutorials
VBA Visual Basic
VLS Visual LISP Samples
VLT Visual LISP Tutorials
X1 CAD Standards Extension
X2 XML/Data Extension

How to Run Scripts


After creating a script, you move the script to a server or use a mapped drive letter or a
UNC (universal naming conventions) path. If you place it on a server for users to run, create
a share on the server, and then add users to the share with the rights they need. Because
all that the users need to do is run the script, provide read-only access to the share
directory.
Next, on the same server or on a different server, create a directory for each product you
want to install. Choose a location for this directory that won’t be changed so that you can

www.autodesk.com 5
Use Scripts to Install AutoCAD-Based Products on a Network

point to the MSI files in your scripts. Copy the product CD to that directory. For example,
copy the AutoCAD 2002 CD to the acad2002 directory. You may want to also create
directories for service packs, extensions, and your own customization tools.
You can use any of the following methods to run an installation script:
• Run the script manually at each individual workstation. To run the installation, you
can paste the script into the Run dialog box or run it from the DOS prompt.
• Send an email with the UNC path to each user that you want to run the script. To run
the script, the user follows your instructions.
• Email the script to each user with instructions for use.
• Set up the script so that it runs on login.

Sample Scripts
The sample scripts below install AutoCAD in various configurations. To make it easy to copy
these and substitute your own information, the same names are used throughout for
variable items. The log file name is based on the product being installed. You can either use
the name in the script or change it to something else.
Domain name: acme
Share name: apps
Installation directory: c:\Autodesk\AutoCAD 2002
Serial number prefix: 111
Serial number: 12345678
CD key: abcxyz
First name: John
Last name: Doe
Organization: ABC Graphics
Dealer: Autodesk
Telephone number: 800-123-4567
Sample Script 1: Custom Installation
' Custom installation of program files only.

' Using a UNC path for the location of the MSI install file.
PathOfMSI = "\\acme\apps\acad.msi"

Set shell = CreateObject("WScript.Shell")

' Creating a variable to store an installation location with a long file name.
dim strADSKPath
strADSKPath = "c:\Autodesk\AutoCAD 2002"

' Creating a variable to store a company name with a long file name.
dim strADSKName
strADSKName = "ABC Graphics"

' Creating a variable to store the dealer name.


dim strADSKCompany

www.autodesk.com 6
Use Scripts to Install AutoCAD-Based Products on a Network

strADSKCompany = "Autodesk Inc."

shell.Run "msiexec /i " + _


PathOfMSI + " " + _
"/l*v acadinstall.log" + " " + _
"INSTALLDIR=""" & strADSKPath & """" + " " + _
"/qb ACAD_SILENT_LICENSE=YES" + " " + _
"ACADSERIALPREFIX=111" + " " + _
"ACADSERIALNUMBER=12345678" + " " + _
"ACADSERIALKEY=ABCXYZ" + " " + _
"ACADFIRSTNAME=John" + " " + _
"ACADLASTNAME=Doe" + " " + _
"ACADORGANIZATION=""" & strADSKName & """" + " " + _
"ACADDEALERPHONE=800-123-4567" + " " + _
"ACADDEALER=""" & strADSKCompany & """" + " " + _
"ADDLOCAL=ALL" + " " + _

"REMOVE=VVE,ACS,Batch_Plotting,Database,DCS,Dictionaries,AmericanEnglish_Dict
ionary,Fonts,French_Canadian_Dictionary,Samples,TM,Tutorials,VBA,VLS,VLT,X1,X
2"

Sample Script 2: Compact Installation


' Compact installation of AutoCAD 2002.

' Using a UNC path for the location of the MSI install file.
PathOfMSI = "\\acme\apps\acad.msi"

Set shell = CreateObject("WScript.Shell")

' Creating a variable to store an installation location with a long file name.
dim strADSKPath
strADSKPath = "c:\Autodesk\AutoCAD 2002"

' Creating a variable to store a company name with a long file name.
dim strADSKName
strADSKName = "ABC Graphics"

' Creating a variable to store the dealer name.


dim strADSKCompany
strADSKCompany = "Autodesk Inc."

shell.Run "msiexec /i " + _


PathOfMSI + " " + _
"/l*v budtestlog.txt" + " " + _
"INSTALLDIR=""" & strADSKPath & """" + " " + _
"/qb ACAD_SILENT_LICENSE=YES" + " " + _
"ACADSERIALPREFIX=111" + " " + _
"ACADSERIALNUMBER=12345678" + " " + _
"ACADSERIALKEY=ABCXYZ" + " " + _
"ACADFIRSTNAME=John" + " " + _

www.autodesk.com 7
Use Scripts to Install AutoCAD-Based Products on a Network

"ACADLASTNAME=Doe" + " " + _


"ACADORGANIZATION=""" & strADSKName & """" + " " + _
"ACADDEALERPHONE=800-123-4567" + " " + _
"ACADDEALER=""" & strADSKCompany & """" + " " + _
"INSTALLLEVEL=1"

Sample Script 3: Typical Installation


' Typical installation of AutoCAD 2002.

' Using a UNC path for the location of the MSI install file.
PathOfMSI = "\\acme\apps\acad.msi"

Set shell = CreateObject("WScript.Shell")

' Creating a variable to store an installation location with a long file name.
dim strADSKPath
strADSKPath = "c:\Autodesk\AutoCAD 2002"

' Creating a variable to store a company name with a long file name.
dim strADSKName
strADSKName = "ABC Graphics"

' Creating a variable to store the dealer name.


dim strADSKCompany
strADSKCompany = "Autodesk Inc."

shell.Run "msiexec /i " + _


PathOfMSI + " " + _
"/l*v acadinstall.log" + " " + _
"INSTALLDIR=""" & strADSKPath & """" + " " + _
"/qb ACAD_SILENT_LICENSE=YES" + " " + _
"ACADSERIALPREFIX=111" + " " + _
"ACADSERIALNUMBER=12345678" + " " + _
"ACADSERIALKEY=ABCXYZ" + " " + _
"ACADFIRSTNAME=John" + " " + _
"ACADLASTNAME=Doe" + " " + _
"ACADORGANIZATION=""" & strADSKName & """" + " " + _
"ACADDEALERPHONE=800-123-4567" + " " + _
"ACADDEALER=""" & strADSKCompany & """" + " " + _
"INSTALLLEVEL=3"

Sample Script 4: Full Installation


' Full installation of AutoCAD 2002.

' Using a UNC path for the location of the MSI install file.
PathOfMSI = "\\acme\apps\acad.msi"

Set shell = CreateObject("WScript.Shell")

' Creating a variable to store an installation location with a long file name.

www.autodesk.com 8
Use Scripts to Install AutoCAD-Based Products on a Network

dim strADSKPath
strADSKPath = "c:\Autodesk\AutoCAD 2002"

' Creating a variable to store a company name with a long file name.
dim strADSKName
strADSKName = "ABC Graphics"

' Creating a variable to store the dealer name.


dim strADSKCompany
strADSKCompany = "Autodesk Inc."

shell.Run "msiexec /i " + _


PathOfMSI + " " + _
"/l*v acadinstall.log" + " " + _
"INSTALLDIR=""" & strADSKPath & """" + " " + _
"/qb ACAD_SILENT_LICENSE=YES" + " " + _
"ACADSERIALPREFIX=111" + " " + _
"ACADSERIALNUMBER=12345678" + " " + _
"ACADSERIALKEY=ABCXYZ" + " " + _
"ACADFIRSTNAME=John" + " " + _
"ACADLASTNAME=Doe" + " " + _
"ACADORGANIZATION=""" & strADSKName & """" + " " + _
"ACADDEALERPHONE=800-123-4567" + " " + _
"ACADDEALER=""" & strADSKCompany & """" + " " + _
"INSTALLLEVEL=5"

Sample Script 5: Installation of the CAD Standards Extension for AutoCAD 2000i
' Installation of AutoCAD 2000i CAD Standards Extension.

Shell.Run "msiexec /i \\acme\apps\acext1.msi /l*v acext1.log /qb


ACAD_SILENT_LICENSE=YES"

Autodesk, Inc.
111 McInnis Parkway
San Rafael, CA 94903
USA

Autodesk, AutoCAD, AutoCAD LT, and Mechanical Desktop are either registered trademarks or trademarks of Autodesk, Inc., in the
USA and other countries. All other brand names, product names, or trademarks belong to their respective holders.

© Copyright 2001 Autodesk, Inc. All rights reserved.

www.autodesk.com 9

You might also like