#2405 closed Bug (Fixed)
Possible issue with FileGetVersion.
| Reported by: | anonymous | Owned by: | Jon |
|---|---|---|---|
| Milestone: | 3.3.9.20 | Component: | AutoIt |
| Version: | 3.3.9.18 | Severity: | None |
| Keywords: | Cc: |
Description
FileGetVersion says that this will return the version of the autoit that was used to compile the exe: FileGetVersion(@AutoItExe, "CompiledScript")
So I compiled the following script and ran it but got nought on 3.3.9.18.
#include <Constants.au3> MsgBox($MB_OK, '', FileGetVersion(@AutoItExe, "CompiledScript") & @CRLF)
Have I simply misunderstood?
Attachments (0)
Change History (11)
follow-up: 3 comment:1 by , 13 years ago
comment:2 by , 13 years ago
Good to know.
Please add an appropriate description in "Compile Pragma Directives"
off topic:
this is not my ticket
comment:3 by , 13 years ago
Replying to guinness:
By default now AutoIt is compiled as 0.0.0.0 unless you specify the correct #pragma version directive.
Ok I did it with the two relevant pragma directives that I could find and still I get a blank msgbox>
#include <Constants.au3> #pragma#pragma compile(ProductVersion, 3.7) #pragma compile(ProductVersion, 3.7) MsgBox($MB_OK, '', FileGetVersion(@AutoItExe, "CompiledScript") & @CRLF)
comment:5 by , 13 years ago
Still get a blank msgbox. The code example I last posted was messed up by me when I formatted it to be posted.
comment:8 by , 13 years ago
#include <Constants.au3> ; Compiled With 3.3.9.18 MsgBox($MB_OK, '', FileGetVersion(@AutoItExe) & @CRLF) ; Displays 0.0.0.0 MsgBox($MB_OK, '', FileGetVersion(@AutoItExe, "CompiledScript") & @CRLF) ; displays nothing
comment:9 by , 13 years ago
The docs for FileGetVersion are wrong. A "CompiledScript" property is no longer there. I'll remove it. The way to add a custom version number is the pragma directive. And to get the version of AutoIt used you use the @AutoItVersion macro. See here:
#include <Constants.au3> #pragma compile(FileVersion, 1.2.3.4) ; Displays 1.2.3.4 MsgBox($MB_OK, '', FileGetVersion(@AutoItExe) & @CRLF) ; displays nothing, this property is no longer used MsgBox($MB_OK, '', FileGetVersion(@AutoItExe, "CompiledScript") & @CRLF) ; Displays the version of AutoIt used - this has always been the best way to do this. MsgBox($MB_OK, '', @AutoItVersion & @CRLF)
comment:10 by , 13 years ago
| Milestone: | → 3.3.9.20 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Fixed by revision [8908] in version: 3.3.9.20
comment:11 by , 9 years ago
We can also use shell script to obtain file version associated with .dll & .exe file using below line of codes:
[string]$Vesrion = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files\example\Example.exe").FileVersion
echo $Vesrion

By default now AutoIt is compiled as 0.0.0.0 unless you specify the correct #pragma version directive.