I needed to install ArcView 10 on a few different PCs. The difficult part of this was that some of the PCs were individually installed with ArcView 9.3.1 which means that some individual components of ArcView were loaded on the machines (some were not). The new install had to have the license manager location set, the default class for the software had to be set for "Viewer" the temporary license check box had to be unchecked and the license had to be set to multi seat instead of single.
These demands were not difficult to script. The difficulty lay within uninstalling all the old components of 9.3.1. ArcView 10 came with a nifty little widget , called 10UninstallUtility that removes all the old versions of ARC GIS software in one fell swoop. So I had to figure out what exactly was out there on the network and script for the uninstall of each product. This is the end result of my batch.
RD c:\GISArcVIEW10 /S /Q
if exist C:\GISArcView10.log goto Done
md c:\GISArcVIEW10
xcopy file://server/share/GISArcVIEW10/*.* /S/e/v/H c:\GISArcVIEW10
cd c:\GISArcVIEW10
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {5033400B-0977-45AB-94CE-CC135A8E1BBB}" -lwp
sleep 600
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {41B76534-B3C2-4FCF-B171-5291A3561051}" -lwp
sleep 600
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {FDDE9E05-0C99-452A-8BEF-2A8CA5D63BD9}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {34779D41-898A-43A2-8A1E-FD15DCD2166D}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {FCF6B51D-CE32-437B-8556-016F08A677C5}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {993E1907-DC8A-485F-B724-9BCD3F9EA468}" -lwp
sleep 300
cpau -u somusr-p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {2662F66D-CE89-4747-A468-AC14C8906460}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {5D3A6A96-0FB7-4BD8-BD40-2AD357B24C12}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {2E5EB60C-D096-48AD-B248-AC30FF2CD281}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {A9DB4901-5FAB-4104-B0F9-DF11D1C7D362}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {2B0AEAE7-6EF2-4642-8F95-DDBC9B72721D}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {9ACB5D84-EC39-48E8-9970-4812B6F6738E}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {3B556DE7-7D12-493A-A010-BAA46FDC9F85}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {AF3EB55C-DC39-4770-9F0F-077B65C94CB7}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {22CABC57-BF82-4CE3-BF8F-49413AD8ED77}" -lwp
sleep 300
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {A05805ED-806A-464C-BF77-6287D295624E}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {7E6618B7-F401-46DE-98CA-E5B5B9C07BCD}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {A13D16C5-38A9-4D96-9647-59FCCAB12A85}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {FB97C283-1F3C-42D4-AE01-ADC1DC12F774}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {15FB6880-728F-4DF6-BEBB-046302A8E25A}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {37B00AC8-9C0B-48BF-BCBF-36B9B732B905}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {0BEA7956-25DA-455E-877E-7E9D97DA9559}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {FCF6B51D-CE32-437B-8556-016F08A677C5}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "msiexec.exe /L*V "C:\GISArcView10.log" /qn /x {9ACB5D84-EC39-48E8-9970-4812B6F6738E}" -lwp
sleep 100
cpau -u somusr -p Pass -ex "Msiexec /L*V "C:\GISArcView10.log" /qn /I setup.msi ESRI_LICENSE_HOST=Lic Manager SOFTWARE_CLASS=Viewer SEAT_PREFERENCE=Float" -lwp
sleep 1500
cpau -u somusr -p Pass -ex "Msiexec /L*V "C:\GISArcView10.log" /I VBAOF11.msi /qb" -lwp
sleep 300
cpau -u somusr -p Pass -ex "Msiexec /L*V "C:\GISArcView10.log" /I VBAOF11i.msi /q" -lwp
sleep 300
cpau -u somusr-p Pass -ex "Msiexec /L*V "C:\GISArcView10.log" /I sqlncli.msi IACCEPTSQLNCLILICENSETERMS=YES /qb" -lwp
sleep 300
cpau -u somusr -p Pass -ex "reg import Arcliccheck.reg" -lwp
Done:
Exit
Now the whole idea is that the directory copies locally and runs, first removing all the old stuff and then installing the needed software. After it runs once a file is copied to the root of the C. After it runs a second time the directory that has files is removed and the batch skips to the end because of the file in the root of C. The reason for batch is because I wanted to run this in the log on script. I have an SMS 2003 server installed and I guess it would have done a fine job but I never really like the randomness of the installs. I will be moving to SCCM 2007 soon. But running it from the log in VBS the results are automatic.
I used a few tools to get everything to work the way I wanted it to work. Sense I have to run this as admin user I used CPAU.EXE. I have used SANUR in the past as well. A few things are kind of annoying about this app is that you can not use a Domain user name and that it runs each command consecutively with out waiting for the last command to finish. Which brings me to tool number two...
SLEEP.EXE So in this batch I set it to sleep what I figured the approximate amount of time it would take to finish uninstalling/installing what ever product it is working on.
Since I was running everything from command line and did not want anyone to know what admin account or password I was using I used a program called BAT2EXE.EXE this allowed me to hide my application. But I think there is a better tool out there called Bat-To-Exe-Converter which I have not tried, but looks like it may have save me some trouble... Understand that some of these tools are hacking tools and may cause false positives on AV SW.
The last part of this (after a whole lot of testing) was to stick it in my log in script. Ok when users receive the EXE they will get a black window and that is it. Most will unwittingly close no matter how many email you send them. I did not want that! so what I did was run it invisible using "CreateObject("Wscript.Shell").Run """" & WScript.Arguments(0) & """", 0, False" http://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.85).aspx This runs your Batch in a vb command shell but hides the shell. Really this is a little redundant with ghosting the EXE and all but you can never be to safe right?