#76699 - 2003-09-16 08:48 PM
Office 2000 Service packs, etc...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
here is some code to determine: office version service pack (only for MSO2k, so far) apply SR1a Apply SP-3 Apply VBA patch
Anyone see any way to improve... efficiency, logic, etc...
code:
DIM $OFVer[5], $ACVer[5], $XLVer[5], $OLVer[5], $PPVer[5], $WDVer[5], $Arr_OfficeSP[5] $ier =readvalue("HKLM\Software\Microsoft\Internet Explorer", "Version") $office =readvalue("$HKLMSMWCV\Uninstall\{00010409-78E1-11D2-B60F-006097C998E7}","DisplayName") $MSOdir =readvalue("$HKLMSMWCV\App Paths\excel.exe","Path") $access =getfileversion("$MSOdir\msaccess.exe") $excel =getfileversion("$MSOdir\excel.exe") $outlook=getfileversion("$MSOdir\Outllib.dll") $powerpt=getfileversion("$MSOdir\powerpnt.exe") $pub =getfileversion("$MSOdir\mspub.exe") $Word =getfileversion("$MSOdir\winword.exe") $MSOVer =split($excel,'.')[0] select case $MSOVer = '11' $office = "2003" case $MSOVer = '10' $office = "XP" case $MSOVer = '9' $office = "2000" $OFVer = 'base', 'SR-1', 'SP-2', 'SP-3', 'OOB' $ACVer = '9.0.2720', '9.0.3821', '9.0.4506', '9.0.6620', '9.9' ;Access $XLVer = '9.0.2720', '9.0.3821', '9.0.4430', '9.0.6627', '9.9' ;Excel $OLVer = '9.0.2711', '9.0.3821', '9.0.4527', '9.0.6627', '9.9' ;Outlook $PPVer = '9.0.2716', '9.0.3821', '9.0.4527', '9.0.6620', '9.9' ;Powerpoint $WDVer = '9.0.2720', '9.0.3821', '9.0.4527', '9.0.6926', '9.9' ;Word for $ver = 0 to 3 if $Access => $ACVer[$ver] and $Access < $ACVer[$ver +1] $ACSPack = $OFVer[$Ver] endif if $Excel => $XLVer[$ver] and $Excel < $XLVer[$ver +1] $XLSPack = $OFVer[$Ver] endif if $Outlook => $OLVer[$ver] and $Outlook < $OLVer[$ver +1] $OLSPack = $OFVer[$Ver] endif if $powerpt => $PPVer[$ver] and $powerpt < $PPVer[$ver +1] $PPSPack = $OFVer[$Ver] endif if $Word => $WDVer[$ver] and $Word < $WDVer[$ver +1] $WDSPack = $OFVer[$Ver] endif next $Arr_OfficeSP = $ACSPack,$XLSPack,$OLSPack,$PPSPack,$WDSPack for $loop=3 to 0 step -1 if AScan($Arr_OfficeSP,$OFVer[$loop])+1 $O2kSP=$OFVer[$loop] endif next $MSOProducts="HKLM\Software\Classes\Installer\Products\904010001E872D116BF00006799C897E" $=writevalue("$MSOProducts\SourceList\Net","1","$setup\mso2k\CD1\",REG_Expand_SZ) $=writevalue("$MSOProducts\SourceList","LastUsedSource","n;1;$setup\mso2k\CD1\",REG_Expand_SZ) $=writevalue("$MSOProducts\SourceList\Net","1","$setup\mso2k\CD2\",REG_Expand_SZ) $=writevalue("$MSOProducts\SourceList","LastUsedSource","n;1;$setup\mso2k\CD2\",REG_Expand_SZ) $=writevalue("$HKLMSMWCV\Uninstall\{00010409-78E1-11D2-B60F-006097C998E7}","InstallSource","$setup\mso2k\CD1\",REG_SZ) $=writevalue("$HKLMSMWCV\Uninstall\{00040409-78E1-11D2-B60F-006097C998E7}","InstallSource","$setup\mso2k\CD2\",REG_SZ) case $MSOVer = '8' $office = "97" endselect ? color c+/n " Operating System: " color w+/n @producttype +' '+ @csd color w/n ? color c+/n " Internet Explorer: " color w+/n $ier color w/n ? color c+/n " Office Suite: " color w+/n "Microsoft Office "+ $office +' '+ $O2kSP color w/n
; ********************************* Microsoft Office 2000 SP-3 ******************************************* if $office = '2000' if $O2kSP='base' if updateapp("MicrosoftOfficeSR1a",3)="yes" shell "$setup\mso2k\SR1a\O2kSR1aDL.exe /q:u" $=Writeprofilestring("$logon\inventory\Install.log","MicrosoftOfficeSR1a",@wksta,@date) endif endif if not $O2kSP='SP-3' if updateapp("MicrosoftOfficeSP3",3)="yes" shell "$setup\mso2k\sp3\o2ksp3.exe /q:u" $=Writeprofilestring("$logon\inventory\Install.log","MicrosoftOfficeSP3",@wksta,@date) endif if readvalue("HKLM\SOFTWARE\Updateapps\MicrosoftOfficeSP3","Offers") > 4 $=Writeprofilestring("$logon\inventory\Error.log","MicrosoftOfficeSP3",@wksta,@date) $=sendmessage($dcsa,"error installing MSO SP3 on @wksta") endif endif if $O2kSP='SP-3' $vbe6 = readvalue('HKLM\SOFTWARE\Microsoft\VBA','Vbe6DllPath') if getfileversion($vbe6)<'6.4.9969' if updateapp("OfficeVB_KB822035",3)="yes" shell "$setup\KB822035\office2000-kb822035-client-enu.exe /q:u /r:n" ; or /qb+ $=Writeprofilestring("$logon\inventory\Install.log","KB822035",@wksta,@date) endif endif endif endif
|
Top
|
|
|
|
#76701 - 2003-09-17 09:35 PM
Re: Office 2000 Service packs, etc...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
no gpo no admin install.. cd installs on images
|
Top
|
|
|
|
#76704 - 2003-09-23 05:39 PM
Re: Office 2000 Service packs, etc...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
for professional it is: readvalue("$HKLMSMWCV\Uninstall\{00010409-78E1-11D2-B60F-006097C998E7}","DisplayName")
but I'd bet that each 'flavor' has it's own GUID
|
Top
|
|
|
|
#76706 - 2003-09-23 08:38 PM
Re: Office 2000 Service packs, etc...
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
For anyone else that may find this helpful...
{00000409-78E1-11D2-B60F-006097C998E7} = Office 2000 Premium {00010409-78E1-11D2-B60F-006097C998E7} = Office 2000 Professional {00020409-78E1-11D2-B60F-006097C998E7} = Office 2000 Standard {90110409-6000-11D3-8CFE-0050048383C9} = Office XP Professional Office8.0 = Office 97 Professional
code:
$office = readvalue("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{00010409-78E1-11D2-B60F-006097C998E7}","DisplayName") If $office = "" $office = readvalue("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{00000409-78E1-11D2-B60F-006097C998E7}","DisplayName") Endif If $office = "" $office = readvalue("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{00020409-78E1-11D2-B60F-006097C998E7}","DisplayName") Endif If $office = "" $office = readvalue("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{90110409-6000-11D3-8CFE-0050048383C9}","DisplayName") Endif If $office = "" $office = readvalue("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Office8.0","DisplayName") Endif
|
Top
|
|
|
|
#76707 - 2003-09-23 09:07 PM
Re: Office 2000 Service packs, etc...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
missing SBE
|
Top
|
|
|
|
#76709 - 2003-09-23 09:38 PM
Re: Office 2000 Service packs, etc...
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Perhaps this will work even better...
$officeindex = 0 $officekey = ENUMKEY("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $officeindex) While @Error=0 and $office=0 $product = ReadValue ("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$officekey","DisplayName") If InStr ($product, "Microsoft Office") $uninstallguid = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$officekey" $office = $product Endif $officeindex = $officeindex + 1 $officekey = ENUMKEY("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $officeindex) Loop
$productsindex = 0 $productskey = ENUMKEY("HKLM\Software\Classes\Installer\Products\", $productsindex) While @Error=0 and $MSOProducts=0 $product = ReadValue ("HKLM\Software\Classes\Installer\Products\$productskey","ProductName") If InStr ($product, "Microsoft Office") $MSOProducts = "HKLM\Software\Classes\Installer\Products\$productskey" Endif $productsindex = $productsindex + 1 $productskey = ENUMKEY("HKLM\Software\Classes\Installer\Products\", $productsindex) Loop
? $office ? $uninstallguid ? $MSOProducts get $
[ 24. September 2003, 00:53: Message edited by: CitrixMan ]
|
Top
|
|
|
|
#76710 - 2003-09-24 12:03 AM
Re: Office 2000 Service packs, etc...
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11625
Loc: CA
|
Shane,
Since the products would be multiple you would need to use some type of array to display all of them.
Also using PostPrep for the code would be appreciated (at least by me)
|
Top
|
|
|
|
#76711 - 2003-09-24 12:52 AM
Re: Office 2000 Service packs, etc...
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Not sure what you mean when you say...
quote: Since the products would be multiple you would need to use some type of array to display all of them.
What would be multiple? It should only find one Key that is for Office right? Unless someone has installed more than one version of Office on a PC.
I will try to remember to use the PostPrep from now on.
|
Top
|
|
|
|
#76713 - 2003-09-24 06:50 PM
Re: Office 2000 Service packs, etc...
|
jpg35
Fresh Scripter
Registered: 2003-08-06
Posts: 27
Loc: SoCal
|
quote: Perhaps this will work even better...
--------------------------------------------------------------------------------
$officeindex = 0 $officekey = ENUMKEY("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $officeindex) While @Error=0 and $office=0 $product = ReadValue ("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$officekey","DisplayName") If InStr ($product, "Microsoft Office") $uninstallguid = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$officekey" $office = $product Endif $officeindex = $officeindex + 1 $officekey = ENUMKEY("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $officeindex) Loop
$productsindex = 0 $productskey = ENUMKEY("HKLM\Software\Classes\Installer\Products\", $productsindex) While @Error=0 and $MSOProducts=0 $product = ReadValue ("HKLM\Software\Classes\Installer\Products\$productskey","ProductName") If InStr ($product, "Microsoft Office") $MSOProducts = "HKLM\Software\Classes\Installer\Products\$productskey" Endif $productsindex = $productsindex + 1 $productskey = ENUMKEY("HKLM\Software\Classes\Installer\Products\", $productsindex) Loop
? $office ? $uninstallguid ? $MSOProducts get $Perhaps this will work even better...
--------------------------------------------------------------------------------
$officeindex = 0 $officekey = ENUMKEY("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $officeindex) While @Error=0 and $office=0 $product = ReadValue ("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$officekey","DisplayName") If InStr ($product, "Microsoft Office") $uninstallguid = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\$officekey" $office = $product Endif $officeindex = $officeindex + 1 $officekey = ENUMKEY("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\", $officeindex) Loop
$productsindex = 0 $productskey = ENUMKEY("HKLM\Software\Classes\Installer\Products\", $productsindex) While @Error=0 and $MSOProducts=0 $product = ReadValue ("HKLM\Software\Classes\Installer\Products\$productskey","ProductName") If InStr ($product, "Microsoft Office") $MSOProducts = "HKLM\Software\Classes\Installer\Products\$productskey" Endif $productsindex = $productsindex + 1 $productskey = ENUMKEY("HKLM\Software\Classes\Installer\Products\", $productsindex) Loop
? $office ? $uninstallguid ? $MSOProducts get $
This script works great for 2k, but is there anyway to determine what SP Level for Office XP is?
|
Top
|
|
|
|
#76715 - 2003-09-26 12:16 AM
Re: Office 2000 Service packs, etc...
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
this is the UDF of OfficeProduct()
but it isn't perfect...
code:
break on
? OfficeProduct() ? OfficeProduct('holly') ? OfficeProduct('term-server')
Function OfficeProduct(optional $computer) DIM $index, $err, $office, $product, $officekey, $UninstallKey $UninstallKey = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" if $Computer $UninstallKey = "\\"+$computer+"\"+$UninstallKey EndIf
Do $product = ReadValue($UninstallKey+$officekey,"DisplayName") If InStr($product, "Microsoft Office") $OfficeProduct = $product Endif $officekey = ENUMKEY($UninstallKey, $index) $index = $index + 1 Until @error or $OfficeProduct exit @error EndFunction
;$MSOguid= $UninstallKey+$officekey ;$Version= ReadValue ($UninstallKey+$officekey,"DisplayVersion")
quote:
Microsoft Office Professional Edition 2003 Microsoft Office XP Professional with FrontPage Microsoft Office Personal Portfolio
I need to add a scan for 95,97,2000,xp,2003
|
Top
|
|
|
|
#76716 - 2003-09-25 02:31 PM
Re: Office 2000 Service packs, etc...
|
masken
MM club member
   
Registered: 2000-11-27
Posts: 1222
Loc: Gothenburg, Sweden
|
hmm... perhaps scanning HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall would be a better approach?
Ie; "DisplayName" & "DisplayVersion" ?
Microsoft Visio Microsoft FrontPage Microsoft Office
You'd need to filter it though.. (ie; "Microsoft Office 2000 Resource Kit Tools and Utilities").. hmm..
btw; found some old stuff lying around:
code:
;=== Office Applikationer inkluderade: ;=== Access, Excel, FrontPage, Outlook, PowerPoint, PUblisher, Word ;=== ;=== Distributioner: 2002 (XP) 2000 97 95 ;=== ----------------- ----------------- --------------- ---------- -------- ;=== Premium Spec. Ed. W/E/O/PP/A/F/PU n/a n/a n/a ;=== Developer W/E/O/PP/A/F n/a n/a n/a ;=== Premium n/a A/E/F/O/PP/PU/W n/a n/a ;=== Professional W/E/O/PP/A A/E/O/PP/PU/W A/E/O/PP/W A/E/PP/W ;=== Small Business W/E/O/PU E/O/PU/W E/O/PU/W n/a ;=== Standard W/E/O/PP E/O/PP/W E/O/PP/W E/PP/W ;=== ;=== MS Office versions information från TechNet dokument: ;=== ----------------------------------------------------- ;=== Q248710 (97), Q255275 (2000), Readme.doc w/2000 SR-1 SP2 ;==============================================================================
; TODO: ; Visio32.exe ; Office XP ; MS Project? $CR = CHR(13) + CHR(10) $RC = "" $LogDir = "\\someserver\somedir"
$HKLMAPPS = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths"
; *** Set buckets to numeric zero, blanks, for clean export file entries for systems w/out some apps installed. $OSW2K = VAL("0") $OSWNT = VAL("0") $OSWME = VAL("0") $OSW98 = VAL("0") $OSW95 = VAL("0") $OfcPre = VAL("0") $OfcPro = VAL("0") $OfcBiz = VAL("0") $OfcStd = VAL("0") $OfcNon = VAL("0") $OfcErr = VAL("0") $OfcZer = VAL("0") $Ac = VAL("0") $Ex = VAL("0") $Fp = VAL("0") $Ou = VAL("0") $Pp = VAL("0") $Pu = VAL("0") $Wo = VAL("0") $VerAc = VAL("0") $VerEx = VAL("0") $VerFp = VAL("0") $VerOu = VAL("0") $VerPp = VAL("0") $VerPu = VAL("0") $VerWo = VAL("0") $LvlAc = "" $LvlEx = "" $LvlFp = "" $LvlOu = "" $LvlPp = "" $LvlPu = "" $LvlWo = "" $OfcVer = "0" $ErrCnt = "0" $ErrVer = "0"
; *** Create array and load with MS Office Application executables $x = 0 DIM $RegKey[8] $RegKey[$x] = "msaccess.exe" $x = $x + 1 $RegKey[$x] = "excel.exe" $x = $x + 1 $RegKey[$x] = "frontpg.exe" $x = $x + 1 $RegKey[$x] = "outlook.exe" $x = $x + 1 $RegKey[$x] = "powerpnt.exe" $x = $x + 1 $RegKey[$x] = "mspub.exe" $x = $x + 1 $RegKey[$x] = "winword.exe" $x = $x + 1
$x2 = 0 DO $TmpApp = SUBSTR ($RegKey[$x2], 1, LEN ($RegKey[$x2])) $RC = EXISTKEY ("$HKLMAPPS\$TmpApp") ; *** Check, is this application even in the registry? IF $RC = 0 $TmpDir = READVALUE ("$HKLMAPPS\$TmpApp", "Path") $RC = EXIST ("$TmpDir\$TmpApp") ; *** Check, is this application actually on the system? IF $RC = 1 $TmpVer = GETFILEVERSION ("$TmpDir\$TmpApp") SELECT CASE(SUBSTR ($TmpVer, 1, 1) = "9") $OfcVer = "2000" CASE(SUBSTR ($TmpVer, 1, 1) = "8") $OfcVer = "97" CASE(SUBSTR ($TmpVer, 1, 1) = "7") $OfcVer = "95" CASE((SUBSTR ($TmpVer, 1, 1) = "4") AND ($TmpApp = "frontpg.exe")) $OfcVer = "2000" CASE((SUBSTR ($TmpVer, 1, 1) < "4") AND ($TmpApp = "frontpg.exe")) $OfcVer = "97" CASE((SUBSTR ($TmpVer, 1, 1) = "6") AND ($TmpApp = "mspub.exe")) $OfcVer = "2000" CASE((SUBSTR ($TmpVer, 1, 1) < "6") AND ($TmpApp = "mspub.exe")) $OfcVer = "97" ENDSELECT ; *** Tmp variables to determine versions/build of each application. $TmpLvl = SUBSTR ($TmpVer, 1, 4) ; *** 1st 4 characters of ver (ex: 8.0a) $TmpBld = SUBSTR ($TmpVer, LEN ($TmpVer)-3, LEN ($TmpVer)) ; *** Last 4 characters of ver (build; ex: 4307)
SELECT CASE($TmpApp = "msaccess.exe") SELECT CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "4506")) $LvlAc = "SR-1 SP2" CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "3821")) $LvlAc = "SR-1" CASE(($TmpLvl >= "9.0.") AND ($TmpBld < "3821")) $LvlAc = "" CASE(($TmpLvl >= "8.0.") AND ($TmpBld >= "5903")) $LvlAc = "SR-2" CASE(($TmpLvl >= "8.0.") AND ($TmpBld >= "4122")) $LvlAc = "SR-1" CASE(1) $LvlAc = "" ENDSELECT $Ac = VAL("1") $VerAc = $TmpVer CASE($TmpApp = "excel.exe") SELECT CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "4430")) $LvlEx = "SR-1 SP2" CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "3821")) $LvlEx = "SR-1" CASE(($TmpLvl >= "9.0.") AND ($TmpBld < "3821")) $LvlEx = "" CASE(($TmpLvl >= "8.0e") AND ($TmpLvl < "8.0z")) $LvlEx = "SR-2" CASE(($TmpLvl >= "8.0a") AND ($TmpLvl < "8.0e")) $LvlEx = "SR-1" CASE(1) $LvlEx = "" ENDSELECT $Ex = VAL("1") $VerEx = $TmpVer CASE($TmpApp = "frontpg.exe") SELECT CASE(($TmpLvl >= "4.0.") AND ($TmpBld >= "4426")) $LvlFp = "SR-1 SP2" CASE(($TmpLvl >= "4.0.") AND ($TmpBld >= "3821")) $LvlFp = "SR-1" CASE(($TmpLvl >= "4.0.") AND ($TmpBld >= "2720")) $LvlFp = "" CASE(1) $LvlFp = "" ENDSELECT $Fp = VAL("1") $VerFp = $TmpVer CASE($TmpApp = "outlook.exe") SELECT CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "3821")) $LvlOu = "SR-1" CASE(($TmpLvl >= "9.0.") AND ($TmpBld < "3821")) $LvlOu = "" CASE(($TmpLvl >= "8.0.") AND ($TmpBld >= "5305")) $LvlOu = "SR-2" ; *** Outlook 98 CASE(($TmpLvl >= "8.0.") AND ($TmpBld >= "5104")) $LvlOu = "SR-1" CASE(($TmpLvl >= "8.04") AND ($TmpBld >= "5619")) $LvlOu = "SR-2" ; *** Outlook 97 CASE(($TmpLvl >= "8.02") AND ($TmpBld >= "4212")) $LvlOu = "SR-1" CASE(1) $LvlOu = "" ENDSELECT $Ou = VAL("1") $VerOu = $TmpVer CASE($TmpApp = "powerpnt.exe") SELECT CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "4527")) $LvlPp = "SR-1 SP2" CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "3821")) $LvlPp = "SR-1" CASE(($TmpLvl >= "9.0.") AND ($TmpBld < "3821")) $LvlPp = "" CASE(($TmpLvl >= "8.0b") AND ($TmpBld >= "5507")) $LvlPp = "SR-2" CASE(($TmpLvl < "8.0b") AND ($TmpBld >= "4208")) $LvlPp = "SR-1" CASE(1) $LvlPp = "" ENDSELECT $Pp = VAL("1") $VerPp = $TmpVer CASE($TmpApp = "mspub.exe") SELECT CASE($TmpLvl = "5.0.") $LvlPu = "98" CASE($TmpLvl = "4.0.") $LvlPu = "97" CASE(1) $LvlPu = "" ENDSELECT $Pu = VAL("1") $VerPu = $TmpVer CASE($TmpApp = "winword.exe") SELECT CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "4527")) $LvlWo = "SR-1 SP2" CASE(($TmpLvl >= "9.0.") AND ($TmpBld >= "3821")) $LvlWo = "SR-1" CASE(($TmpLvl >= "9.0.") AND ($TmpBld < "3821")) $LvlWo = "" CASE(($TmpLvl >= "8.0b") AND ($TmpBld >= "5622")) $LvlWo = "SR-2" CASE(($TmpLvl >= "8.0b") AND ($TmpBld >= "4412")) $LvlWo = "SR-1" CASE(1) $LvlWo = "" ENDSELECT $Wo = VAL("1") $VerWo = $TmpVer ENDSELECT ENDIF ENDIF ; *** Set check value, by 1st app counted, to flag if diff versions of suite components (ex: Word 2000 & Access 97) SELECT CASE(($ErrCnt = "1") AND ($ErrVer = $OfcVer)) $VerErr = "0" CASE(($ErrCnt = "1") AND ($ErrVer <> $OfcVer)) $VerErr = "1" CASE($OfcVer <> "0") $ErrVer = $OfcVer $ErrCnt = "1" CASE($OfcVer = "0") ; *** Do nothing until a version found. ENDSELECT $x2 = $x2 + 1 UNTIL $x2 = $x
; *** Numeric value to tell us how many Office applications of the suite actually installed. $AppCnt = ($Ex + $Fp + $Ac + $Pu + $Ou + $Pp + $Wo) IF $AppCnt = "0" ; *** No office apps installed $OfcVer = "NoApps" $OfcAbv = "NoOfc" ENDIF ; *** Based upon count of apps installed, assign Suite value. With common apps, must weed through non-common first. SELECT CASE($OfcVer = "2000") SELECT CASE($AppCnt = "7") ; *** Only Premium would have all components $OfcAbv = "Pre" CASE(($AppCnt >= "5") AND ($Fp = "1")) ; *** Only Premium would have FrontPage $OfcAbv = "Pre" CASE(($AppCnt >= "5") AND ($Fp <> "1")) ; *** No FrontPage, so likely Professional $OfcAbv = "Pro" CASE(($AppCnt >= "3") AND ($Ac = "1")) ; *** Access not in Standard or Small Business $OfcAbv = "Pro" CASE(($AppCnt >= "3") AND ($Pu = "1")) ; *** Publisher not in Standard $OfcAbv = "Biz" CASE(($AppCnt >= "3") AND ($Pp = "1")) ; *** PowerPoint not in Small Business $OfcAbv = "Std" CASE($AppCnt = "3") ; *** All common apps, likely Standard $OfcAbv = "Std" CASE($AppCnt < "3") ; *** Too few apps to determine if really Suite $OfcAbv = "Non" CASE($AppCnt > "7") ; *** Too many apps counted. Really Office 2000? $OfcAbv = "Err" GOSUB ScriptError ENDSELECT $O2KPID = "" $O2KKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\9.0\Registration\ProductID" $O2KEntry = ENUMVALUE("$O2KKey", 0) $O2KPID = READVALUE("$O2KKey", "$O2KEntry") IF $O2KPID = "" $O2KPID = "Err" ENDIF CASE($OfcVer = "97") SELECT CASE($AppCnt = "5") ; *** Only Professional would have all components $OfcAbv = "Pro" CASE(($AppCnt >= "3") AND ($Ac = "1")) ; *** Only Professional would have Access $OfcAbv = "Pro" CASE(($AppCnt >= "3") AND ($Pu = "1")) ; *** Publisher not in Standard $OfcAbv = "Biz" CASE(($AppCnt >= "3") AND ($Pp = "1")) ; *** PowerPoint not in Small Business $OfcAbv = "Std" CASE($AppCnt = "3") ; *** All common components, likely Standard $OfcAbv = "Std" CASE($AppCnt < "3") ; *** Too few apps to determine if really Suite $OfcAbv = "Non" CASE($AppCnt > "5") ; *** Too many apps counted. Really Office 97? $OfcAbv = "Err" GOSUB ScriptError ENDSELECT SELECT CASE(EXISTKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Office 97") = 0) $O97Key = "HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Office 97" $KeySub = ENUMKEY("$O97Key", 0) IF @ERROR = 0 $Key = $O97Key + "\" + $KeySub + "\Registration" IF EXISTKEY("$Key") = 0 $O97PID = READVALUE("$Key", "ProductID") $O97PName = READVALUE("$Key", "ProductName") ELSE $O97PID = "Err" $O97PName = "Err" ENDIF ELSE $O97PID = "Err" $O97PName = "Err" ENDIF CASE(EXISTKEY("HKEY_LOCAL_MACHINE\Software\Microsoft\MS Office 97 Professional") = 0) $O97Key = "HKEY_LOCAL_MACHINE\Software\Microsoft\MS Office 97 Professional" $KeySub = ENUMKEY("$O97Key", 0) IF @ERROR = 0 $Key = $O97Key + "\" + $KeySub + "\Registration" IF EXISTKEY("$Key") = 0 $O97PID = READVALUE("$Key", "ProductID") $O97PName = READVALUE("$Key", "ProductName") ELSE $O97PID = "Err" $O97PName = "Err" ENDIF ELSE $O97PID = "Err" $O97PName = "Err" ENDIF CASE 1 ; *** Standalone installation/s $O97App = "HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Outlook" IF EXISTKEY("$O97App") = 0 $OuID = "" $OuName = "" $KeySub = ENUMKEY("$O97App", 0) IF @ERROR = 0 $Key = $O97App + "\" + $KeySub + "\Registration" IF EXISTKEY("$Key") = 0 $OuID = READVALUE("$Key", "ProductID") $OuName = READVALUE("$Key", "ProductName") ENDIF ENDIF IF $OuID = "" $OuID = "Err" ENDIF IF $OuName = "" $OuName = "Err" ENDIF ENDIF $O97App = "HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Word för Windows" IF EXISTKEY("$O97App") = 0 $WoID = "" $WoName = "" $KeySub = ENUMKEY("$O97App", 0) IF @ERROR = 0 $Key = $O97App + "\" + $KeySub + "\Registration" IF EXISTKEY("$Key") = 0 $WoID = READVALUE("$Key", "ProductID") $WoName = READVALUE("$Key", "ProductName") ENDIF ENDIF IF $WoID = "" $WoID = "Err" ENDIF IF $WoName = "" $WoName = "Err" ENDIF ENDIF $O97App = "HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft Excel 97" IF EXISTKEY("$O97App") = 0 $ExID = "" $ExName = "" $KeySub = ENUMKEY("$O97App", 0) IF @ERROR = 0 $Key = $O97App + "\" + $KeySub + "\Registration" IF EXISTKEY("$Key") = 0 $ExID = READVALUE("$Key", "ProductID") $ExName = READVALUE("$Key", "ProductName") ENDIF ENDIF IF $ExID = "" $ExID = "Err" ENDIF IF $ExName = "" $ExName = "Err" ENDIF ENDIF ENDSELECT CASE($OfcVer = "95") SELECT CASE($AppCnt = "4") ; *** Only Professional would have all components $OfcAbv = "Pro" CASE(($AppCnt >= "3") AND ($Ac = "1")) ; *** Only Professional would have Access $OfcAbv = "Pro" CASE(($AppCnt >= "3") AND ($Ac <> "1")) ; *** Access not in Standard $OfcAbv = "Std" CASE($AppCnt < "3") ; *** Too few apps to determine if really Suite $OfcAbv = "Non" CASE($AppCnt > "4") ; *** Too many apps counted. Really Office 95? $OfcAbv = "Err" GOSUB ScriptError ENDSELECT ENDSELECT
; *** Preps numeric values of apps for pipe-delimited file for Excel importation. SELECT CASE($OfcAbv = "Pre") $OfcPre = "1" $OfcNam = "Premium" CASE($OfcAbv = "Pro") $OfcPro = "1" $OfcNam = "Professional" CASE($OfcAbv = "Biz") $OfcBiz = "1" $OfcNam = "Small Business" CASE($OfcAbv = "Std") $OfcStd = "1" $OfcNam = "Standard" CASE($OfcAbv = "Non") $OfcNon = "1" $OfcNam = "Not a Suite" CASE($OfcAbv = "Err") $OfcErr = "1" $OfcNam = "Error in inventory, last ver. $OfcVer" CASE($OfcAbv = "NoOfc") $OfcZer = "1" $OfcNam = "No apps installed" ENDSELECT
; *** Preps numeric values of O/S for pipe-delimited file for Excel importation. SELECT CASE(INSTR("$OS", "2000") <> 0) $OSW2K = "1" CASE(INSTR("$OS", "WinNT") <> 0) $OSWNT = "1" CASE(INSTR("$OS", "ME") <> 0) $OSWME = "1" CASE(INSTR("$OS", "98") <> 0) $OSW98 = "1" CASE(INSTR("$OS", "95") <> 0) $OSW95 = "1" ENDSELECT
; *** File name based upon version-error condition SELECT CASE($VerErr = "0") $OfcFil = $OfcVer + $OfcAbv CASE($VerErr = "1") $OfcFil = "VerErr" ENDSELECT SELECT CASE($OfcZer = "0") $OfcSte = "Office $OfcVer $OfcNam" CASE($OfcZer = "1") $OfcSte = "No Apps Installed" $OfcFil = $OfcVer ENDSELECT
; *** Null those values that hasn't been assigned. IF $WoID = "" $WoID = 0 ENDIF IF $WoName = "" $WoName = 0 ENDIF IF $ExID = "" $ExID = 0 ENDIF IF $ExName = "" $ExName = 0 ENDIF IF $OuID = "" $OuID = 0 ENDIF IF $OuName = "" $OuName = 0 ENDIF IF $O97PName = "" $O97PName = 0 ENDIF IF $O97PID = "" $O97PID = 0 ENDIF IF $O2KPID = "" $O2KPID = 0 ENDIF
; *** Write log file: Inventory date, logon domain, user id, wksta name, o/s ver & type, Office Suite count, indivdual app count, versions of each app. $OfcSte = "Office $OfcVer $OfcNam" $Log = "$LogDir\@WKSTA_$OfcFil.txt" $Console = OPEN (4, $Log, 5) ; KolumnID behöver ej sparas i varje fil. $Console = WRITELINE (4, "@DATE,@WKSTA,@USERID,$Region,$OSW2K,$OSWNT,$OSWME,$OSW98,$OSW95,$OS,$OfcSte,$O2KPID,$OfcPre,$OfcPro,$OfcBiz,$OfcStd" + ",$OfcNon,$OfcErr,$O97PID,$O97PName,$Ac,$Ex,$ExID,$ExName,$Fp,$Ou,$OuID,$OuName,$Pp,$Pu,$Wo,$WoID,$WoName,$VerAc," + "$LvlAc,$VerEx,$LvlEx,$VerFp,$LvlFp,$VerOu,$LvlOu,$VerPp,$LvlPp,$VerPu,$LvlPu,$VerWo,$LvlWo" + $CR) $Console = CLOSE (4) RETURN
[ 26. September 2003, 17:45: Message edited by: masken ]
_________________________
The tart is out there
|
Top
|
|
|
|
#76717 - 2003-09-26 12:08 AM
Re: Office 2000 Service packs, etc...
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Hate to be beating a dead horse...Wait...No I don't...Die horse die...
Anyways...
I added some code to get the other GUID needed to install updates as well.
Unfortunately I'm not too experienced when it comes to writing functions...Is there any way to return multiple values without using an array?
code:
Break On
For Each $officedata in OfficeProduct() ? $officedata Next
get $
FUNCTION OfficeProduct(optional $computer) DIM $index, $err, $office, $product, $officekey, $UninstallKey, $InstallerKey $UninstallKey = "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\" $InstallerKey = "HKLM\Software\Classes\Installer\Products\" If $Computer $UninstallKey = "\\"+$computer+"\"+$UninstallKey $InstallerKey = "\\"+$computer+"\"+$InstallerKey EndIf Do $product = ReadValue($UninstallKey+$officekey,"DisplayName") If InStr($product, "Microsoft Office") $MSOguid = $UninstallKey+$officekey $InstallerGUID = SubStr($MSOguid, InStr ($MSOguid, "{")+1, Len ($MSOguid)-1) For $x=1 to Len("$InstallerGUID") $null = execute ("$$c$x = SubStr($$InstallerGUID, $x, 1)") Next $InstallerGUID = $InstallerKey+$c8+$c7+$c6+$c5+$c4+$c3+$c2+$c1+$c13+$c12+$c11+$c10+$c18+$c17+$c16+$c15+$c21+$c20+$c23+$c22+$c26+$c25+$c28+$c27+$c30+$c29+$c32+$c31+$c34+$c33+$c36+$c35 $Version = ReadValue ($UninstallKey+$officekey,"DisplayVersion") $OfficeProduct = $product,$version,$msoguid,$installerguid Endif $officekey = ENUMKEY($UninstallKey, $index) $index = $index + 1 Until @error or $officeproduct[0] Exit @error ENDFUNCTION
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1574 anonymous users online.
|
|
|