#64949 - 2002-04-26 06:56 PM
O2K SR-2 Install Depending on Current Version of Winword
|
Lori Paull
Fresh Scripter
Registered: 2002-01-29
Posts: 5
Loc: Butte, MT
|
I have not done a lot of complicated scripting, so please be patient! I am trying to install Office 2000 SR-2 on workstations that are currently at the SP1 level. I have looked at various examples and seem to have tried them all, but they will not work. I am basing my install on the current version of the winword.exe file -- if it's not 9.0.0.4527. Below is the code I am using in my subroutine. The actual installation of the SR2 works fine, but it wants to install it no matter what. ==================================================
code:
:O2K_SR2 $currentfilever = "9.0.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","Path") IF getfileversion($winpath,"FileVersion") < $currentfilever GOSUB ASSIGN_UTILITY_DRIVE MESSAGEBOX("Please be patient. This process takes a minute to display its progress, and may take up to 15 minutes to install. Please do not open any applications until the installation is complete and your machine restarts. Click OK to continue.","Installing Office 2000 SR-2",16,0) CLS Run "U:\Upgrades\SP2\sp2upd.exe /q" Exit 0 Endif Return
==================================================
Thanks for any help you can give me, and as soon as possible. I'm about at my wits end! [ 26 April 2002, 19:04: Message edited by: Lori Paull ]
|
Top
|
|
|
|
#64950 - 2002-04-26 09:29 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
I think I see your problem.
Try this:
code:
:O2K_SR2$ currentfilever = "9.0.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","") IF getfileversion($winpath,"FileVersion") < $currentfilever GOSUB ASSIGN_UTILITY_DRIVE MESSAGEBOX("Please be patient. This process takes a minute to display its progress, and may take up to 15 minutes to install. Please do not open any applications until the installation is complete and your machine restarts. Click OK to continue.","Installing Office 2000 SR-2",16,0) CLS Run "U:\Upgrades\SP2\sp2upd.exe /q" Exit 0 EndifReturn
I noticed that the value you're reading from the registry returns the path of winword without winword.exe appended. So, you aren't getting the version of winword.exe. If you use the (default) value (by using "" instead of "path"), you will get the full path including the winword.exe.
Brian
|
Top
|
|
|
|
#64951 - 2002-04-27 03:36 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Lori,
It is great that you are upgrading your client to SP-2 of Office 2k. However, you know there are issues with attachments in e-mail (Outlook), right?
I know that has been addressed in 2002. I have heard that there are some tweaks to get around this.
HTH,
- Kent
|
Top
|
|
|
|
#64952 - 2002-04-30 01:40 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Lori Paull
Fresh Scripter
Registered: 2002-01-29
Posts: 5
Loc: Butte, MT
|
Thanks to you both for your help and comments. Brian, I tried what you suggested, but it still is not working. When I watch it, it acts as if it's not even checking the version -- I would expect to see a little hesitation of the script when it should be checking the version and I don't. Any other ideas?
Kent, thanks for the information. We are aware of the e-mail attachments "problem."
I'm really baffled as to why this is not working.
Please help in any way you or anyone else can.
Thanks!
|
Top
|
|
|
|
#64953 - 2002-04-30 01:52 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
You can also look into the UpdateApps UDF for a convenient log and wrapper for installs.
Instead of comparing file versions, look into the uninstall keys and the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\LocalPackages HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Products
keys to determine if the package was installed [ 30 April 2002, 01:52: Message edited by: Radimus ]
|
Top
|
|
|
|
#64954 - 2002-04-30 01:58 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
also, I believe the app exe versions don't use the "9.0.0.4527" ... try "9.0.4527"
In either case, the most common issue here is also that while the value appears to be a number, it is actually a string, and will be evaluated as one. Try using instr or = to positively ID the version value
|
Top
|
|
|
|
#64956 - 2002-04-30 02:14 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Lori,
Can you try the following?
code:
:O2K_SR2$ currentfilever = "9.0.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","") IF getfileversion($winpath,"FileVersion") < $currentfilever ? "Word Version is " + $winpath SLEEP 3 GOSUB ASSIGN_UTILITY_DRIVE MESSAGEBOX("Please be patient. This process takes a minute to display its progress, and may take up to 15 minutes to install. Please do not open any applications until the installation is complete and your machine restarts. Click OK to continue.","Installing Office 2000 SR-2",16,0) CLS Run "U:\Upgrades\SP2\sp2upd.exe /q" Exit 0 Endif Return
Dean R - In SP-2 of Outlook 2000, if a user tries to send a "potentially dangerous" attachment like a XLS, MDB, EXE file.. It is blocked by Outlook. From an IT standpoint, it is great.. However, from a user's perspective, it is a pain..
Thanks!
- Kent [ 30 April 2002, 16:36: Message edited by: kdyer ]
|
Top
|
|
|
|
#64957 - 2002-04-30 08:48 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Hey Kent..
Typo in your script! (I don't feel so bad.. i'm not the only one! lol)..
Second line should be?
code:
$currentfilever = "9.0.0.4527"
Brian
|
Top
|
|
|
|
#64958 - 2002-04-30 08:58 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
Doh.. I think you copied MY error in my post.. sorry Kent!
Ok.. let's try this again:
code:
:O2K_SR2 $currentfilever = "9.0.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","") IF getfileversion($winpath,"FileVersion") < $currentfilever GOSUB ASSIGN_UTILITY_DRIVE MESSAGEBOX("Please be patient. This process takes a minute to display its progress, and may take up to 15 minutes to install. Please do not open any applications until the installation is complete and your machine restarts. Click OK to continue.","Installing Office 2000 SR-2",16,0) CLS Run "U:\Upgrades\SP2\sp2upd.exe /q" Exit 0 Endif Return
If this doesn't work, try running a script from the command line that looks something like this:
code:
$currentfilever = "9.0.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","") ? "The winword.exe path from the registry is: " + $winpath ? "Current file version is: " + $currentfilever $fileversion = getfileversion ($winpath,"FileVersion") If $fileversion < $currentfilever ? $fileversion + " is less than " + $currentfilever else ? $fileversion + " is not less than " + $currentfilever Endif
See what this comes out with.. it should tell you where you're going wrong.
Brian
|
Top
|
|
|
|
#64959 - 2002-05-02 01:38 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Lori Paull
Fresh Scripter
Registered: 2002-01-29
Posts: 5
Loc: Butte, MT
|
O.K. It seems the problem is that KIX (or something) can't tell if the version is less than, greater than, or equal to. I tried the last suggestion of running a batch file that showed me the version, and if it was less than (or whatever). I expanded on this and tried less than, greater than, equal to, and they all came back and said not less than, not greater than, not equal to . I tried putting <> rather than < or =, but that didn't work. I also tried grabbing the product version rather than file, but came up with the same result. Any other ideas? I also tried the suggestion about the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\LocalPackages HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Products keys, but couldn't see anything to go with on these.
|
Top
|
|
|
|
#64961 - 2002-05-02 03:39 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Lori,
Made a change to the script..
Put "" around the Word path. Added in a VAL() statement around the $fileversion and $currentfilever (even though it appeared unecessary).
code:
break on cls $currentfilever = "9.0.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","") ? "The winword.exe path from the registry is: " + $winpath ? "Up-to-date file version is: " + $currentfilever $fileversion = getfileversion ("$winpath","FileVersion") ? "Version found is: " + $fileversion If val($fileversion) < val($currentfilever) ? $fileversion + " is less than " + $currentfilever else ? $fileversion + " is greater than " + $currentfilever Endif
If I run this, I get: quote:
The winword.exe path from the registry is: C:\PROGRA~1\MICROS~1\OFFICE\WINWORD.EXE Up-to-date file version is: 9.0.0.4527 Version found is: 9.0.3822 9.0.3822 is greater than 9.0.0.4527
Can you post your results? Or, where it stops?
BTW, what version of Kixtart are you running with this?
Thanks!
- Kent [ 02 May 2002, 03:41: Message edited by: kdyer ]
|
Top
|
|
|
|
#64962 - 2002-05-02 04:19 AM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
the next simplest method is to use left() to determine 97, 2000, or XP and then use right() to pull the last 4 to determine build....
if everyone is 2000 then you could skip the left()
|
Top
|
|
|
|
#64964 - 2002-05-02 03:30 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
here is some old code I was using... before I got tired of trying to keep up with office patches...
code:
; ****************************** MSOffice version ***************************************** $MSOdir=readvalue("$HKLMSMWCV\App Paths\excel.exe","Path") if exist("$MSOdir\excel.exe") $excel=getfileversion("$MSOdir\excel.exe") select case $excel=8.0a $esr="97 SR-1" case $excel=8.0e $esr="97 SR-2" case $excel=9.0.2719 $esr="2000" case $excel=9.0.3822 $esr="2000 SR-1a" case $excel=9.0.4430 $esr="2000 SR-2" endselect ? " Installed "color c+/n"MS Office "color w/n"is version " color w+/n "$esr" color w/n endif if exist("$MSOdir\msaccess.exe") $access=getfileversion("$MSOdir\msaccess.exe") select case $access=8.0.3512 $asr="97 SR-0" case $access=8.0.4122 $asr="97 SR-1" case $access=8.0.5903 $asr="97 SR-2" case $access=9.0. $asr="2000" case $access=9.0.3822 $asr="2000 SR-1a" case $access=9.0.4506 $asr="2000 SR-2" endselect ? " Installed "color c+/n"MS Access " color w/n"is version "color w+/n $asr color w/n endif if exist("$MSOdir\mspub.exe") $pub=getfileversion("$MSOdir\mspub.exe") select case $pub=4.0 $psr="97" case $pub=5.0 $psr="98" case $pub=6.0 $psr="2000" endselect ? " Installed "color c+/n"MS Publisher " color w/n"is version "color w+/n $psr color w/n endif
|
Top
|
|
|
|
#64965 - 2002-05-02 03:44 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
I think if you look at winword.exe for SP2 and get a file version from it you will find the version to be: "9.0.4527" and not "9.0.0.4527". I looked at the properties on mine (sp1.. i don't like the email security crapola) it says "9.0.0.5302" in the header but if you look under the property "FileVersion" it actually is defined as "9.0.5302".. I would guess that this will work the same with SP2. If it's installing every single time (whether installed or not), then I would assume this is your problem. Once the file version matches what you're actually uses on SP2, it should work. However, you can use a <> instead of just a < for your operation.
Brian
|
Top
|
|
|
|
#64966 - 2002-05-02 05:35 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Lori Paull
Fresh Scripter
Registered: 2002-01-29
Posts: 5
Loc: Butte, MT
|
I changed the code as suggested to inlcude the VAL() statement, and I get the same results as you. winword.exe path from the registry is: C:\PROGRA~1\MICROS~2\Office\WINWORD.EXE Up-to-date file version is 9.0.0.4527 Version found is 9.0.3822 9.0.3822 is greater than 9.0.0.4527
What confuses me about this is if I go to Explorer and the properties, then the version tab, the Version number shows 9.0.0.3822. In the additional properties in that window the product version is what displays 9.0.3822. Also, if 9.0.3822 is greater than 9.0.0.4527, I would think that replacing the < with the > would take care of the problem, but that isn't the case.
The KIX version is 3.62.0.0.
|
Top
|
|
|
|
#64967 - 2002-05-02 05:49 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
BrianTX
Korg Regular
Registered: 2002-04-01
Posts: 895
|
To elaborate on my previous post, try this code:
code:
:O2K_SR2 $currentfilever = "9.0.4527" $winpath = readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\winword.exe","") IF getfileversion($winpath,"FileVersion") <> $currentfilever GOSUB ASSIGN_UTILITY_DRIVE MESSAGEBOX("Please be patient. This process takes a minute to display its progress, and may take up to 15 minutes to install. Please do not open any applications until the installation is complete and your machine restarts. Click OK to continue.","Installing Office 2000 SR-2",16,0) CLS Run "U:\Upgrades\SP2\sp2upd.exe /q" Exit 0 Endif Return
Notice that I changed $currentfilever to "9.0.4527" and "Path" to "" and < to <>.
Brian [ 02 May 2002, 17:51: Message edited by: BrianTX ]
|
Top
|
|
|
|
#64968 - 2002-05-02 11:15 PM
Re: O2K SR-2 Install Depending on Current Version of Winword
|
Kdyer
KiX Supporter
   
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Brian,
I can see an issue with that logic.. If it is not (<>) the prescribed version whether it is less or greater, you are going to run the update anyway?
Hmmm..
- Kent
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 581 anonymous users online.
|
|
|