Opened 17 years ago
Closed 17 years ago
#933 closed Bug (No Bug)
FileGetVersion() generates error when File Version attribute values contain leading 0
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.0.0 | Severity: | None |
| Keywords: | Cc: |
Description
Using the FileGetVersion optional parameter to look at the "FileVersion" attribute, the function generates an error if the file version value contains a leading 0.
; Errors in reading File Versions with leading 0's
$File = @WindowsDir & "\system32\quartz.dll" ; Example File Version with leading 0
$LocalFileVersion = FileGetVersion($File,"FileVersion") ; FileVersion attribute contains value: 6.05.2600.5731 (note leading 0 in minor version number)
Msgbox(64,"DEBUG", "File Version After First Instance: " & $LocalFileVersion & " @ERROR = " & @error)
If $LocalFileVersion="" Then
$LocalFileVersion = FileGetVersion($File)
Msgbox(64,"DEBUG", "File Version After Second Instance: " & $LocalFileVersion & " @ERROR = " & @error)
EndIf

in fact when you use the FilegetVersion($file, "FileVersion") you don't access to the same information.
Under Vista you get the version with more info as :
6.6.6000.16386 (vista_rtm.061101-2205)
We will not change this behavior. That's the reason why you received the extra 0. If you want not 0 just use FilegetVersion($file).