Modify

Opened 11 years ago

Closed 11 years ago

Last modified 8 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 follow-up: Changed 11 years ago by guinness

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

comment:2 Changed 11 years ago by mlipok

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

off topic:
this is not my ticket

comment:3 in reply to: ↑ 1 Changed 11 years ago by jaberwacky

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 Changed 11 years ago by guinness

Look at the #pragma example.

#pragma compile(FileVersion, 3.7.0.0)

comment:5 Changed 11 years ago by anonymous

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 Changed 11 years ago by James

Are you using the latest betas?

comment:7 Changed 11 years ago by anonymous

3.3.9.18

comment:8 Changed 11 years ago by anonymous

#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 Changed 11 years ago by Jon

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 Changed 11 years ago by Jon

  • Milestone set to 3.3.9.20
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [8908] in version: 3.3.9.20

comment:11 Changed 8 years ago by anonymous

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

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.