Modify

#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)

comment:1 by guinness, on Aug 21, 2013 at 8:46:45 PM

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

comment:2 by mlipok, on Aug 21, 2013 at 9:46:34 PM

Good to know.
Please add an appropriate description in "Compile Pragma Directives"

off topic:
this is not my ticket

in reply to:  1 comment:3 by jaberwacky, on Aug 22, 2013 at 1:27:32 AM

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:4 by guinness, on Aug 22, 2013 at 6:43:44 PM

Look at the #pragma example.

#pragma compile(FileVersion, 3.7.0.0)

comment:5 by anonymous, on Aug 23, 2013 at 12:13:22 AM

Still get a blank msgbox. The code example I last posted was messed up by me when I formatted it to be posted.

comment:6 by James, on Aug 24, 2013 at 11:21:43 AM

Are you using the latest betas?

comment:7 by anonymous, on Aug 24, 2013 at 4:13:45 PM

3.3.9.18

comment:8 by anonymous, on Aug 24, 2013 at 6:41:25 PM

#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 Jon, on Sep 1, 2013 at 9:53:41 AM

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 Jon, on Sep 1, 2013 at 9:58:41 AM

Milestone: 3.3.9.20
Owner: set to Jon
Resolution: Fixed
Status: newclosed

Fixed by revision [8908] in version: 3.3.9.20

comment:11 by anonymous, on Jan 5, 2017 at 3:05:49 AM

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

Modify Ticket

Action
as closed The owner will remain Jon.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.