Modify

Opened 13 years ago

Closed 13 years ago

Last modified 9 years ago

#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, 13 years ago

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

comment:2 by mlipok, 13 years ago

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, 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:4 by guinness, 13 years ago

Look at the #pragma example.

#pragma compile(FileVersion, 3.7.0.0)

comment:5 by anonymous, 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:6 by James, 13 years ago

Are you using the latest betas?

comment:7 by anonymous, 13 years ago

3.3.9.18

comment:8 by anonymous, 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 Jon, 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 Jon, 13 years ago

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, 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

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.