kamikaze09
21st May 2009 09:35 UTC
Yet another problem with 2nd location directory page
Hello all,
I'm a bit new with NSIS. I'm having some trobule with my nsi script and trying to set a 2nd directory page to install program data.
I attach my original nsi script (with only 1 directory page, the typical), I also attach the new code where I try to code the second directory.
I've followed the example : http://nsis.sourceforge.net/Setting_...ation_for_2nd_(Data)_Directory_Page
and I've also searched the forum but there is no code for a newbie like me.
When I compile my code it says that :
install function "DirectoryShow" not reference - zeroing code
install function "DirectoryLeave" not reference - zeroing code
I'm sure that I'm missing something stupid, but I need some help.
Could anyone point me what i'm doing wrong?
Thank you all in advance
Afrow UK
21st May 2009 12:24 UTC
That page is very outdated. You no longer use !define MUI_DIRECTORYPAGE, and the MUI_CUSTOMFUNCTION_DIRECTORY_* defines are no longer valid. Check the MUI2 documentation on custom functions.
Edit: Also note that the defines have to be placed before the !insertmacro of the page that they need to apply to.
Stu
kamikaze09
21st May 2009 15:57 UTC
Hello Afrow
Thank you very much for your fast response.
I've done some corrections to my code:
- I started using mui2.nsh
- I deleted the: !define MUI_DIRECTORYPAGE since it is not longer needed
- I changed all MUI_CUSTOMFUNTION_DIRECTORY_* to:
!define MUI_DIRECTORY_CUSTOMFUNCTION_PRE FucntionPre
!define MUI_DIRECTORY_CUSTOMFUNCTION_SHOW FucntionShow
!define MUI_DIRECTORY_CUSTOMFUNCTION_LEAVE FucntionLeave
(that is what I understand from the manual
http://nsis.sourceforge.net/Docs/Mod...UI/Readme.html )
After that i do this:
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE
!insertmacro MUI_PAGE_COMPONENTS
Page custom DIRECTORY <---- This is wrong but i dont know how to write it
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
And later, i have the 3 functions
Function FucntionPre
....
FunctionEnd
Function FucntionLeave
....
FunctionEnd
Function FucntionShow
StrCmp $9 "0" AppDirectoryPage
StrCmp $9 "1" DataDirectoryPage
AppDirectoryPage:
StrCpy $9 "1"
!insertmacro MUI_INNERDIALOG_TEXT 1041 "Destination Folder"
!insertmacro MUI_INNERDIALOG_TEXT 1019 "$PROGRAMFILES\${MUI_PRODUCT}\"
!insertmacro MUI_INNERDIALOG_TEXT 1006 "Setup will install ${MUI_PRODUCT} in the following folder.$\r$\n$\r$\nTo install in a different folder, click Browse and select another folder. Click Next to continue."
Goto EndDirectoryShow
....
FunctionEnd
However MUI_INNERDIALOG_TEXT is not found.
I've been working on this all day but no way to understand it how to make it work, and there is no example at all in the new MUI2 tutorial about this, neither in the forum.
I would be very pleased if you or someone could help me with the code. I'm absolutely desperated.
Thank you very much in advance
Afrow UK
21st May 2009 17:04 UTC
As with all other MUI pages, it's !insertmacro MUI_PAGE_DIRECTORY. To have more than one page, you insert it twice then use !define MUI_DIRECTORYPAGE_VARIABLE for the second one to specify a custom variable to use instead of INSTDIR for it.
All this is in the MUI2 readme if you read it.
Stu
kamikaze09
23rd May 2009 20:52 UTC
Hello Afrow UK,
I've tested what you told me and now it is working fine. Now i do not have the code right here, but i will write it here on monday and maybe it will be useful to someone.
Thank you very much for your help