Archive: How to use this windows.


How to use this windows.
How can I make this window using nsis's Instruction.
If modify 'MessageBox' then is it possible?

This Windows
http://edps.cc/pds/me/nsis-windows.jpg

I'm sorry my broken English. :)


The feature you want doesn't exist in NSIS.

You could write a plugin DLL to do it. It wouldn't need much code, a function to display a modeless window, the icon and the text, and another function to dismiss the window (you need two so you can continue to let NSIS run in the background and do your registry stuff).


A DLL won't do the trick here. NSIS automatically unloads the DLL after it exectutes the required function. Make an EXE and use Exec without wait. Do your stuff, and then call your destroy function.

[edit]unloads not uploads :)[/edit]


Okay I see that your suggestion would work KiCHiK but I can't see what's wrong with a DLL in this case. A DLL provides extended functionality on the installation machine, so instead of saying MessageBox you'd say MyCustomMessageBox, and the benefit of it being in the DLL is that it's in the same process and so can be an owned window of the NSIS window. Where am I going wrong?


When the DLL gets unloaded the window will be destroyed.


So are you saying that the DLL is loaded/executed/unloaded for every instruction that uses it. I *thought* it used to persist until the end of the installer and was cleaned up then, that allowed it to have persistent state.


Nope, that's not the way it works :)


If you write a dll to do it for instance, it would have to be responsible for creating the registry entries as well as you can't execwait a dll.


I think a new instruction would solve this, something like
KeepPluginLoaded MyMessageBox.dll

When this instruction is used, the specified dlls will not be unloaded until the installer quits and not directly after the function call.


Originally posted by rainwater
If you write a dll to do it for instance, it would have to be responsible for creating the registry entries as well as you can't execwait a dll.
Not necessary, the dll would have two functions (or one with a switch parameter, or that is context sensitive) so that you make one call to show the dialog, then in NSIS do yer registry stuff, then another call to dismiss the dialog.

Coming in alpha 7... :D


Nice one
If for some reason it doesn't make it I'll be happy to have a go at adding it. By about the end of next week I should have my free time back at last, yay! :P


Ah, the /NOUNLOAD parameter to CallInstDLL is already in the CVS repository. Great work. But does it work with the alternative way to call plugins? Does /NOUNLOAD work there as well?


Not yet :(
I need to think of a way to make this happen... Any ideas?


Weeeelllll you could use a cryptic approach, something like if the command is followed by ! (immediately with no whitespace) then don't unload it, or you could have /NOUNLOAD and if u see that as the first plugin argument obey it and don't send it to the plugin, start the arguments after if u see what I mean, or .... hundreds of other ideas :)


if one of the parameters (or the first, just as you like it) is /NOUNLOAD, then don't unload the dll. If the string /NOUNLOAD should be passed to the DLL for some reason, it has to be quoted.

myfunction /NOUNLOAD
this does not unload the DLL

myfunction "/NOUNLOAD"
this passes /NOUNLOAD as parameter


Quotes gets killed by the pre-processor. If you want to use /NOUNLOAD as a parameter, just push it. Soon to be in the CVS.

[edit]Done.[/edit]


Don't forget to mention use of /NOUNLOAD with the automagical plugin calling somewhere in the docs. I'd add it myself but I have no CVS access at the mo.


Right, almost forgot :D