Old 25th June 2011, 05:49   #1
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Question [Page] Allow user to enter URL or choose default

Hello

How do I create a page allowing user to enter in the URL to download a .zip archive?

I want either a default URL where you can see the text (but user can edit) or a dropdown menu or radio buttons to choose between Default and Enter URL.

I will be using the InetC plugin.

How can I build this interface? (I will be using NSIS MUI)

Thanks in advance for any suggestions,

Chip D. Panarchy
Panarchy is offline   Reply With Quote
Old 25th June 2011, 10:13   #2
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
You need to create a custom page with nsDialogs. The nsDialogs readme has an excellent tutorial: http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html
MSG is offline   Reply With Quote
Old 26th June 2011, 12:33   #3
Panarchy
Member
 
Join Date: Nov 2008
Posts: 72
Exclamation

Thanks, that method worked for the non-MUI interface, but I can't seem to get it working in MUI...

Can someone take a look?

Thanks,

Chip D. Panarchy




code:
!include nsDialogs.nsh
!include LogicLib.nsh

!include "MUI2.nsh"

Name "BOOST Library Installer"
OutFile "Boost installer.exe"

InstallDir "$INSTDIR"
InstallDirRegKey HKCU "Software\Boost" ""

RequestExecutionLevel user
XPStyle on

!define MUI_ABORTWARNING

!insertmacro MUI_PAGE_LICENSE "${NSISDIR}\Docs\GPL.txt"
!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "Please enter boost download URL (zip)"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

#LangString PAGE_TITLE ${LANG_ENGLISH} "Title"
#LangString PAGE_SUBTITLE ${LANG_ENGLISH} "Subtitle"

#Function CustomPageFunction
#!insertmacro MUI_HEADER_TEXT $(PAGE_TITLE) $(PAGE_SUBTITLE)
#FunctionEnd

!insertmacro MUI_LANGUAGE "English"

Var Text
Var Text_State

Section "Dummy Section" SecDummy
SetOutPath "$INSTDIR"
#download $Text $TEMP
#unzip $TEMP\boost_1_46_1.zip
#run bjam.exe, set prefix to $INSTDIR

WriteRegStr HKCU "Software\Modern UI Test" "" $INSTDIR
WriteUninstaller "$INSTDIR\Uninstall.exe"
SectionEnd

Page custom nsDialogsPage nsDialogsPageLeave

Section "Uninstall"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\Modern UI Test"
SectionEnd

Function nsDialogsPage
StrCpy $Text_State "http://sourceforge.net/projects/boost/files/boost/1.46.1/boost_1_46_1.zip/download"

${NSD_CreateText} 0 13u 100% 12u $Text_State
Pop $Text

nsDialogs::Show
FunctionEnd

Function nsDialogsPageLeave
${NSD_GetText} $Text $Text_State
FunctionEnd

Panarchy is offline   Reply With Quote
Old 26th June 2011, 14:49   #4
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
1. You need to put the custom page command inbetween the other page macros.
2. You don't create a custom page in your custom page function. Please follow the tutorial in the nsDialogs readme, as I pointed out before.
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Tags
custom-page, inetc, mui, page, url

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