Page 1 of 1 1
Topic Options
#147131 - 2005-09-06 04:06 AM GetFileVersion returning null
daniel1982 Offline
Getting the hang of it

Registered: 2005-03-23
Posts: 77
Loc: Sydney, Australia
Hi All,

any ideas why GetFileVersion is returning nothing in the following piece of code? (The install path exists)

Cheers,
Daniel
Code:

Case KeyExist("HKEY_LOCAL_MACHINE\Software\Adobe\Acrobat Elements\6.0
\InstallPath") = 1

$InstallPath = ReadValue("HKEY_LOCAL_MACHINE\Software\Adobe\Acrobat
Elements\6.0\InstallPath", "")
If @ERROR = 0 AND Exist($InstallPath + "\Acrobat Elements.exe") = 1
If Exist($InstallPath + "\Acrobat Elements.exe") = 1
MessageBox("exists: " +GetFileVersion($InstallPath
+ "\Acrobat Elements.exe") , "Ds", 32)
EndIf
$AcrobatElementsVersion = GetFileVersion($InstallPath + "\Acrobat Elements.exe")
EndIf




Edited by daniel1982 (2005-09-06 04:07 AM)

Top
#147132 - 2005-09-06 04:22 AM Re: GetFileVersion returning null
daniel1982 Offline
Getting the hang of it

Registered: 2005-03-23
Posts: 77
Loc: Sydney, Australia
I just checked @error, and it returns 1813, "The specified resource type cannot be found in the image file."

I'm not sure what this means though?

Top
#147133 - 2005-09-06 04:51 AM Re: GetFileVersion returning null
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Right-click on the executable and check whether it even has a file version number.
_________________________
There are two types of vessels, submarines and targets.

Top
#147134 - 2005-09-06 05:13 AM Re: GetFileVersion returning null
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Try using FSO.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#147135 - 2005-09-06 05:55 AM Re: GetFileVersion returning null
daniel1982 Offline
Getting the hang of it

Registered: 2005-03-23
Posts: 77
Loc: Sydney, Australia
I've checked and it does have a file version number (6.0.0.53).

Les, I'm doing the following to (try) and use FSO:

Code:
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
$test = objFSO.GetFileVersion($InstallPath + "\Acrobat Elements.exe")



However i'm getting an IDispatch pointer runtime error on the line where I assign the version number to $Test....

Is this the correct way to do it?

Top
#147136 - 2005-09-06 06:28 AM Re: GetFileVersion returning null
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
LOL
Your VBer roots are showing.

$objFSO = CreateObject("Scripting.FileSystemObject")
$test = $objFSO.GetFileVersion($InstallPath + "\Acrobat Elements.exe")

Are you sure you are reading the path correctly out of the reg and that it does not already have a trailing hack?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#147137 - 2005-09-06 06:48 AM Re: GetFileVersion returning null
daniel1982 Offline
Getting the hang of it

Registered: 2005-03-23
Posts: 77
Loc: Sydney, Australia
Thanks Les,

FSO is getting the version out correctly!

I've even tried hard coding the path with the KiX GetFilVersion function, but it still isn't working...

I'm happy to use FSO, although it would be preferable for me to use KiX, does anyone have any ideas why it's not working?

Top
#147138 - 2005-09-06 04:31 PM Re: GetFileVersion returning null
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Not sure, but some of the KiX functions fall down if the file is in use. Try the 4.51 beta release which tries to address at least some of the issues. If you are sure that you coded it right and that the 4.51 beta does not work, post your issue to the beta section.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1452 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.064 seconds in which 0.032 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