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


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

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

Thank you!!!


You search the archive for the word password and find:
http://nsis.sourceforge.net/archive/....php?pageid=87

;)


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

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


Thanks for your help!


Yes. Have a look in the InstallOptions example of the Modern UI under Examples\Modern UI.


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"

Another question
:weird:

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!!!


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.


Sorry
Sorry, could you look at the above code again?:(


OK, that's just confusing. Did you edit your post?

You forgot:
!define MUI_CUSTOMPAGECOMMANDS


Re: Another question

Originally posted by mikaljan
:weird:

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

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

:igor:

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!!
:)


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.


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