Archive: Screensaver Registry and more


Screensaver Registry and more
  Hi,
I'm new at NSIS, but I am a programmer in C\C++, so I have a good understanding of computers/code. I am trying to create an install to a screensaver. How would, at the end of the program, set my screensaver to be the current screensaver, and open the control panel for screensaver(otherwise accessed by rightclicking the desktop>properties>screensaver)? What registry key holds the current screensaver info, and how would I open the screensaver settings box? Thanks
Levi


I don't know any official way using the registry, but when I want to install a screensaver I use ExecShell "Install". I would then execute whatever file brings up the display properties ($Sysdir\Something.cpl or $Sysdir\Something.exe).


:) Thanks, I've figured it out. I used ExecShell.
Levi


rubbish ;p
try this

!include "Sections.nsh" 



!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES
page custom Options ; <-- insert only this line
!insertmacro MUI_PAGE_FINISH
>

Section "Set as default Screensaver" SecInfo41

SectionEnd
>

Options

;get user options from sections, setsaver
SectionGetFlags${SecInfo41} $R9
IntOp $SETSAVER $R9& ${SF_SELECTED}

;options
StrCmp $SETSAVER"0" no_default
GetFullPathName/SHORT $R9 "link_to_my_saver.scr"
WriteRegStr HKCU "Control Panel\Desktop" "SCRNSAVE.EXE" $R9
no_default:
>FunctionEnd
>
Some explanation
- you need sections.nsh
- insert new custom page
- insert section (will be shown in MUI_PAGE_COMPONENTS)
- function determines if section selected and do action

Read the manual where to insert each part

this is the right key and it needs 8.3 DOS-name (GetFullPathName /SHORT)
HKCU "Control Panel\Desktop" "SCRNSAVE.EXE"

if you want to open the desktop settings (saver) just exec this
RUNDLL32 shell32.dll,Control_RunDLL desk.cpl,,1

more about the control panel here
http://www.wintotal.de/Tipps/Eintrag...ID=184&URBID=7

if you want to learn more about executing SCR-files open regedit.exe
and examine this key
HKEY_CLASSES_ROOT\scrfile\shell
(config, install, open)