Archive: Why doesn't "button_text" work anymore in 2.0?


Why doesn't "button_text" work anymore in 2.0?
I've just switched from 1.98 to 2.0b because of the 1.98 bug when creating shortcuts on a Win98 system. My trepidation about using a pre-release version was overcome by reassurances here that it's pretty stable by now. Well, I just recompiled my script and discovered that the following line no longer works as before:

LicenseText "blah blah ..." Proceed

The documentation hasn't changed, which means that the right-button SHOULD read "Proceed". It does in a 1.98 compile. Now, it's blank !!! Did someone forget to change the documentation, or is it a bug in 2.0?

From here, it looks like someone else has had the same trouble, but the answers there are too obscure to be any help.

I THINK the answers there (where there is mention of editing language files) are advising how to change the DEFAULT button text. I don't want to CHANGE the default text, I just want to be able to OVERRIDE the default from my script in some cases.

I am using three exe's (Setup, Setup2 and Setup3) that chain from 1 to 2 to 3 in sequence, provided the user doesn't click "cancel" at the licence pages. Setup (which exec's Setup2 just before terminating) does nothing more than display some preliminary information and allow the user to cancel if necessary. But the text is too much for an OKCANCEL text box, so I display it in the scrollable licence page instead. There, I want the buttons to read "Cancel" and "Proceed". If the user Proceeds, Setup2 does some preliminary installation and then exec's Setup3 which completes the job. Setup2 displays my real licence. There, I want the default button text.

(I know there are probably other alternatives to this chaining but, hey, it works, and because all three installers look the same and appear in the same screen position, the chaining is unnoticeable unless you're really looking out for it.)

Can the default button text still be overriden in 2.0 as the documentation indicates?


That other topic is about the Modern UI.

This line:


LicenseText "some text" "blabla"


works fine for me, button text = blabla (latest CVS version).

No go
Makes no difference whether button_text is quoted or not (which is what I would expect, since it's a single word). Either way the right button is blank. It used to say "Proceed".

Relevant(?) facts:
* I'm using Windows 98 SE
(Could it be another Win98 bug, there are still plenty of Win98 users around you know);)
* I'm using the CVS zip of Nov 6 2002 (I assume that's recent enough).

I even tried a system "rollback":
- reboot, uninstalled 2.0, uninstalled 1.98, reboot, did a clean install of 2.0, reboot, recompile: Same results.

BTW, there are no installation instructions, so I hope I did right:
* I unzipped nsis.zip to ...\NSIS\NSIS20b
* Ran !installNSIS.bat
* In the installer, I selected the same directory as above ( ...\NSIS\NSIS20b) as the install destination.

Since my source for Setup.nsi is so small, I'm appending it here. Maybe some eagle-eyed debugger can spot something wrong?


;------------------------
# Global Pseudo-Constants
;------------------------
!Define ProductName "SKK"
!Define Installer "SKKsetup"

;-----------------------
# [Installer Attributes]
;-----------------------

Name "${ProductName}"
OutFile "..\..\${Installer}.exe"
BGGradient 000000 0000ff ffffff
AutoCloseWindow true
Caption ""
SubCaption 0 ": WARNING:"


;----------------------------------------------------------------
# [License Page] We use this to display the introductory warning
;----------------------------------------------------------------
LicenseText "IMPORTANT: PLEASE READ THIS BEFORE PROCEEDING." "Proceed"
LicenseData "..\Texts\Warning.txt"
SubCaption 0 ": WARNING:"
;--------------------------

SubCaption 3 "Preparing to Install"

Section ""
;----------
ClearErrors
Exec $EXEDIR\Setup\${Installer}2.exe
IfErrors Error OK
Error:
SetDetailsView show
SetDetailsPrint ListOnly
SetAutoClose false
DetailPrint "ERROR: Could not run above file."
SetDetailsPrint none ; suppresses printing of line "Completed"
Goto End
OK:
HideWindow ; Not really necessary, but just to be safe
End:
SectionEnd


What's annoying me is that I didn't save my old (1.98) compile.
Now to get back a working version, I'm going to have to uninstall 2.0, reinstall 1.98, recompile, then (if I decide to still keep trying it out) reinstall 2.0 again. I'm assuming that installing 2.0 with 1.98 still present would be okay, but not the reverse, since the registry entries would then point to 1.98. [sigh ...]

Since Nullsoft introduced the language support in the scripts, there might be a bug in NSIS. I haven't and can't check right now, because I don't have a NSIS compiler here, but I thing that maybe the following could help:


;------------------------
# Global Pseudo-Constants
;------------------------
!Define ProductName "SKK"
!Define Installer "SKKsetup"

;-----------------------
# [Installer Attributes]
;-----------------------

Name "${ProductName}"
OutFile "..\..\${Installer}.exe"
BGGradient 000000 0000ff ffffff
AutoCloseWindow true
LoadLanguageFile "${NSISDIR}\Contrib\Language files\English.nlf"
SubCaption /LANG=${LANG_ENGLISH} 0 ": WARNING:"

;----------------------------------------------------------------
# [License Page] We use this to display the introductory warning
;----------------------------------------------------------------
LicenseText /LANG=${LANG_ENGLISH} "IMPORTANT: PLEASE READ THIS BEFORE PROCEEDING." "Proceed"
LicenseData /LANG=${LANG_ENGLISH} "..\Texts\Warning.txt"
SubCaption /LANG=${LANG_ENGLISH} 0 ": WARNING:"
;--------------------------

SubCaption /LANG=${LANG_ENGLISH} 3 "Preparing to Install"

Section ""
;----------
ClearErrors
Exec $EXEDIR\Setup\${Installer}2.exe
IfErrors Error OK
Error:
SetDetailsView show
SetDetailsPrint ListOnly
SetAutoClose false
DetailPrint "ERROR: Could not run above file."
SetDetailsPrint none ; suppresses printing of line "Completed"
Goto End
OK:
HideWindow ; Not really necessary, but just to be safe
End:
SectionEnd


I might be wrong about some instructions, but I hadn't the time to go through all documentation.

Bring back the carriage-returns
Another gripe about 2.0.

All the new text files are no longer readable in Notepad! (I'm using the stock standard Notepad that came with Windows 98 SE.)

This is because the lines are terminated with just Line feeds (ASCII 10) and not a CR-LF pair (ASCII 13, ASCII 10) as God intended!

I have to go back to my old beloved DOS editor (QEdit) to read them, and, if I want them to be readable in Notepad, I have to resave them in QEdit, so it will put back the carriage returns.

Why have you taken them out???


You can also read the files with Wordpad or Write.


Found the bug. I will upload a fix in a couple of minutes.
Which files don't have \r\n? Please be more specific.


Fixed the bug concerning you. More fixes to come. You will have to recompile NSIS (with VC) for this fix to work.
Thanks for the heads up.


CR/LF and Bug Fix
Thanks Kitchik!

I don't have VC. Can I just wait for the next nightly CVS upload?
(Have to go to bed now anyway -- it's 3.00am over here and I'm falling asleep at the keyboard!)

Re the "missing" CRs.
all the language .nlf files,
all the example .nsi files,
all the files in Modern UI

Maybe others too -- haven't checked them all out yet.


The nightly snapshot doesn't compile the EXE, it just takes it from the CVS. I have recompiled NSIS and uploaded it so you can use the latest version from the CVS.

The CRs are missing because the scripts create the ZIP file on Linux. I thought it was fixed already, but I guess it wasn't... Back to the drawing board :D

If you will download all of the files from the CVS using a Windows CVS client the line breaks should be fine. There is an entry about using CVS client to download NSIS in the FAQ.


CR/LF again
BTW, I just remembered seeing this on the CVS site earlier today, on
this page (under the update by joostverburg)

"The CVS snapshot files are automatically converted to use Windows line breaks now."

Does this have anything to do with it?


Originally posted by kichik
The nightly snapshot doesn't compile the EXE, it just takes it from the CVS. I have recompiled NSIS and uploaded it so you can use the latest version from the CVS.
I don't understand. Do you mean to say that, in general, when bug fixes are made to the development version, they are not reflected in the subsequent uploads? If so, what's the point of the nightly snapshot? And, in that case, how often, as a general rule, do you actually upload a recompiled version to the CVS site. If these sound like stupid questions, I'm sorry, it's because I don't really understand how CVS works in general.

Re: CR/LF again

Originally posted by Mottel
BTW, I just remembered seeing this on the CVS site earlier today, on
this page (under the update by joostverburg)

"The CVS snapshot files are automatically converted to use Windows line breaks now."

Does this have anything to do with it?
It should convert the line breaks to \r\n (the Windows standard), but I guess that there is a bug somewhere :)

Originally posted by Mottel

I don't understand. Do you mean to say that, in general, when bug fixes are made to the development version, they are not reflected in the subsequent uploads? If so, what's the point of the nightly snapshot? And, in that case, how often, as a general rule, do you actually upload a recompiled version to the CVS site. If these sound like stupid questions, I'm sorry, it's because I don't really understand how CVS works in general.
The snapshot contains all the latest source files. You can compile 'em yourself, but we also update the compiled file (makensis.exe) when we made important changes.