Menu ▾ ▴

#913 Feature: GetDLLVersionLocal should work outside a Section

2.0 Series
closed-fixed
nobody
Scripting (211)
5
2013-06-17
2009-06-19
No

I want to show the version of the program being installed inside of the installer's Branding text.
I don't want to have to manually update the version info every time I build the installer.

The seemingly logical approach is to use GetDLLVersionLocal to grab the version information from the .EXE being installed, and then stick that info in BrandingText.

Today, I can't figure out how to do that:
- GetDLLVersionLocal is only available *inside* a Section
- BrandingText can only be set *outside* of a Section

Have I overlooked something, or would accomplishing this scenario require updating GetDLLVersionLocal to work anywhere?

GetDLLVersionLocal "..\..\bin\Release\Fiddler.exe" $R0 $R1
IntOp $R2 $R0 / 0x00010000
IntOp $R3 $R0 & 0x0000FFFF
IntOp $R4 $R1 / 0x00010000
IntOp $R5 $R1 & 0x0000FFFF
StrCpy $0 "$R2.$R3.$R4.$R5"
BrandingText "v$0"

Discussion

  • Amir Szekely

    Amir Szekely - 2009-06-20

    !searchparse and !define /file were added recently exactly for this purpose. GetDLLVersionLocal is for version comparison and that's only required in sections.

     
  • Amir Szekely

    Amir Szekely - 2009-06-20
    • status: open --> closed-wont-fix
     
  • Eric Lawrence

    Eric Lawrence - 2009-06-21

    I must be missing something.

    I don't see how either !searchparse or !define /file would serve the same purpose, unless you're proposing that I use one of these to load my executable into memory, somehow find the offset of the binary version information, and manually parse this information out somehow. That seems implausible at best.

    I suppose I could add some additional tools to the build chain (e.g. http://www.codeproject.com/KB/DLL/showver.aspx\) to extract this information into a plaintext file which is so-imported, but this seems hackier than it needs to be, as NSIS clearly already has the capability of getting the required information at build time.

    The notion that "GetDLLVersionLocal" is for only "version comparison" seems to contrast the documentation, in which a code sample is provided to convert the results of GetDLLVersion into a string.

     
  • Anders

    Anders - 2013-04-03
    • status: closed-wont-fix --> closed-fixed
     
  • Eric Lawrence

    Eric Lawrence - 2013-06-17

    Thanks a bunch for looking at my old bug!

    This now works great:

    !GetDllVersion "..\FiddlerCap2\bin\Release\FiddlerCap.exe" VER_
    !define /date NOW "%b-%d-%y"

    BrandingText "[${NOW}] v${VER_1}.${VER_2}.${VER_3}.${VER_4}"
    VIProductVersion "${VER_1}.${VER_2}.${VER_3}.${VER_4}"

     

    Last edit: Eric Lawrence 2013-06-17

Log in to post a comment.