Question

We have an SVN repository as well as a GIT repository here. We have both at the moment because we are trying to convince the rest of the staff that using the latter would suffice than using the former. Regardless, I would like to incorporate the version number into the .exe file (using either or) into the NSIS script I am writing. But I cannot seem to understand how to implement it in code. This is what I have so far.

Section 
nsExec::Exec '"git" describe head'
Pop $0 #return value/error/timeout
Pop $1 #printed text
DetailPrint "       Return value: $0"
DetailPrint "       Version printed: $1"
SectionEnd

The pseudo code is: if GIT exists, GIT describe head, else if SVN exists, SVN info parse revision #, else parse assembly info (called version.txt)

How would I go on to write the code for NSIS? The target computers are Windows 7,8 & 8.1

using revision 1.4b.2, and some GIT hash(if GIT exists is true) the final output should look something like KART.-1.4b.3.nte3j-installer.exe. What I have isn't much, but outside of that the .exe builds and installs just fine, its just getting the rev number in there.

No correct solution

OTHER TIPS

If you want to get the revision number and use that as part of the filename (or UI text) for the setup you are generating you have to use compile-time commands like !system and !searchparse...

Edit:

!tempfile StdOut
!echo "${StdOut}"
!system '"svn" info c:\foo\trunk > "${stdout}"'
!searchparse /file  "${StdOut}" "Revision: " SVNREV
!delfile "${StdOut}"
!undef StdOut
Name "MyApp SVN.${SVNREV}"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top