- NSIS Discussion
- .scr to .exe question
Archive: .scr to .exe question
stepan
20th October 2002 01:57 UTC
.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
Dick4
20th October 2002 06:23 UTC
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
stepan
20th October 2002 15:51 UTC
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
kichik
20th October 2002 18:06 UTC
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.
Dick4
21st October 2002 01:32 UTC
heh, good thinking Kichik...
stepan
12th November 2002 01:59 UTC
Thanks a lot - that did the job... :) :) :)
nickjohnston
12th October 2003 14:50 UTC
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
kichik
12th October 2003 15:38 UTC
Not that I know of.
nickjohnston
12th October 2003 18:38 UTC
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
Joost Verburg
12th October 2003 19:21 UTC
Should be possible using the System plug-in. However, window finding will be difficult with localized Windows versions.
kichik
13th October 2003 12:31 UTC
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.