Archive: .scr to .exe question


.scr to .exe question
Hello,

After doing a few unsuccesful searches I've finally run into this forum. I'm trying to make an installer file for my screensaver (.scr)
I got as far as having the file copied into 'windows' directory from the .exe - however, this is where I got stuck.

Normally to install the screensaver, one would have to rightclick on the .scr file, select 'install', which would call up the 'display properties / screensavers' and set the screensaver as 'default screensaver' automatically.

How can I get this working with NSIS installer?

Any tips/suggestions would be much appreciated.
Thank you,

Stepan


I believe you'll need to edit the registry...changing HKCU\Control Panel\Desktop and modifying the "SCRNSAVE.EXE" string value to be the full path to your .scr file.

Similar article from MS here:

http://support.microsoft.com/default...;Q185348#Task1


Thanks for the tip but this seems to be for W2000 only and considered I'll want this to work for 98up at least I think I'll have to find out what the 'display options/screensaver' do or the .scr / install.
:(

anyone else?

step


Taken from HKCR\scrfile\shell\install\command:
rundll32.exe desk.cpl,InstallScreenSaver %l

Using ExecWait 'rundll32.exe desk.cpl,InstallScreenSaver "C:\whatever\myscreensaver.scr"' should produce the same results as right clicking on the .scr file and choosing install.


heh, good thinking Kichik...


Thanks a lot - that did the job... :) :) :)


Still requires user input on Win98

Originally posted by kichik
Taken from HKCR\scrfile\shell\install\command:
rundll32.exe desk.cpl,InstallScreenSaver %l

Using ExecWait 'rundll32.exe desk.cpl,InstallScreenSaver "C:\whatever\myscreensaver.scr"' should produce the same results as right clicking on the .scr file and choosing install.
I'm trying to do the same as the original poster, and just running

rundll32 desk.cpl,InstallScreenSaver "c:\windows\blonde~1.scr"

from a DOS box actually brings up the screensaver dialog with the desired screensaver selected, but the user still has to click OK.

Is there any way of removing this behaviour?

Thanks,

Nick

Not that I know of.


Originally posted by kichik
Not that I know of.
Well, I just had a bit of a thought about this, not sure if it's possbile from NSIS though - could I 'locate' that window by its title (will be different in different versions of the OS though possibly) and then use 'SendKeys' or similar to send keystrokes to the window e.g. ESC?

Thanks,

Nick

Should be possible using the System plug-in. However, window finding will be difficult with localized Windows versions.


It should be possible using FindWindow, GetDlgItem and SendMessage too, without System.dll. Though the best method would probably include a plug-in using hooks (something like DisableMB). You'd still have to find a unique way to identify the dialog but I think GetModuleFileName should be able to help there because the hook would be loaded into the process's memory.