I would like to be able to set File version and Product version properties on the EXE file generated by Macro Scheduler Pro compiler. This will allow me to verify quickly if my clients are running the latest build of the macros that I have developed - by right-clicking on the exe file, selecting Properties and reading the values for these properties on the Details tab.
Right now both the File version and Product version properties are set to 1.0.0.0. Please advise if there is a way to set these property values before I run the compiler.
Tomek
How to set File Version and Product Version in EXE
Moderators: Dorian (MJT support), JRL
Re: How to set File Version and Product Version in EXE
I don't know of a way to accomplish this at compile time but you might try this post compile method. It takes a few seconds longer than it seems like it should but seems to work. It changed the version info and more importantly the new executable executed.
Could be made more user friendly but you know how to do that.
Could be made more user friendly but you know how to do that.
Code: Select all
Let>vPath=script_dir
Let>vNewPath=temp_dir
Let>vFile=MyExecutable.exe
Let>FileVer=F i l e V e r s i o n 1 . 0 . 0 . 0
Let>ProdVer=P r o d u c t V e r s i o n 1 . 0 . 0 . 0
Let>NewFileVer=F i l e V e r s i o n 2 . 3 . 4 . 5
Let>NewProdVer=P r o d u c t V e r s i o n 6 . 7 . 8 . 9
VBEval>chr(0),null
StringReplace>FileVer,space,null,FileVer
StringReplace>ProdVer,space,null,ProdVer
StringReplace>NewFileVer,space,null,NewFileVer
StringReplace>NewProdVer,space,null,NewProdVer
ReadFile>%vPath%\%vFile%,vData
Separate>vData,FileVer,Part
Let>vData=%Part_1%%NewFileVer%%Part_2%
Separate>vData,ProdVer,Part
Let>vData=%Part_1%%NewProdVer%%Part_2%
Let>WLN_NOCRLF=1
WriteLn>%vNewPath%\%vFile%,wres,vData
Re: How to set File Version and Product Version in EXE
JRL - thank you very much for your suggestion.
I tested your solution and it works as long as the version number contains single digits in all positions. If you use more than one digit in any position of the version number, the EXE file will not work. You would get an error:
The application has failed to start because its side-by-side configuration is incorrect...
As a result I cannot use this solution as a general script that would reflect my build version. It would be great if Macro Scheduler Pro allowed to set the product version at the compile time, as opposed to a utility that sets it after EXE is created.
I tested your solution and it works as long as the version number contains single digits in all positions. If you use more than one digit in any position of the version number, the EXE file will not work. You would get an error:
The application has failed to start because its side-by-side configuration is incorrect...
As a result I cannot use this solution as a general script that would reflect my build version. It would be great if Macro Scheduler Pro allowed to set the product version at the compile time, as opposed to a utility that sets it after EXE is created.
Re: How to set File Version and Product Version in EXE
I should further explain that my scripts are compiled to EXE files and then included in an MSI file (using WIX). The MSI files are deployed to all users using Group Policy. It will be very helpful for me to be able to verify that the latest MSI contained the correct EXE build version and that it was correctly deployed when I have to troubleshoot problems - this can be accomplished if the product version is set at compile time.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How to set File Version and Product Version in EXE
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Re: How to set File Version and Product Version in EXE
The link above no longer works.Marcus Tettmar wrote:You could use something like this:
http://www.the-software-box.com/changeversion.aspx
BTW, any method to change file information such as description, copyright, product name etc?
Thank you.
I would prefer an easy method. Thank you.
- Phil Pendlebury
- Automation Wizard
- Posts: 543
- Joined: Tue Jan 16, 2007 9:00 am
- Contact:
Re: How to set File Version and Product Version in EXE
I would also find this very useful.
Phil Pendlebury - Linktree
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Re: How to set File Version and Product Version in EXE
It's on the wish list.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?