Old 26th January 2011, 08:59   #1
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Question Customized Page - (From the beginning)

Hey,

After a lot of different questions, help from you guys, searching at the web i finally think that my installer is beginning to look just like it should.

The hardest and most difficult for me to understand is how to get a customized page to work the way i need it to, i have been looking at the nsDialog Readme and have been trying to create a page out from that. But i do not seems as easy as i might had thought!

The things i need on this page is a headerimage that follow the same like on the standard pages, i need the little text above the headerimage, and the same to the right. I basically need the same design as the other pages. You could even say i need a copy of the welcomepage, with some modification. I do not not if you can copy the standard welcomepage and modify it? I need for the page to show the directory i am putting my files, not a browser but just the path so you can see it, and some text above and under, i need and next and cancel button, just so you might have and idea!

I have been searching the web and found people that have build there own pages, but the code just looks to confusing.

!include nsDialogs.nsh
!include LogicLib.nsh
!include MUI2.nsh

Name nsDialogs
OutFile nsDialogs.exe

#XPStyle on

Var Dialog
Var Label
Var Text

Page custom nsDialogsPage
!insertmacro MUI_PAGE_INSTFILES

Function nsDialogsPage

nsDialogs::Create 1018
Pop $Dialog



${NSD_CreateLabel} 0 0 100% 12u "Hello, welcome to nsDialogs!"
Pop $Label

${NSD_CreateText} 0 13u 100% -13u "Type something here..."
Pop $Text

${NSD_CreateBrowseButton} 0 120u 100% "Path:"
Pop $Browse

nsDialogs::Show

FunctionEnd

Section

DetailPrint "hello world"

SectionEnd

Is some i have tried, here just to see if u could add a BrowserButton, but i have no idea if it uses "Pop" or have the things are placed with the "u" even what "100%" does.

Is there any of you that have the time to help, or maybe have a guide that goes more down in details, it could be so nice!

Ill keeping looking and see if i can find something my self.

-Aaskilde
Aaskilde is offline   Reply With Quote
Old 26th January 2011, 14:28   #2
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Hey,

I am know trying to get a page up and running i have created a custompage very easy, just with this script:

Function nsDialogsPage

nsDialogs::Create 1018
Pop $0

${NSD_CreateLabel} 10u 5u 100% 100u "Install Neo.Dashboard 4.3 to:$\r$\n$\r$\nroot:\Lotus\Domino\Data\Domino\html\$\r$\nroot:\Lotus\Domino\Data\$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\n$\r$\nClick install to begin the installation, click Back.$\r$\nClick Cancel to exit the wizard."
Pop $0 Label

nsDialogs::Show

FunctionEnd
______________________________________________



In this image i post have a marked a red square, the text in that square is something i need to get edited, the page before my custompage is a licensepage and it seems like it taking the text with it on the custompage, how can i make it so i can edit it myself?

-Aaskilde
Aaskilde is offline   Reply With Quote
Old 26th January 2011, 16:46   #3
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 484
Send a message via ICQ to Pawel
First of all, check this page: http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html

To change Title and Subtitle, you should use this:

PHP Code:
Function FunctionName

    
!insertmacro MUI_HEADER_TEXT "YourTitle" "YourSubtitle"
    
nsDialogs::Create 1018
    Pop 
$0

    
${If} $== error
        Abort
    
${EndIf}
...

    
nsDialogs::Show

FunctionEnd 
Pawel is offline   Reply With Quote
Old 26th January 2011, 17:58   #4
blh83
Junior Member
 
Join Date: Aug 2010
Posts: 29
I have attached an example of a page that I created (I will explain it a little in a second). It is fairly heavily commented to give an idea of what is going on. As far as looking like the welcome page, by default when you create a page with nsDialogs I believe it will inherit the header images and other global stylings and have a Back, Next, and Cancel button.

First, my page is created by the function ConfirmInstall and has a leave function called ConfirmInstallLeave. This is the first line of the attached example.

The first line in the ConfirmInstall function sets the text in the header image. I am not sure if you are trying to set that text or the text in the bar above the image. If you are trying to set it in the bar, you may have to use System::Call to set the text.

Next I create the page using nsDialogs::Create 1018 and store it in $confirmDialog by popping the newly created dialog off the stack. I then change the font and background color of the whole page.

I then create a label and set it's color background color and text color to match the background of the rest of the page. Finally, I create a checkbox and set its state depending on whether or not this is the first visit to the page, and if it's not, set its state to whatever the user had it as when they left the page last.

The leave function stores the state of the checkbox so I can check it if the user returns to the page again.

The 'u' and '100%' are what sets sizing of the different elements. If you use 'u' then it means use dialog units. This allows for proper scaling no matter what DPI a user has their resolution set to. I would recommend using the 'u' instead of percentage unless you want it to span the entire size, in which case use 100%. See the attached example where I use 'u' and 100%

I hope this helps. I will check back a couple of times so if you have any questions about what I have provided, I will be happy to help as best I can.
Attached Files
File Type: nsi ExamplePage.nsi (2.5 KB, 627 views)
blh83 is offline   Reply With Quote
Old 27th January 2011, 09:40   #5
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Quote:
Originally Posted by Pawel View Post
First of all, check this page: http://nsis.sourceforge.net/Docs/nsDialogs/Readme.html

To change Title and Subtitle, you should use this:

PHP Code:
Function FunctionName

    
!insertmacro MUI_HEADER_TEXT "YourTitle" "YourSubtitle"
    
nsDialogs::Create 1018
    Pop 
$0

    
${If} $== error
        Abort
    
${EndIf}
...

    
nsDialogs::Show

FunctionEnd 

Can't say anything but perfect! Wounder a bit why i didten find this, but i have found out that when i need a bit of code to do one thing, i search and search then i get pointet in the direction and it is easy to see. But thanks a lot this solved my problem 100%!
Aaskilde is offline   Reply With Quote
Old 27th January 2011, 09:43   #6
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
blh83

Hey,

I tried ur script but it didn't work for me i had some different errors while running it, first a Pop and then i disabled it and then i got a IfEnd error, but i got my problem fixed with the "!insertmacro MUI_HEADER_TEXT "YourTitle" "YourSubtitle", but thanks a lot for the time you putted into trying and helping me, i appreciate it
Aaskilde is offline   Reply With Quote
Old 27th January 2011, 12:13   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,377
It is a good idea to look at the example scripts. They all demonstrate this kind of stuff (including MUI_HEADER_TEXT).

Stu
Afrow UK is offline   Reply With Quote
Old 27th January 2011, 12:19   #8
Aaskilde
Junior Member
 
Join Date: Jan 2011
Posts: 35
Ya okay, i have been looking at them a lot but misses the things i need in my scripts. But i have finished my installer now, and it really looks great!

Thanks for all the help for now! I am sure off that i will be back soon
Aaskilde is offline   Reply With Quote
Old 27th January 2011, 16:30   #9
blh83
Junior Member
 
Join Date: Aug 2010
Posts: 29
Glad to hear you got it working. I apologize that I wasn't more explicit, but my example wasn't intended to be compilable. It was a snippit from a larger script meant to show an example of a custom page. Sorry about that.
blh83 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