Archive: Screensaver Installer / Vista 64 Issue


Screensaver Installer / Vista 64 Issue
I made an installer for a screensaver that seems to work fine on xp and vista but I am having problems with vista 64. Here is the relevant code...

!include "x64.nsh"

InstallDir "$SYSDIR"

SetOutPath "$INSTDIR"
File "PixelWords.scr"
Exec 'RUNDLL32.exe DESK.CPL,InstallScreenSaver PixelWords.scr'

This is difficult for me to test because I don't have a vista 64 machine accessible to me. I think I am at the point where it does install to the syswow64 folder but it is still not persisting in the screensavers window. Can anyone offer some advice?


Ok, my bro tried the install on his vista 64 system. It seems to have worked. Here is the script for those interested.


;NSIS Screensaver Install Script
;Adaped from Header Bitmap Example Script by Joost Verburg

;--------------------------------
;Include Modern UI

!include "MUI2.nsh"
!include "x64.nsh"

;--------------------------------
;General

;Name and file
Name "Pixel Words"
OutFile "PixelWordsSetup.exe"

;Default installation folder
InstallDir "$SYSDIR"

;Request application privileges for Windows Vista
RequestExecutionLevel none

;--------------------------------
;Interface Configuration

!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "background.bmp" ; optional
!define MUI_ABORTWARNING
!define MUI_ICON "icon.ico"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_TEXT "Set Pixel Words as the active screensaver"
!define MUI_FINISHPAGE_RUN_FUNCTION "SetScreensaver"
;!define MUI_FINISHPAGE_RUN_NOTCHECKED

; show install details
;!define MUI_FINISHPAGE_NOAUTOCLOSE
;ShowInstDetails show

;--------------------------------
;Pages

!insertmacro MUI_PAGE_LICENSE "License.txt"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH

;--------------------------------
;Languages

!insertmacro MUI_LANGUAGE "English"

;--------------------------------
;Installer Sections

Section "Dummy Section" SecDummy

SetOutPath "$INSTDIR"

File "PixelWords.scr"

SectionEnd

Function SetScreensaver

;Set screensaver and make it active
Exec 'RUNDLL32.exe DESK.CPL,InstallScreenSaver PixelWords.scr'

FunctionEnd


;Forget Exec 'RUNDLL32.exe DESK.CPL,InstallScreenSaver PixelWords.scr'

;Edit registry directly


;For Installation

!include LogicLib.nsh

!define PRODUCT_NAME "Your ScreenSaver Name"

;IMPORTANT After file on Disq

GetFullPathName /SHORT $sDosName "$SYSDIR\${PRODUCT_NAME}.scr"

WriteRegStr HKCU "Control Panel\Desktop" "SCRNSAVE.EXE" $sDosName

WriteRegStr HKCU "Control Panel\Desktop" "ScreenSaveActive" "1"


;For UnInstall

ReadRegStr $sUnInstActiveScnSaverDosName HKCU "Control Panel\Desktop" "SCRNSAVE.EXE"

GetFullPathName /SHORT $sUnInstScnSaverDosName "$SYSDIR\${PRODUCT_NAME}.scr"

;The Conditionnal is for not deactivate de ScreenSaver is not your...


${If} $sUnInstActiveScnSaverDosName == $sUnInstScnSaverDosName

DeleteRegValue HKCU "Control Panel\Desktop" "SCRNSAVE.EXE"

WriteRegStr HKCU "Control Panel\Desktop" "ScreenSaveActive" "0"

${EndIf}

;Work perfectly on Xp I can't garanty on Vista 64

;Vista, what Vista ??? :)

;SylBou