Old 23rd February 2006, 17:43   #1
levj
Junior Member
 
Join Date: Feb 2006
Posts: 3
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
levj is offline   Reply With Quote
Old 23rd February 2006, 18:11   #2
Dark Fire Guy
Guest
 
Posts: n/a
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).
  Reply With Quote
Old 23rd February 2006, 20:59   #3
levj
Junior Member
 
Join Date: Feb 2006
Posts: 3
Thanks, I've figured it out. I used ExecShell.
Levi
levj is offline   Reply With Quote
Old 24th February 2006, 12:29   #4
Brummelchen
Major Dude
 
Join Date: May 2003
Posts: 681
rubbish ;p
try this
PHP Code:
!include "Sections.nsh" 
PHP Code:

  
!insertmacro MUI_PAGE_COMPONENTS
  
!insertmacro MUI_PAGE_INSTFILES
  page custom Options  
; <-- insert only this line
  
!insertmacro MUI_PAGE_FINISH 
PHP Code:
Section "Set as default Screensaver" SecInfo41
SectionEnd 
PHP Code:
Function Options
  
;get user options from sectionssetsaver
  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)

Greets, Brummelchen
Brummelchen is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump