Solved

Script for automating software deployment via AD group policy

Posted on 2009-07-02
3
549 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
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 …

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now