Solved

Script for automating software deployment via AD group policy

Posted on 2009-07-02
3
558 Views
Last Modified: 2013-11-10
I need to automate an application installtion via AD group policy.  I've already created a software distribution point by performing an administrative install on a network share.  Here's the tricky part:  

The process must check for a previous version of the application, and if detected, it must uninstall the application (I have the GUID) and reboot prior to installing the new application.  If no previous version exists, it can go ahead and proceed with the install.  Users don't have administrative rights on their computers, so both the install and uninstall must execute with elevated privileges.  (RunAs prompts for password).  Once the application is successfully installed, two addtional MSI packages must be installed (add-on components) and they must be installed in sequence.  I want the results outputed to log files on a nework share.  I have no experience with programming other than modifying other people's scripts.  How can I make this happen?  Below are my sorry attemtpts to do this with a batch file that will run as a startup login script using AD group policy.
date /t >"%USERPROFILE%\%USERNAME% on %COMPUTERNAME%.log" 2>&1
time /t >>"%USERPROFILE%\%USERNAME% on %COMPUTERNAME%.log" 2>&1
 
:CHECKGISLEGACY
REM This will check for the previous version of Arcview GIS and uninstall if found
 
if exist "C:\WINDOWS\Installer\{1F34839E-4826-4B64-B1B3-42E5AE8DEC5A}" (goto UNINSTALLGISOLD) ELSE (goto 
 
INSTALLGIS93)
 
:UNINSTALLGISOLD
REM This will uninstall the previous version of Arcview GIS
 
ECHO An older version of Arcview GIS Desktop has been detected.  Setup will uninstall this now.
ECHO Please wait...
msiexec /X {1F34839E-4826-4B64-B1B3-42E5AE8DEC5A} /forcerestart /qb-! ALLUSERS=1 REMOVE="ALL" 
 
>>"%USERPROFILE%\%USERNAME% on %COMPUTERNAME%.log" 2>&1
 
:INSTALLGIS93
REM This will install Arcview GIS Desktop 9.3
 
ECHO Installing Arcview GIS Desktop 9.3
ECHO Please wait...
Start /wait Msiexec /i \\SERVER\ArcviewGIS_9.3\setup.msi /qn /norestart >>"%USERPROFILE%\%USERNAME% on 
 
%COMPUTERNAME%.log" 2>&1
 
ECHO Installing VBAOF11.msi
ECHO Please wait...
Start /wait Msiexec /i \\SERVER\ArcviewGIS_9.3\VBA\VBAOF11.msi /qn /norestart >>"%USERPROFILE%\%USERNAME% on 
 
%COMPUTERNAME%.log" 2>&1
 
ECHO Installing VBAOF11I.msi
ECHO Please wait...
Start /wait Msiexec /i \\SERVER\ArcviewGIS_9.3\VBA\1033\VBAOF11I.msi /qn /norestart >>"%USERPROFILE%\%USERNAME% 
 
on %COMPUTERNAME%.log" 2>&1
 
copy "%USERPROFILE%\%USERNAME% on %COMPUTERNAME%.log" "\\SERVER\InstallLogs" /y
 
ECHO Installation Completed

Open in new window

0
Comment
Question by:iolike
3 Comments
 
LVL 3

Accepted Solution

by:
theklap earned 500 total points
ID: 24769439
I use wpkg to deploy my software based on machine name.

http://wpkg.org/

They also have a nice list of silent installers.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 24782233
Your script looks good. What's the problem? it does not work?

But maybe script is not necessary at all. Usually, later version of software automatically upgrades the previous version, check if this not the case with yours. Next, Installer can detect by itself if reboot is necessary, so maybe you don't need to worry about it. Is this is all so, then all you need to do is assign the msi in the group policy to the users or to computers. Lastly, regarding the installation of your add-ons, you can probably resolve this by timing, i.e. assign first the product, then wait until everyone has installed it, and then assign the add-ons. Better would be to have in the installation of the add-ons a prerequisite that would abandon the installation if Arcview GIS Desktop 9.3 is not installed.
0
 
LVL 18

Expert Comment

by:JoseParrot
ID: 24833346
Depending on company size and sw release policies, for Windows stuff the simplest and confortable way nis Microsoft SMS.
Jose
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about a problem I had getting the GPS LocationListener working.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question