No announcement yet.

problem with Custom UI from a tutorial

  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with Custom UI from a tutorial

    I was following this tutorial [Using HM NIS Edit to create custom pages] and when I tried to compile it with the code below I got that error (the quoted text)


    The Resulting .nsi script
    View Source

    !error: MUI_INSTALLOPTIONS_* macros are no longer a part of MUI2. Include InstallOptions.nsh and use INSTALLOPTIONS_* macros instead. It is also recommended to upgrade to nsDialogs.
    Error in macro MUI_INSTALLOPTIONS_EXTRACT_AS on macroline 2
    Error in script "C:\Users\Luciano\Documents\NSIS custom page tutorial\WelcomeFinish.nsi" on line 12 -- aborting creation process
    then I fixed the code according to the log, and now I get this new error. (which i dont know how to fix.)


    The .nsi script after the changes
    View Source

    File: "UserPass.ini"->"$PLUGINSDIR\UserPass" [compress] 241/475 bytes
    !insertmacro: INSTALLOPTIONS_WRITE
    WriteINIStr: [Settings] RTL=$(^RTL) in $PLUGINSDIR\UserPass
    !insertmacro: end of INSTALLOPTIONS_WRITE
    !insertmacro: end of INSTALLOPTIONS_EXTRACT_AS
    Name: "Modern UI Test"
    OutFile: "WelcomeFinish.exe"
    InstallDir: "$LOCALAPPDATA\Modern UI Test"
    InstallRegKey: "HKCU\Software\Modern UI Test\"
    !define: "MUI_ABORTWARNING"=""
    Function: "UsernamePasswordPage"
    !insertmacro: MUI_HEADER_TEXT
    !insertmacro: end of MUI_HEADER_TEXT
    Push: $0
    File: "InstallOptions.dll"->"$PLUGINSDIR\InstallOptions.dll" [compress] 8005/14848 bytes
    Plugin Command: dialog $PLUGINSDIR\UserPass
    Pop: $0
    Pop: $0
    !insertmacro: end of INSTALLOPTIONS_DISPLAY
    !insertmacro: INSTALLOPTIONS_READ
    Usage: ReadINIStr $(user_var: output) ini_file section entry_name
    Error in macro INSTALLOPTIONS_READ on macroline 2
    Error in script "C:\Users\Luciano\Documents\NSIS custom page tutorial\WelcomeFinish.nsi" on line 49 -- aborting creation process
    BTW: This is the .ini file for the page ui

    Could somebody tell me what am I doing wrong, and what would be the right way to do it?

  • #2
    InstallOptions works with MUI1, so you can probably go back to the first script you pasted and include mui instead of mui2.

    But much more than that you should use nsDialogs. InstallOptions and MUI1 are deprecated. This means that HM NIS edit is also deprecated. There's actually a nice dialog designer GUI for nsDialogs these days, if you don't want to code your custom pages manually (see NSIS Dialog Designer thread).


    • #3
      Thanks for the advise, I will start to read some docs!!