Page 1 of 2 12>
Topic Options
#64949 - 2002-04-26 06:56 PM O2K SR-2 Install Depending on Current Version of Winword
Lori Paull Offline
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 Offline
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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#64952 - 2002-04-30 01:40 AM Re: O2K SR-2 Install Depending on Current Version of Winword
Lori Paull Offline
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 Offline
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 ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#64954 - 2002-04-30 01:58 AM Re: O2K SR-2 Install Depending on Current Version of Winword
Radimus Moderator Offline
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
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#64955 - 2002-04-30 01:13 PM Re: O2K SR-2 Install Depending on Current Version of Winword
Dean R Offline
Starting to like KiXtart

Registered: 2002-03-15
Posts: 115
Loc: Ireland, but Im an Aussie
Email attachments problem?
Are we talking about
Outlook has blocked access to the potentially blah blah blah, problem or is there one I missed?

Hmm, onwards to technet

[Big Grin]
_________________________
-------------------------------- When you can take this stone from my hand Gwasshoppa you are read... *yoink* Gwasshoppa? Gwasshoppa? Where did you go? ---------------------------------

Top
#64956 - 2002-04-30 02:14 PM Re: O2K SR-2 Install Depending on Current Version of Winword
Kdyer Offline
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 ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#64957 - 2002-04-30 08:48 PM Re: O2K SR-2 Install Depending on Current Version of Winword
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Hey Kent..

Typo in your script! [Smile] (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 Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Doh.. I think you copied MY error in my post.. sorry Kent! [Smile]

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 Offline
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
#64960 - 2002-05-02 02:14 AM Re: O2K SR-2 Install Depending on Current Version of Winword
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Running Brians latest offering on my system, returns the following:

Current file version is: 9.0.0.4527
9.0.3822 is not less than 9.0.0.4527

Obviously you're not comparing apples to apples. They do not have the same number of characters. Since it's not a 'value' compare but rather is a 'string' compare, hence the result.

What's wrong with checking for an exact match? Is there a chaance there's a newer version out there? If there is, I suggest you list all known variants in SELECT CASE statements.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#64961 - 2002-05-02 03:39 AM Re: O2K SR-2 Install Depending on Current Version of Winword
Kdyer Offline
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 ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#64962 - 2002-05-02 04:19 AM Re: O2K SR-2 Install Depending on Current Version of Winword
Radimus Moderator Offline
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()
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#64963 - 2002-05-02 03:22 PM Re: O2K SR-2 Install Depending on Current Version of Winword
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Take a look at this UDF:
http://www.scriptlogic.com/kixtart/ViewFunction.asp?FN=VersionCompare
_________________________
There are two types of vessels, submarines and targets.

Top
#64964 - 2002-05-02 03:30 PM Re: O2K SR-2 Install Depending on Current Version of Winword
Radimus Moderator Offline
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

_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#64965 - 2002-05-02 03:44 PM Re: O2K SR-2 Install Depending on Current Version of Winword
BrianTX Offline
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 Offline
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 Offline
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 Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
Page 1 of 2 12>


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 581 anonymous users online.
Newest Members
Audio, Hoschi, Comet, rrosell, PatrickPinto
17880 Registered Users

Generated in 0.101 seconds in which 0.056 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org