Jump to content

Display Version number of the script


ds10025
 Share

Recommended Posts

I'm writing my first script. This script is on going. How can I automate the process to display the version number of the script?

OK, this may be a bit long winded, but it's worth it.

Use SciTE for AutoIt as your editor. If you do this, you'll be able to add compiler directives that will not only embed the version number in the final EXE (instead of the AutoIt version number), but can also automatically increment the number after each compilation. You will also need to download ResHacker.zip and extract it to the SciTe\AutoIt3Wrapper directory.

In the beginning of your script, put the following compiler directives:

#compiler_res_fileversion=1.0.0.0

Now when you compile, the EXE version will be 1.0.0.0, and the code in the script will increment up to 1.0.0.1.

I always have the following lines after that so I can get or display the program's version number easily:

Global $Rev
If @Compiled Then
    $Rev = FileGetVersion ( @ScriptFullPath )
Else
    $Rev = '1.0.0'
EndIf
I put the $Rev = '1.0.0' in for when I run without compiling during testing.

Check out all the compiler directives and variables. One other compiler directive I use that's really handy is

#compiler_res_field=Build Date|%longdate%  %time%
#compiler_res_field=AutoItVersion|%AutoItVer%

This embeds the date and time I compiled the script, and what version compiler I used into the final EXE. Unfortunately the info doesn't display in Vista any more! Sometimes Microsoft is SOOO DUMB!!! Theres a lot of other directives. When SciTE is open, select Help --> SciTE Help for info.

Link to comment
Share on other sites

This is great! I will try it.

I am also using CVS which also use it own version number. Will it be possible to have one version number that covers everything?

When the script is run I want to display the version number, maybe as label is this possible by using label $version?

OK, this may be a bit long winded, but it's worth it.

Use SciTE for AutoIt as your editor. If you do this, you'll be able to add compiler directives that will not only embed the version number in the final EXE (instead of the AutoIt version number), but can also automatically increment the number after each compilation. You will also need to download ResHacker.zip and extract it to the SciTe\AutoIt3Wrapper directory.

In the beginning of your script, put the following compiler directives:

#compiler_res_fileversion=1.0.0.0

Now when you compile, the EXE version will be 1.0.0.0, and the code in the script will increment up to 1.0.0.1.

I always have the following lines after that so I can get or display the program's version number easily:

Global $Rev
If @Compiled Then
    $Rev = FileGetVersion ( @ScriptFullPath )
Else
    $Rev = '1.0.0'
EndIf
I put the $Rev = '1.0.0' in for when I run without compiling during testing.

Check out all the compiler directives and variables. One other compiler directive I use that's really handy is

#compiler_res_field=Build Date|%longdate%  %time%
#compiler_res_field=AutoItVersion|%AutoItVer%

This embeds the date and time I compiled the script, and what version compiler I used into the final EXE. Unfortunately the info doesn't display in Vista any more! Sometimes Microsoft is SOOO DUMB!!! Theres a lot of other directives. When SciTE is open, select Help --> SciTE Help for info.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...