Archive: MUI macros not working anymore in my script


MUI macros not working anymore in my script
i've been away from nsis from months, in fact i haven't even touched my old windows machine lately. however, i found myself in the position that i needed to update an old script of mine, but all of a sudden it produces errors that didn't happen before.

!insertmacro: MUI_PAGE_LICENSE
Error in macro MUI_INTERFACE on macroline 54
Error in macro MUI_PAGE_INIT on macroline 3
Error in macro MUI_PAGE_LICENSE on macroline 5


it took me a while to figure out, that for unknown reasons, the nsis projected which is sitting in a dropbox folder, suffered from synchronization problems. my custom ui, basically a modified MUI_nodesc, was 0kb in size. i changed the ui in the script to MUI_nodesc, but the problem persists. any ideas what could be the problem, all other resources by my script are intact. nothing was changed on the license page or the license itself since i last compiled my project successfully.

edit: interestingly, the standard MUI compiles the script

1) Why colon after !insertmacro ???
2) MUI_PAGE_LICENSE requires license file (parameter)


Originally posted by T.Slappy
1) Why colon after !insertmacro ???
ah, that was copied from the makensis window, it's not my actual code

2) MUI_PAGE_LICENSE requires license file (parameter)
my actual code goes like this (and as i said, it worked for years!)

!define MUI_COMPONENTSPAGE_CHECKBITMAP "ui\yi-${LOWERCASE}.bmp"
!define MUI_ICON "ui\yi-${LOWERCASE}.ico"
!define MUI_UI "ui\nodesc.exe"
!define MUI_LICENSEPAGE
!define MUI_LICENSEPAGE_BGCOLOR "FFFFFF"
!define MUI_INSTFILESPAGE_COLORS "000000 FFFFFF"
!define MUI_INSTFILESPAGE_PROGRESSBAR "colored smooth"
!define MUI_BGCOLOR "0x1b1b1b"
...
!define MUI_LICENSEPAGE_TEXT_BOTTOM "$(LabelLicense)"
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "license.txt"

"!define MUI_LICENSEPAGE" is supposed to do what?

Anyway, I know the ChangeUI command does not output errors in all cases so make sure those UI exe files are not corrupt...


Originally posted by Anders
"!define MUI_LICENSEPAGE" is supposed to do what?
frankly, i don't know (or remember). it has been there since march 2009 and it never produced a problem in the 20 versions that came out since. anyway, commenting that line doesn't change a thing as i still get the same error from the compiler.

reinstalled nsis to make sure MUI_nodesc isn't corrupted. no success. did the same in a clean vm. no success.

well, nevermind. i simply copied my gui modifications to modern.exe (at the cost of extra 2kb). i don't know what's wrong all of a sudden with modern_nodesc.exe, everybody knows nothing in nsis changed in over 4 years.


Heh, one more time :) - Correct syntax is:
!insertmacro MUI_PAGE_LICENSE "License.rtf"

You used !define MUI_LICENSEPAGE (without parameter) which is definitely wrong for MUI2 (I think it is for MUI1).

You cannot use MUI stuff in MUI2 script - either include MUI.nsh (and do not use MUI2 stuff) or update whole script to MUI2 ( so rewrite most of MUI1 commands).


MUI1 and MUI2 use exactly the same commands. Only the internal implementation is different (IO vs nsDialogs), and MUI2 adds some variables for nsDialogs-based welcome/finish page customization.

The MUI_LICENSEPAGE define was never used by MUI, as far as I know. It probably never did anything.


Originally posted by T.Slappy
!insertmacro MUI_PAGE_LICENSE "License.rtf"
take a good look, that's exactly what i've been using in the last line. apparently and for unknown reason, there was a define that does nothing - and it had nothing to do with nsis no longer compiling my script.