Old 21st May 2009, 08:35   #1
kamikaze09
Junior Member
 
Join Date: May 2009
Posts: 3
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
Attached Files
File Type: nsi new_code.nsi (5.6 KB, 139 views)
kamikaze09 is offline   Reply With Quote
Old 21st May 2009, 11:24   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 21st May 2009, 14:57   #3
kamikaze09
Junior Member
 
Join Date: May 2009
Posts: 3
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:

code:

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

code:

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

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
kamikaze09 is offline   Reply With Quote
Old 21st May 2009, 16:04   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 23rd May 2009, 19:52   #5
kamikaze09
Junior Member
 
Join Date: May 2009
Posts: 3
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
kamikaze09 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump