?
Solved

Script for automating software deployment via AD group policy

Posted on 2009-07-02
3
Medium Priority
?
571 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 2000 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 August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Simple Linear Regression

777 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