How to install (register) screensaver programmatically?
AFAIk there are two ways:
System32
. But don't hardcode "C:\Windows\System32". You need to query the system to find out where the system directory is.Install
action on the .scr
file, which results in temporary activation. But the screensaver will disappear once another has been selected and the dialog restarted.But this is from Win95 times, so it's possibly outdated.
I see three ways to call install
:
install
verbrundll32.exe desk.cpl,InstallScreenSaver %l
desk.cpl
as library(LoadLibrary or by declaring an import for InstallScreenSaver
) and then call the InstallScreenSaver
method with your own path as parameter.A walkthrough here -
http://www.desktopmanagementsoftware.org/creating-an-msi-package-for-a-screensaver