Jump to content

Recommended Posts

Posted

Ehm where do you wanna display the versionnumber ??? And is it the autoit version number it has been compiled with or you own version number of the program ??

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Posted

Create a CONST variable called $VERSION and give it value.

Increment that value every time you make a change to the script.

When you need to display the version, just use the variable.

----[ SandyD ]---
Posted

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.

Posted

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.

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
  • Recently Browsing   0 members

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