Archive: Screen mouse pointer


Screen mouse pointer
Before I can show the first window of my NSIS installer, I need to extract the InstallOptions DLL and a few INI files. This takes a few seconds :)

The problem is that the user doesn't see anything while the installer is loading, so it gives the idea that it doesn't work. :(

I would be nice if I could set the mousepointer of the screen to a hourglass. A SetScreenMousePointer function or something like that.

I don't know how I should add this to the NSIS C++ code (I don't know C++ very well). A splash screen / DLL is not possible, because they have to be extracted too, and I need to use very high compression (so a bit slow). Can anyone help me with this?

Thanx!
;)


[edit]Oops... Should have read it until the end :(
If not with a DLL you can use this code in NSIS if you understand how to add functions.[/edit]

Create a DLL with these functions (you have a template in the contrib dir):

SetCursor(LoadCursor(0, IDC_WAIT));
OR
SetCursor(LoadCursor(0, IDC_APPSTARTING));

And to set it back to normal use:

SetCursor(LoadCursor(0, IDC_ARROW));

[edit]Bad idea... You will have to extract this DLL too...[/edit]


Yes, it should be in the installer itself :D

Does Setcursor work for the entire screen?


I think this example will clear it all up:
http://msdn.microsoft.com/library/de...rsors_41pu.asp


The NSIS window is not visible when the cursor should be displayed, so the cursor of the entire screen should be changed. In Visual Basic, I can use:


Screen.MousePointer = vbHourglass

This MSDN info is for the cursor of application window itself I think?

I am not sure it is the best sulotion, but it is the only one I can think of. You can use SetSystemCursor.


Maybe a build-in splash screen is a better idea. Like the one that appears when the installer is doing a CRC check.


Ok, I'll create a dialog resource with a wait dialog for the installer. :)

How can I add an NSIS function to show and hide this dialog?


Ok :D

I've added a function for a nice wait dialog, maybe this is even better than just a mouse cursor. Quite easy to add a function to NSIS. :)

Thanks for the help!


Of course, you could make a small bitmap saying 'Unpacking Installation...' or something like that.

Here's a modified version of Splash that stays there until you send a message to it. Just put this before you do the extractions:

Function .onInit

SetOutPath $TEMP
File SPLASH.EXE
File SPLASH.BMP
Exec '$TEMP\SPLASH 1 $HWNDPARENT $TEMP\SPLASH'

FunctionEnd
...and this code after the extractions are done:
  FindWindow $0 _sp
SendMessage $0 0x300 0 0
[img]images/attach/gif.gif[/img]Attachment: splash_until_cut.zip
This has been downloaded 697 time(s).

Originally posted by petersa
Of course, you could make a small bitmap saying 'Unpacking Installation...' or something like that.

Here's a modified version of Splash that stays there until you send a message to it. Just put this before you do the extractions:
Function .onInit

SetOutPath $TEMP
File SPLASH.EXE
File SPLASH.BMP
Exec '$TEMP\SPLASH 1 $HWNDPARENT $TEMP\SPLASH'

FunctionEnd
...and this code after the extractions are done:
  FindWindow $0 _sp
SendMessage $0 0x300 0 0
[img]images/attach/gif.gif[/img]Attachment: splash_until_cut.zip
This has been downloaded 697 time(s).
Thanks for your info.

As I said, I have already made a build-in splash in the NSIS installer, which appears immediately, without extracting an extrernal splash application. :)

I'm sorry, but I haven't catched this - what is the simplest way to set hourglass cursor for my Modern UI custom page?


Well, this thread is talking about a very specific hourglass cursor shown when the installer starts up, not anywhere in the installer. For the start-up, the splash or banner plug-in are probably the best solution. For anything else, write a plug-in that calls SetCursor.