Solved

Script for automating software deployment via AD group policy

Posted on 2009-07-02
3
563 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Jose Parrot
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

732 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