Hello
my version of nsis : 2.46
I change the version manually with each compilation.
I would like to do it automatically.
I would like to take the version of myapplic.exe and put it directly in :
VIAddVersionKey / LANG = $ {LANG_FRENCH} "ProductVersion" "$ {PRODUCT_VERSION}".
It is a version of type: 2.4B for example.
I have browsed the forum but I do not get away with it. Someone can help me ?
Thank you
Set the automatic version of myapplic.exe to VIAddVersionKey
8 posts
2.46 is old, you should at least upgrade to 2.5x to get some important security fixes!
NSIS 3 has !getdllversion but it only reads the version number, not strings.
The best option is to use !searchparse on your .h/.rc source file.
The final option is to execute a helper application with !execute that reads the version and writes it to a .nsh file you can then !include. Resource Hacker can be used to extract resources from .exe files...
NSIS 3 has !getdllversion but it only reads the version number, not strings.
The best option is to use !searchparse on your .h/.rc source file.
The final option is to execute a helper application with !execute that reads the version and writes it to a .nsh file you can then !include. Resource Hacker can be used to extract resources from .exe files...
What we do is keep the version number in an .h file that is parsed by our build script and set as an environment variable. We then use that environment variable for major versioning across the various pieces of the project. When it comes to the installer, it is passed to NSIS as a define via the command line, e.g.:
makensis.exe /DPRODUCT_VERSION=%version% installer.nsi
thanks for the answers.
So when i do the exe file of the application, i have to save too the version in a txt file like this :
!define EXE_VERSION 1.2D.
And i use it in the script with an !include to have the version.
Anders, you said my NSIS version is old. So The lastest NSIS 3.02.1 is good ?
thanks
So when i do the exe file of the application, i have to save too the version in a txt file like this :
!define EXE_VERSION 1.2D.
And i use it in the script with an !include to have the version.
Anders, you said my NSIS version is old. So The lastest NSIS 3.02.1 is good ?
thanks
Anders :
do you have an example of :
The best option is to use !searchparse on your .h/.rc source file.
The final option is to execute a helper application with !execute that reads the version and writes it to a .nsh file you can then !include. Resource Hacker can be used to extract resources from .exe files..
i have searched it on the forum but didn't find anything
thanks
do you have an example of :
The best option is to use !searchparse on your .h/.rc source file.
The final option is to execute a helper application with !execute that reads the version and writes it to a .nsh file you can then !include. Resource Hacker can be used to extract resources from .exe files..
i have searched it on the forum but didn't find anything
thanks
You only have a .h and a .rc file if your program is written in C/C++.
finally i did a powershell script who do my-app-version.txt
in NSIS script i call a batch file with the powershell command
!system "version.bat"
!include my-app-version.txt
in NSIS script i call a batch file with the powershell command
!system "version.bat"
!include my-app-version.txt
.h
#define VERSTR "42.666beta".nsi
!searchparse /file "resinfo.h" '#define VERSTR "' VERSTR '"'
VIAddVersionKey "ProductVersion" "${VERSTR}"