Jump to content

FileCheckVersion insufficient. need product version.


Recommended Posts

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
Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...