View previous topic :: View next topic |
Author |
Message |
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sat Feb 10, 2007 2:10 am Post subject: @VERINFO() issue |
|
|
I don't know if I would call this a bug or not but here goes...
I just recently came across an issue while checking the currently installed version of QuicktimePlayer.exe...
In the file properties dialog (Version Tab) at the top it displays 7.1.3.191 however if you click on the File Version attribute in the box below it shows 7.1.3 The correct version 7.1.3.191 as is displayed at the top. Now I realize that this is the fault of whoever updated the file but this doesn't solve my problem.
In VDS the @VERINFO() function returns 7.1.3
In VB the GetFileVersion() function returns 7.1.3.191
My problem is that I need to get the same info from VDS as VB.
I'm sure I can probably use the GadgetX extension but I'm using shared code so I'm trying to keep it simple.
Any ideas PLEASE!!!
Aslan
Last edited by Aslan on Sat Feb 10, 2007 3:39 am; edited 1 time in total |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Feb 10, 2007 2:17 am Post subject: |
|
|
Aslan,
There are 2 distinc fields for version numbers. 1 is a DWORD value and the other is a string value type. Not sure which one you need but VDS 5 can get either or both...
Code: |
%%version = @verinfo(<somefile>,V)
%%productversion = @verinfo(<somefile>,X)
|
I hope this helps...
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sat Feb 10, 2007 3:28 am Post subject: |
|
|
Unfortunately the file in question only shows 7.1.3 for the Product Version
Here's a pic of what I'm talking about
Description: |
|
Filesize: |
102.69 KB |
Viewed: |
1864 Time(s) |
|
Description: |
|
Filesize: |
102.29 KB |
Viewed: |
1847 Time(s) |
|
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Feb 10, 2007 5:11 pm Post subject: |
|
|
Aslan,
Below is how you would get the File Version the same way that VB or VB script gets this information. The code below uses GadgetX
Code: |
#-----------------------------------------------------------------------------#
# #
# Shows how to use the VB Script FileSystemObject to collect the Version #
# of a file #
# #
# Author: Johnny Kinsey #
# #
# Copyright: Copyright © 2007 Dragon Sphere Software #
# #
#-----------------------------------------------------------------------------#
#-----------------------------------------------------------------------------#
#Option Explicit #
#Dim oFSO #
#Dim sPath, sFileVer, sFileName #
# #
#sPath = "d:\app\quicktime\quicktimeplayer.exe" #
#Set oFSO = CreateObject("Scripting.FileSystemObject") #
# #
#sFileVer = oFSO.GetFileVersion(sPath) #
#sFileName = oFSO.GetFileName(sPath) #
# #
#Wscript.Echo sFileName & " " & sFileVer #
#Set oFSO = Nothing #
# #
#-----------------------------------------------------------------------------#
Title File Version
External gadgetx.dll,@SysInfo(DSVER)
If @Greater(@Name(@SYSINFO(DSVER)),4)
#DEFINE COMMAND,GADGETX,DEFINE,OLE,SET
#DEFINE FUNCTION,GADGETX,OLE,GET
End
Define Variable,Object,oFSO
Ole Init
%%sPath = "C:\Program Files\QuickTime\quicktimeplayer.exe"
Set oFSO,@Ole(Create,Scripting.FileSystemObject,NULL)
If @Get(oFSO)
# Retrieve the file version of the specified file into a string
%%sFileVer = @Ole(Call,oFSO,^B,"GetFileVersion(^B)",%%sPath)
%%sFileName = @Name(%%sPath).@Ext(%%sPath)
Info %%sFileName %%sFileVer
Ole Free,Object,oFSO
End
Stop
|
Have fun...
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Sat Feb 10, 2007 7:03 pm Post subject: |
|
|
Thanks DS
Believe it or not I actually have used GadgetX for this before.
Due to the fact that I'm using shared code with others at work on this project I was trying to stay as native as possible.
But hey, this might mean I may need to buy more GadgetX licenses from ya
I haven't checked yet but hopefully you also posted this code in the GadgetX forum for others to use
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Feb 10, 2007 7:14 pm Post subject: |
|
|
Aslan,
No I have not posted it over in my forum yet. I guess I will do that. Hey I am always up for selling multiple licenses of GadgetX. I will give you a discount based on the number of licenses you want. We can discuss it via PM if you like.
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Feb 10, 2007 7:29 pm Post subject: |
|
|
Ok I have posted this code at my forums now...
Have fun...
_________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
|