Archive: Custom NSIS version almost ready ! Supporting items text change at run-time


Custom NSIS version almost ready ! Supporting items text change at run-time
I'm working on a custom (modified) version of NSIS which allows you to change items text at run-time.

It's easy to use, I've added a new 'SetText' function that allows you to do that.

This new function runs in that way:

SetText ItemName (string|$0-9)

ItemName --> any NSIS text: Caption, BrandingText,...
String|$0-9 --> any string or a register

I hope it to be ready for to morrow, let me know if you are interested on it and I will post a message under this task.

This new function will allow you to localize NSIS installations at run-time, avoiding the need of having an installation for every language you want to distribute your application.


Nice. I'll take one!


Just a small suggestion:

While you're on it, also add a variable or function which returns the result of PRIMARYLANGID(GetUserDefaultLangID()) (defined in winnls.h). This makes it possible to select the initial language automatically from within the script without having to ask the user in some dialog.

-Fritz


Submit it to NSIS Project House (when I complete it). Heck, you can have it avaliable for download on the repository now.

-Duane


I guess that is some change that Justin might be interested in as well. An automatically localized installer would come in very handy for Winamp, I suppose.


Here you have !
As I said here is a preview of NSIS modification I'm working on.

Beware, It's in BETA state, It is not competed at all yet.

It's based on NSIS 1.67 (the last one I know about)

I've only added a new function to NSIS built-in functions, that's:

$PRIMARYLANG --> a new variable which identifies the primary language
of the system in which NSIS is running. (included as
requested by felfert)

SetText, usage: SetText TextToSet str
TexToSet --> the item text you want to set.
Allowed vaules are (they're not case sensitive):
Subcaption0
Subcaption1
Subcaption2
NextButtonText
...


Well, see EXAMPLE1.NSI for a complete list, there are
used all the possible values
Str --> the text you want to set, whatever string you want.

Limitations: On this version you have to set the text before the item apppears in the screen, later will not be refreshed (I'm working on it).

Uninstallation text aren't supported yet. (will be soon)

Exceptions: DetailsButtonText, CancelButtonText, BackButtonText, SpaceAvailableText, SpaceAvailableText, all these don't suffer the above limitation (if they're on the screen whe you call SetText they will be changed).

If you want an utility to let user choose installation language see a previous post I did a few days ago (it will be included in the final version).

You can see an example on how it does work in EXAMPLE1.NSI.

Well I foget to give the link to download :D, DOWNLOAD HERE !!

Enjoy.

P.S.: Sorry for my bad english
P.S.: Duane, could you tell me when & how to up load to NSIS project House ?


Could you please explain what "Subcaption0," "Subcaption1," and "Subcaption2" actually are?


Yeah, I'l be glad to do that
I know there isn't too much information about L extensions on L-NSIS, but like it is used to say in my country (Spain) "Si hay que hacerlo se hace, pero hacerlo pa na es tonterĂ­a" (free translation into english should be something like: "If you want me to do it I'll do it, but do doing it without a good reason is a silly thing"). I mean, it seems there isn't too many people interested on L-NSIS so why to waste my spare-time on documenting it's features... (If I see there's more people confused on it's use I'll try to write a better documentation).

Explanation:

In NSIS scripting language there is a "SubCaption Page subcaption" command, where Page is any number between 0 and 4. SubCaption0 to SubCaption4 SetText's parameters are their equivalents at run-time.

Example:

At compile-time----------------->At run-time
-----------------------------------------------------
SubCaption 0 "Something"-------->SetText SubCaption0 "Something"
SubCaption 4 "Like a bird"------>SetText SubCaption4 "Like a bird"

For more info on SubCaption see makensis.htm.

Did you know there is a new L-NSIS version (1.67.2)?
Go to www.geocities.com/rincon_de_jmcb/lnsis/ and download from there.
With this new version you can get a lot of bug-fixes, new features like more commands (LoadLicenseData and SetSectionName ) and improvements.

Sorry for my english.

P.S.: thanks for asking, now I know there is someone but me using L-NSIS.


To upload it to the NSIS Project House Repository, you must have a SourceForge Account, then I would add you to the project. Then you would add to the repository.

-Duane