Archive: Extending and not replacing text with BrandingText


Extending and not replacing text with BrandingText
Hi!

The Installer Attribute BrandingText allows the replacement of the default text at the bottom of the install window. Is it also possible to simply add something to this default text instead of replacing it?

I would like to add the version of my install script like this: 'Nullsoft Install System vX.XX [1.2]', but I don't want to manually change X.XX every time the version of the install system changes.

Any ideas or suggestions would be appreciated!

Jim


what about this?

outfile 'brand.exe'
BrandingText '$0'

function .onInit
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionMajor'
strcpy '$0' '$R0'
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionMinor'
strcpy '$0' '$0.$R0'
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionRevision'
strcpy '$0' '$0.$R0'
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionBuild'
strcpy '$0' '$0.$R0'
strcpy '$0' 'Nullsoft Install System v$0 [15]'
messagebox mb_ok '$0'
functionend

section -

sectionend

Perfect! Works like a charm!

Thanks a lot,

Jim


Define NSIS_VERSION haves the version number.

You can use it like this:
BrandingText 'Nullsoft Install System ${NSIS_VERSION} [1.2]'

Red Wine that works, but it's run time and it will work only if the user haves NSIS installed.


Red Wine that works, but it's run time and it will work only if the user haves NSIS installed.
the example only shows how to prepare the string at compile time. :-)
I'm in work so trying to post it quickly :-) the right one should be like this"\:
outfile 'brand.exe'
silentinstall silent

function .onInit
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionMajor'
strcpy '$0' '$R0'
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionMinor'
strcpy '$0' '$0.$R0'
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionRevision'
strcpy '$0' '$0.$R0'
ReadRegDword $R0 HKLM 'Software\NSIS' 'VersionBuild'
strcpy '$0' '$0.$R0'
strcpy '$0' 'Nullsoft Install System v$0 [15]'
;messagebox mb_ok '$0'
FileOpen $R1 'brand.nsh' w
Filewrite $R1 "BrandingText '$0'"
Fileclose $R1
functionend

section -

sectionend
..........................................................
!system 'brand.exe'
!include brand.nsh

outfile installer.exe
page directory

section

sectionend

Hmm... I was looking for something like NSIS_VERSION but couldn't find it in the online help. How can I find out about undocumented stuff like that? The forum? Is there a FAQ that contains those little extras?

Jim


Originally posted by Jim Bosworth
Hmm... I was looking for something like NSIS_VERSION but couldn't find it in the online help. How can I find out about undocumented stuff like that? The forum? Is there a FAQ that contains those little extras?

Jim
Far as I know the NSIS_VERSION definition isn't documented anywhere. I heard about it just recently in this forum.

The best and only place to look undocumented stuff is the NSIS source code. ;) There are whole bunch of other hard-coded definitions, but most of those are only useful for NSIS developers.

I'm curious too. I'm trying to set VIAddVersionKey FileVersion "NSIS VERION NUMBER HERE!" to the version it was compiled in. This will be useful in when trying to determine if an issue a client reports is an NSIS bug or ours.

Could a Dev chime in here please?


VIAddVersionKey FileVersion "${NSIS_VERSION}"

-Stu


Today I'm nice andhelpfull ;) see codesnippet if you want to diferentiate your build installeres easily

(Right click yourinstaller.exe , then Properties, look at Comment Infoline )

------------------------------------

!define /date cBuildYear %Y
;this stores the time when the script was compiled;
!define /date Date "%H:%M:%S %d %b, %Y"

VIAddVersionKey Comments "This installer was build on ${Date}"
VIAddVersionKey LegalCopyright "© 1960-${cBuildYear} YourCopyrightCompanyName"


Thank you Stu and Onad!

:D


Put in the Help manual documentation, please!

Originally posted by {_trueparuex^}
Far as I know the NSIS_VERSION definition isn't documented anywhere. I heard about it just recently in this forum.

The best and only place to look undocumented stuff is the NSIS source code. ;) There are whole bunch of other hard-coded definitions, but most of those are only useful for NSIS developers.
I beg the developers to include information on this ${NSIS_VERSION} pre-define into Help manual documentation.
Currently I spent more than 2 hours looking for such info:
Manual -> nothing there
NSIS Sourceforge homepage -> nothing really helpful
Yet from the very beginning I was 100% sure there must be some ${***} define present already. I tried ${NSISVER} and ${NSISVERSION} and almost gave up before my last resort, the forum, directed me in right way while searching for "NSIS version" keywords.

well, it is open source, so you could just check there, or run makensis /HDRINFO at the command line


I see...so why bother with creating documentation at all?
It's open source, so any information can be easily found and retrieved from the source code, right?
No need to write help at all! Just look into source files, there you'll find how to design NSIS script files, what commands it supports and so on...and it won't take you more than 3 months until you'll be able to write your first NSI installer, isn't it just AWESOME?!