Skip to content
⌘ NSIS Forum Archive

help button for pages needed

39 posts

norial#

help button for pages needed

Hello,

it could be very helpful to add a 'help' button to each installation page with a user defined text. so all addditional infos could be placed in this text box. This help text must be opened by clicking on the button or pressing F1.

Or it's already possible? How?

regards
norial
Joost Verburg#
You would have to modify the source code.

Usually the page text should give enough information, seperate help pages are not that user friendly.
norial#
why not?

there is only place for a short text. and why additional info are not that user friendly?
normally noboby reads this text (normally reads any installastion text and klick only 'next') but sometimes a user needs a explination of some words or options.

regards
/norial
DrO#
is this the sort of thing you're looking for?

it is very basic (no config and a hacked around example) at the moment but if you click on the button or press f1 then a little window will pop up. if the 'info' window is already open then it will be brought back to be active again.

still working on how best to implement the setting of the button onto the pages and it's interacting with the running installer.

note 1: the installer will hang if you press f1 with a messagebox open at the moment (not sure if i'm handling messages, etc correctly)

note 2: if the info window is open when the installer is closed then it likely to cause a crash

note 3: not all parts of the button will react at the moment due to it overlapping other controls on the dialog

basically this is just a test to see if it'll work and to check how the handling of the nsis window works for such a feature

-daz
norial#
Hello daz,

Originally posted by DrO
[B]is this the sort of thing you're looking for?
it's exactly what I need. Is this the first release ? You gave some extra infos about possible problems. Do you like to fix the problems?

I believe there only a few options needed. e.g button text, info text (formated? means normal text an bold or italic text).

thanks for your help
DrO#
glad i got the correct idea of what you meant 😉
Is this the first release ?
more of a test version to just see how feasible it is to do.

i should have a few more bits done by monday (bit busy with work and things at the moment).

will get it to be configurable but not entirely sure what you mean with the formatted bit.
do you mean the text will be normal or italic or bold
or
(normal and bold) or (normal and italic)?

parameters i'm likely to have for the next release will be:
button_position button_text info_text
e.g.
"0,0" "blah" "information is a killer"

note: "0,0" would put it in the top left corner (may make the button be autosized to the passed text length)

-daz
DrO#
updated a few bits so that this is now more configurable to use ie font is taken from the installer, button can be repositioned, etc.

problem is that when a page is finished, the installer will crash if the 'end' function is used (don't use for the moment). posting more to see how the font placement, etc works on other systems.

-daz

ps
@the devs: when a page is changed, is the window proc being altered? asking since i can never get the 'end' function to successfully unsubclass the window - seems to be trying to access memory from where the dll was mapped into the address space even though i've restored the original window proc i had 🙁

thanks
DrO#
ooops, forgot to attach 😢
kichik#
Originally posted by DrO
@the devs: when a page is changed, is the window proc being altered? asking since i can never get the 'end' function to successfully unsubclass the window - seems to be trying to access memory from where the dll was mapped into the address space even though i've restored the original window proc i had 🙁
There are two window procs, one for the outer dialog and one for the inner dialog. The problem you're having is probably caused by unloading the plug-in in the leave function which is called when processing a windows message. That message is sent to the dialog by no other but your own plug-in. When the control returns to your plug-in's code it's no longer there, and that causes the crash. Sub-classing is so wonderful, don't you think? 🙂
DrO#
Sub-classing is so wonderful, don't you think?
i know what you mean 😉

thought that might be the case. with plugins, the hwndParent is the outer dialog (which i'm hoping is right) since that's the one i've been subclassing.

in the code, i have in the start function the plugin using loadlibrary to keep the plugin loaded (removing the need for the /nounload) and then doing the required freelibrary in the end function after it all return values indicate i have unsubclassed the window.

will have a better look at the installer exe source later on i think to see better what's going on

thanks for the info kichik

-daz
DrO#
finally worked out how to get around the problems with the plugin crashing (window hooks, doh! but no more subclassing 😁)

now it is possible to get a button onto any page and fixed the message deadlocks from the initial release when the installer was not the active window (messageboxes, etc). now it will allow the 'f1' to work when a messagebox is open.

will post the latest version soon (need some testing on other systems to make sure that the dll is freed correctly so the plugins directory of the installer can be correctly removed on close)
[would have posted it now but i brought the wrong version with me 😱 )

@kichik - the info was much appreciated 🙂 found the message id for a page change which makes it able to automatically unhook a page without calling other functions, cheers for the pointer

-daz
DrO#
latest version attached (check the example script on how to use)

works on 2k and 98 (just ran on the work machine and it crashes - NT4 🙁)

can people please test so i can get an idea of what is / isn't wrong with the code, thanks

-daz
DrO#
attached is a test version of the dll, can people with NT systems test it please

it will put up messageboxes to show where in the startup process things are (also will beep when the dll is loaded and unloaded).

tried it on a NT test machine and now it does not crash but on loading it will cause the installer to exit immediately
(wierd how all other oses i've tried the code on work fine 🤪 )

thanks
-daz

p.s. the code shown will cope with reading text and rtf files now by using /file=blah.rtf in the window text parameter (see earlier posts for an example script) and i'm working on html display.
just a pain that it's not running correctly with NT 🙁
DrO#
a few versions later and now the NT4 issue is fixed 🙂 (see below for reason)

i'm putting the updated version up in a bit after i get a readme on how to use it done.

overall features are:[list=1][*]add a button onto a page where you want it to go (resizes to the text)[*]define your own button text e.g. "Help" or "Readme..."[*]show text you set in the script or use a file[*]support for plain text and rich text files[*]basic support of showing a html file (still need to correctly embed the window)[*]opens the window when pressing 'F1'[/list=1]the reasons for the crashing under NT4 where related to trying to hook the window in the dll which it doesn't seem to like doing when the hook function is in the dll calling it (though it works fine under all other oses tested 😔 ).

the reason for this was trying to drop the need for a /NOUNLOAD to be used for all calls but i guess it wasn't meant to be 🙄

now i've gone back to a hybrid of the earlier code which just subclasses BUT i've improved the handling so it will now cope with the 'show' function being called in the page's leave function (useful for getting a button shown once the install has completed 😎 )

-daz
DrO#edited
new release, mmmmm tasty

attached is the latest version 🙂 (both the dll and an example installer with it in use)

see above for what it can do and check out the example for an idea of how to use the plugin.

more info will be available soon (proper readme file and also an archive page -> off to do that now)

-daz

[edit]
now in the archive here so check it out for how to use the plugin 😎
[/edit]
kichik#
Great, good job 🙂

But why is there no source code? 🙁

BTW, you can link directly to the attachment from the Archive, no need to link to the thread itself.
DrO#
Originally posted by kichik
But why is there no source code? 🙁
forgot to bring the files with me 🙁 will have it up for the next version + need to make it readable (other than by me 😉 )

forgot about a direct link (was trying to get at least something on the archive before leaving work), thanks for the pointer though

-daz
DrO#
by the power of greyskull....

version 0.9 attached

changes to the plugin are:[list=1][*]fixed a few crash issues with related to string lengths 🙁[*]button is now hidden if no text is passed for the title[*]FULLY integrated webbrowser control (now it acts like the text window 😎 )[*]source code provided for your viewing pleasure[/list=1]the project assumes it is in .\contrib and the plugin will go into .\plugins for those of you interested and the example files are all in there too

-daz
norial#
Re: by the power of greyskull....

Hello !

How can I use the Plugin with Modern UI
!insertmacro MUI_PAGE_WELCOME start

Function start
HelpButton::show /NOUNLOAD "246,231" "blah blah blah" "built to the power of the llama ^o^" "/html=$EXEDIR\winampmb.htm"
FunctionEnd

Gives an error: !insertmacro: macro "MUI_PAGE_WELCOME" requires 0 parameter(s), passed 1!

Must I modify system.nsh directly?
Comm@nder21#
u need to define the function in other way:
!define MUI_PAGE_CUSTOMFUNCTION_PRE start
!insertmacro MUI_PAGE_WELCOME
...
Mæster#
It seems there are still several "problems" of this plugin together with the Modern UI:

(1)The button is not displayed the XP styled way.
(2)It seems that every window-refresh unloads the button espeacially a refresh of an InstallOptions-Dialog, so u have to call the HelpButton::show - method at least in every show and leave-function.

Anyway - keep up the good work.
Hope there will be some new versions in the future.

Greez.
DrO#
there should be a 1.0 out in the next few days which adds in chm support, more control over the positioning of the window (for both the chm window and the one the plugin makes) plus a few other tweaks, etc.

there was the xp issue which may be sorted now as well (not too sure since i still don't have an xp install to run on myself but the last screenshot i got from a recent test build showed the button was xp themed *shrugs*

anyhoo, expect a v1.0 soon 👍

-daz
HansH#
Originally posted by DrO
there should be a 1.0 out in the next few days which adds in chm support, more control over the positioning of the window (for both the chm window and the one the plugin makes) plus a few other tweaks, etc.

anyhoo, expect a v1.0 soon 👍

-daz
I was looking for just this feature (chm) and I found the 0.9 version, but no 1.0 version.

Any change of getting a 1.0 version ?

thx

Hans
DrO#
i've been a bit side tracked with work so the 1.0 release is a few days behind. if i can i'll do it sunday night (depends on work and 'real life' giving me the time to sit down and do some coding 🙂 ) otherwise it'll be monday night

-daz
DrO#
Help Support plugin v1.0 RC1

download 1.0 RC1

archive reference page for 0.9 sytnax

main changes are that you can now use /help to use chm files e.g. "/help=${NSISDIR}\nsis.chm"

as well it's now possible to specify the top left corner of the window as "x,y" or center (centers in the middle of the desktop) or centerp (centers in the middle of the installer).

and also the size of the window can be set via "width,height" after the top left corner value.

until it's documented/tweaked any of the new parts not used need to be set as "" in the script where you'd otherwise place the information. depending on feedback, etc i'll potnetially modify this and i will update the help file about this in the next day or so

syntax example:
HelpButton::show /NOUNLOAD "232,231" "?" "" "/help=${NSISDIR}\nsis.chm" "" "" "centerp" "500,500"

this will place a '?' button to the left of one of the 'back' button in a classic UI installer and open the nsis.chm file centered over the installer window and 500x500 pixels in size

-daz