|
|
#1 |
|
Junior Member
Join Date: Oct 2006
Posts: 26
|
Dynamic Version Information
Hi,
My install is rebuilt every night form a nightly build script, however ther version of the install file, set in VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "310.0.0.154" VIProductVersion "310.0.0.154" Must be the same the executable about to be installed, this can be retrieved using GetDllVersionLocal, however seeing as VIAddVersionkey and VIProductVersion can not be in Sections or Functions it is hard to make dynamic. Is it possible to retrieve the version information in .onInit and then assign it to a variable which is later assigned in VIAddVersionKey and VIProductVersion VIProductVersion $DynamicallyDeterminedVersionNumber VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" $DynamicallyDeterminedVersionNumber Nniol |
|
|
|
|
|
#2 |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
on the top of your script execute with !system an exe that retrieves the desired info and adds them as defines to a header e.g. versions.nsh and then !include versions.nsh to your script.
e.g. the small exe: section FileOpen $0 '$EXEDIR\versions.nsh call GetDllVersionLocal FileWrite $0 '!define File_Ver "<resulting_var_from_call>"$\r$\n' FileClose $0 sectionend the main script, !system "$EXEDIR\small.exe" !include versions.nsh ............ VIProductVersion "${File_Ver}" Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
edit: Red Wine beat me to it, that should teach me not to read some random blog before hitting submit
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Oct 2006
Posts: 26
|
Thaanks guys, a real life saver there
Nniol (not so Insane anymore) |
|
|
|
|
|
#5 |
|
Member
Join Date: Mar 2004
Posts: 73
|
This macro does the same and a little more:
http://nsis.sourceforge.net/NfUtils_...SetVersionInfo |
|
|
|
|
|
#6 | |
|
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Quote:
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
|
|
|
|
|
#7 |
|
Member
Join Date: Mar 2004
Posts: 73
|
${nfu.SetVersionInfo} does not include /LANG= in VIAddVersionKey but you could use ${nfu.!FileVersion} to store the version in a symbol:
code: should do it (untested). see http://nsis.sourceforge.net/NfUtils_....21FileVersion If you dont need /LANG in VIAddVersionKey then you might want to use code: |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|