Archive: Show register screen at the end of installation


Show register screen at the end of installation
Hello folks,

What I need is show a screen (something like a big MessageBox) to user when he finish the installation.

This screen will contain an image (banner) on the top, a text asking for register on website, and a button "register now" on the bottom.

I'm thinking to call a MessageBox on ".onGUIEnd", but i'm not sure if is possible add an image and resize to make it bigger, maybe the same size of an insall screens.

Someone can help me on this one? ;)

Thanks in advance!


nsDialogs

Stu


Why not send the user directly on a web page ? (use ExecShell)
If that's too intrusive, you can have a checkbox on the last page "Register online" which sends the user to the web page


Thanks for quick replys guys!

Originally posted by Afrow UK
nsDialogs

Stu
Got it.
But one question: Using nsDialogs, is it possible remove the "footer" that contain "Next", "Finish", and other buttons? I really need a clean page.


Originally posted by Wizou
Why not send the user directly on a web page ? (use ExecShell)
If that's too intrusive, you can have a checkbox on the last page "Register online" which sends the user to the web page
I'm already thought on it, but my client prefer this way =/

You can hide the buttons, the branding text and the horizontal ruler (static) controls using ShowWindow & ${SW_HIDE} (the control id's are in modern.exe; use Resource Hacker). If you want to then make the custom page fill the entire window you will have to resize the custom page rect (which is also in modern.exe) using SetWindowPos. All the controls are in modern.exe dialog 105.

Stu


Originally posted by Afrow UK
You can hide the buttons, the branding text and the horizontal ruler (static) controls using ShowWindow & ${SW_HIDE} (the control id's are in modern.exe; use Resource Hacker). If you want to then make the custom page fill the entire window you will have to resize the custom page rect (which is also in modern.exe) using SetWindowPos. All the controls are in modern.exe dialog 105.

Stu
Thanks for your help Stu, but I'm still having some issues to hide the controls.
I found the buttons id's, but i'm not sure how to use ShowWindow command.
For example, the id of Cancel button is 2. I will call ShowWindow on pre function, corrent?
I need to execute any other command before it?
And what is the correct syntax of ShowWindow? ShowWindow "2" ${SW_HIDE}

Originally posted by adum
Thanks for your help Stu, but I'm still having some issues to hide the controls.
I found the buttons id's, but i'm not sure how to use ShowWindow command.
For example, the id of Cancel button is 2. I will call ShowWindow on pre function, corrent?
I need to execute any other command before it?
And what is the correct syntax of ShowWindow? ShowWindow "2" ${SW_HIDE}
As you can read in the ShowWindow manual entry:
http://nsis.sourceforge.net/Docs/Cha...html#4.9.14.17
...ShowWindow requires the control's HWND, not a control id, as a parameter.


You can use the GetDlgItem command to get a HWND from an ID: http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.14.6

Thanks a lot guys, this works.. But unfortunately it will be useless, because the customer ask to add a checkbox on the last screen... oO

This is a bit easier, if don't has a detail:
Some steps before, the user selects the store where he bought the disk, and depending the store, the checkbox will be showed or not.

Is it possible control the !define's on runtime? Depending the store selected (using something like StrCmp), checkbox will be showed or not?

If not, what I think to do now is hide this checkbox using ShowWindow & ${SW_HIDE}, but I can't find the finish screen to get checkbox ID. Where the finish screen is located?

Thanks one more time =]


Look in Contrib\Modern UI 2\Pages\Finish.nsh. The finish page is made with nsDialogs and there will be a dedicated variable containing its handle.

Stu


Nice, I find it. But how can I recover the variable to manipulate on my script?

I'm trying to do something like this:


!define MUI_PAGE_CUSTOMFUNCTION_PRE PreFinishFunction
!insertmacro MUI_PAGE_FINISH

Function PreFinishFunction
StrCmp $STORE "StoreName" hide show ;check if checkbox will show or not
hide:
ShowWindow $mui.Finishpage.Run ${SW_HIDE}
show:
FunctionEnd


But mui.Finishpage.Run was unknown. Any idea?

Aditionally, when the checkbox is hided, i need to uncheck it or hide is enough? Case I need to uncheck, how can I do this? Using SendMessage?

Thanks one more time =]

Use a SHOW function not a PRE.

Edit: nsDialogs has a macro to check/uncheck. You need to do it yes.

Stu


ok, i have changed to SHOW function.
I have one more issue. Problably the last one.. ^^

How can I "get" the checkbox ?
To use NSD_Uncheck and ShowWindow I need the HWND. I know how to get it when I have the control ID, but in this case I haven't the id =/


You seem to have ignored or misunderstood what I said. $mui.FinishPage.Run DOES contain the handle to the check box. Also you can't expect it to work in a pre function (MUI_PAGE_CUSTOMFUNCTION_PRE) because that is before the page is created. You want MUI_PAGE_CUSTOMFUNCTION_SHOW.

Stu


Now i'm feeling a noob.. lol
Maybe I'm not so specific in my question. I have understood why use SHOW function, not PRE.
My issue is the follow: when I call ShowWindow to hide checkbox, the parameter I need to pass is mui.FinishPage.Run, correct? THis way:

ShowWindow $mui.Finishpage.Run ${SW_HIDE}


But when I compile the script, it show me a warning, probably because this var is for finish.nsh, not mine:
Unknow variable/constant mui.FinishPage.Run

I need to do anything before use it? Need to retrieve it?

Sorry to annoy you so much, but i'm very confused at this point..

Variables in NSIS are global. Perhaps you are using MUI not MUI2?

Stu


Oh crap... In fact I'm using MUI (not MUI2)...

Is it possible do this on MUI? I'm using some ini files, and will be a pain change all my scripts(it's more than one I need to do this change)


Read the section "To upgrade a Modern UI 1.8 script, you should" in the MUI2 readme.

Stu


Finally it works

Thanks a lot for your help guys, specially you Stu =]


No problem :)

Stu