Archive: MUI_WELCOMEPAGE problems


MUI_WELCOMEPAGE problems
Hi,

I'm new to the forums and new to developing using NSIS for creating an installer. I have searched the forums and read the wiki and the NSIS manuals, but I can figure out why my Welcome and Finish page do not have anything in them! Not even the title and text that I assigned to it! I think there is something I'm missing (between the manuals and the example scripts I thought I was doing everything right). Here is my set up.

**not sure if there is a format for posting code here so forgive me!***

Start
!define MUI_PRODUCT "Vmerse 1.0"
!include "${NSISDIR}\Contrib\Modern UI\System.nsh"

;--------------------------------------------------------------

;General

# The name of the installer
Name "Vmerse"
Caption "Law School Vmerse Installer"
XPStyle On

!define MUI_ABORTWARNING

# The file to write
OutFile "Vmerse-setup.exe"

!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall-colorful.ico"

;--------------------------------------------------------------------------
;Header
!define MUI_UI_HEADERIMAGE "${NSISDIR}\Contrib\UIs\modern_headerbmp.exe"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\nsis.bmp"

!define MUI_UI "${NSISDIR}\Contrib\UIs\modern.exe"
;--------------------------------------------------------------------------------
;Modern UI Configuration

; Pages
!define MUI_WELCOMEPAGE_TITLE "Welcome to the MyApplication Setup Wizard"

!define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of my test application.\r\n\r\n$_CLICK"
!insertmacro MUI_PAGE_WELCOME

!define MUI_LICENSEPAGE_TEXT_TOP "My End Users License Agreement"
!define MUI_LICENSEPAGE_RADIOBUTTONS
!insertmacro MUI_PAGE_LICENSE "my-eula.rtf"

!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!define MUI_FINISHPAGE_RUN "$INSTDIR\MyApp.exe"
!define MUI_FINISHPAGE_RUN_TEXT "Launch My Application"

!define MUI_FINISHPAGE_SHOWREADME "README.txt"
!define MUI_FINISHPAGE_SHOWREADME_TEXT "View Readme"
!define MUI_TEXT_FINISH_SHOWREADME "README.txt"
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH

I also have some functions defined (which I'm not sure if they are conflicting) at the end of my script

Function .onInit
# the plugins dir is automatically deleted when the installer exits
InitPluginsDir
File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\Graphics\Wizard\mysplash.bmp"
splash::show 6000 $PLUGINSDIR\splash

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normal, and '-1' if some error occured.

IfFileExists "$INSTDIR\MyApp.exe" Ask_Question
Goto INSTALL
Ask_Question:
MessageBox MB_YESNO "You seem to have this program \
already installed. Would you like to \
uninstall it first?" \
IDYES UNINSTALL IDNO INSTALL

UNINSTALL:
ExecWait '"$INSTDIR\Uninstall.exe"'

FunctionEnd


Function un.onInit
MessageBox MB_YESNO "This will uninstall my application. Do you wish to continue?" IDYES NoAbort
Abort ; causes uninstaller to quit.
NoAbort:
FunctionEnd

Function un.onUninstSuccess
MessageBox MB_OK "You have successfully uninstalled ${MUI_PRODUCT}."
FunctionEnd

;eof

I'm sorry if the post comes out unformatted. Please and thank you for your help!


Put !insertmacro MUI_LANGUAGE "English" after all your !insertmacro MUI_UNPAGE_...

Also, !include "${NSISDIR}\Contrib\Modern UI\System.nsh" is not really necessary. You can use !include "MUI.nsh" to do the same thing.

-Stu


Hi Afrow UK!

Thank you so much for your reply. Maybe I'm still missing something (by the way, if it helps I'm using NSIS 2.0.9)?

What I did was to add !insertmacro MUI_LANGUAGE "English" 4 times. That is, after each MUI_UNPAGE in my script.

I also changed the header file to just be MUI.nsh (should have realized that it referenced the System.nsh header anyway :)).

I did receive compiler errors after addining the !insertmacro line. Here are the errors that I receive.

Error in macro MUI_LANGUAGEFILE_BEGIN on macroline 15
!include: error in script: "C:\Program Files\NSIS\Contrib\Modern UI\Language files\English.nsh" on line 9
Error in macro MUI_LANGUAGE on macroline 5


I looked at the file in question but really couldn't make heads or tails of the error mesage.

Thanks again for your help!


You only need to insert MUI_LANGUAGE once after all MUI_PAGE* and MUI_UNPAGE. Take a look at the examples in Examples\Modern UI.


Hi,

Yes I started with the example, which is why I'm now posting. I followed the example but still get the error message when I add the line !insertmacro MUI_LANGUAGE "English"

Here is the error message I get, it looks like it is happening in the English.nsh header file first.

Error in macro MUI_LANGUAGEFILE_BEGIN on macroline 15
!include: error in script: "C:\Program Files\NSIS\Contrib\Modern UI\Language files\English.nsh" on line 9
Error in macro MUI_LANGUAGE on macroline 5
Error in script "C:\Documents and Settings\jonessm\Desktop\MyApplication\installer.nsi" on line 65 -- aborting creation process

Does this error message look familiar to anyone?

Thank you again for your help!


That's a generic message saying where the error was (execution stack, if you wish). The error itself is at least one line above that.