Sign in to follow this  
Followers 0
bobbintb

FileCheckVersion insufficient. need product version.

9 posts in this topic

#1 ·  Posted (edited)

I am using FileGetVersion but when i used it on firefox it gives me a low number. i looked and what i need is the Product version and not the File version. any way to do this? Ive come up blank so far.

Edited by bobbintb

Share this post


Link to post
Share on other sites



You need FileGetVersion(). See helpfile for how to use it :)

thats what i was using. i need the product version though. not the file version.

Share this post


Link to post
Share on other sites

thats what i was using. i need the product version though. not the file version.

I don't want to preach or anything like that, especially since this is my first post, but...

Rather than someone giving me the answer, I find it more satisfying if I discover the answer myself.

The helpfile does explain how you can use the FileGetVersion function to get the ProductVersion.

Share this post


Link to post
Share on other sites

I don't want to preach or anything like that, especially since this is my first post, but...

Rather than someone giving me the answer, I find it more satisfying if I discover the answer myself.

The helpfile does explain how you can use the FileGetVersion function to get the ProductVersion.

lol! thanks. its been a long day at work. i dont know how i missed that as i was looking over that page quite a bit.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

There are two ways to read the Product Version.

RegistryKey Uninstall or Win32_Product.

First and working with all Software is RegRead Uninstall:

#NoTrayIcon
Opt("MustDeclareVars", 1)

_SoftwareProdukte()

Func _SoftwareProdukte($strComputer=@ComputerName)
    Local $sRegKey1 = "\\" & $strComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'
    Local $iCount1 = 1
    While 1
        Local $sKey1 = RegEnumKey($sRegKey1, $iCount1)
        If @error <> 0 Then ExitLoop
        Local $ProductName = RegRead($sRegKey1 & '\' & $sKey1, 'DisplayName')
        Local $ProductVersion = RegRead($sRegKey1 & '\' & $sKey1, 'DisplayVersion')
        If $ProductName <> "" and $ProductVersion <> "" Then
            ConsoleWrite ($strComputer & " - " & $ProductName & " - Version: " & $ProductVersion & @CRLF)
        EndIf
        $iCount1 += 1
    WEnd
EndFunc

Output: PCxxxx - Mozilla Firefox (3.5.3) - Version: 3.5.3 (de)

Posted Image

Or with Win32_Product:

$strcomputer = "."
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strcomputer & "\root\cimv2")
$colSoftware = $objWMIService.ExecQuery("Select * from Win32_Product")
For $objSoftware in $colSoftware
    ConsoleWrite( $strcomputer & " - " & $ObjSoftware.Name & " - Version: " &$ObjSoftware.Version & @CRLF )
        ;objSoftware.Uninstall()
Next

Hope this help you.

Edited by Tec

Share this post


Link to post
Share on other sites

@ Tec

He wants to get the product version of a file. Nothing to do with installed programs.

Share this post


Link to post
Share on other sites

Ah Sorry I misunderstand.

I think he wants the product version from Firefox and use FileGetVersion to get the product version.

My mistake sorry :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

This works (Examples):

MsgBox(0, "", FileGetVersion("C:\Program Files\Mozilla Firefox\firefox.exe","ProductVersion"))
MsgBox(0, "", FileGetVersion("C:\Program Files\Mozilla Firefox\firefox.exe","ProductName"))
Edited by gfunk999

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0