Skip to content
⌘ NSIS Forum Archive

Help!! How do I add a page that ask for password before user can install?

13 posts

mikaljan#

Help!! How do I add a page that ask for password before user can install?

🤪

How do I add a page that ask for password before the user can install the program??

Thank you!!!
kichik#
You search the archive for the word password and find:


😉
mikaljan#
Is it possible to do this in Modern User Interface?

🧟

Is it possible to do this in Modern User Interface??


Thanks for your help!
Joel#
Like this:


!include "MUI.nsh"
!define MUI_CUSTOMPAGECOMMANDS
!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_FINISHPAGE
!insertmacro MUI_SYSTEM
!insertmacro MUI_PAGECOMMAND_WELCOME
Page custom MyPage ": Page title"
!insertmacro MUI_PAGECOMMAND_LICENSE
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGECOMMAND_INSTFILES
!insertmacro MUI_PAGECOMMAND_FINISH
!insertmacro MUI_LANGUAGE "LangFile"
mikaljan#
Another question

🤪

I have another problem, when I do the following:

!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE

!insertmacro MUI_SYSTEM
!insertmacro MUI_PAGECOMMAND_LICENSE
Page custom SetCustom ": User name and password"
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGECOMMAND_INSTFILES
!insertmacro MUI_PAGECOMMAND_FINISH

The program went through the entire installation process once, then the second time around it does what I wanted... which is to display the password page after the license page.

Why is that? and how do I fix it? thanks!!!
kichik#
Put it in its right position between the !insertmacro MUI_PAGECOMMANDs, not between the defines. Have a look in the example I told you about before.
Joel#
Re: Another question

Originally posted by mikaljan
🤪

I have another problem, when I do the following:

!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE

!insertmacro MUI_SYSTEM
!insertmacro MUI_PAGECOMMAND_LICENSE
Page custom SetCustom ": User name and password"
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGECOMMAND_INSTFILES
!insertmacro MUI_PAGECOMMAND_FINISH

The program went through the entire installation process once, then the second time around it does what I wanted... which is to display the password page after the license page.

Why is that? and how do I fix it? thanks!!!

!include "MUI.nsh"
!define MUI_CUSTOMPAGECOMMANDS
!define MUI_WELCOMEPAGE
!define MUI_LICENSEPAGE
!define MUI_COMPONENTSPAGE
!define MUI_DIRECTORYPAGE
!define MUI_ABORTWARNING
!define MUI_UNINSTALLER
!define MUI_UNCONFIRMPAGE

!insertmacro MUI_SYSTEM
!insertmacro MUI_PAGECOMMAND_LICENSE
Page custom SetCustom ": User name and password"
!insertmacro MUI_PAGECOMMAND_COMPONENTS
!insertmacro MUI_PAGECOMMAND_DIRECTORY
!insertmacro MUI_PAGECOMMAND_INSTFILES
!insertmacro MUI_PAGECOMMAND_FINISH
mikaljan#
Yes!!

🙂 it works now!! Thanks!

But I get this message when I compile the script:

1 warning:
install function "mui.Welcome" not referenced - zeroing code (0-39) out

🧟

Is that gonna affect anything??

Also, Is there a way to add graphics in Modern User Interface?
and Change the Install Program's Icon??

Thanks!!
🙂
kichik#
You have MUI_WELCOMEPAGE defined but you don't use the welcome page, that's why you get the warning. To change the icon define MUI_ICON and MUI_UNICON as stated in the MUI readme. To add graphics change the UI and use SetBraindingImage.
mikaljan#
thanks again

So I have to change the UI?? I can't add graphics to... let's say.. left side of the MUI?😱