A simple Windows Service to save new Spotlight images from Microsoft.
- Windows 10 1809 (Might work on older versions)
- The latest Visual Studio with the
.NET Desktop Development
workload installed.
- Modify the output directory location (in the
SpotlightImages.cs
file), else the service will fail to start. - Build the project with
Ctrl + Shift + B
or use theBuild
menu - From the Start menu, select the Visual Studio directory,
then select
Developer Command Prompt for VS <version>
. - Use the installutil tool to install the service
- The binary is located in
bin/Release
directory - Run
InstallUtil /u "Spotlight Images"
from the command prompt with the project's executable as a parameter:
C:\...\Community> where installutil C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe We modify the above path to use the 64-bit version of the installutil (Framework -> Framework64) C:\...\Community> cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319\ C:\...\v4.0.30319> installutil "full/path/to/project/bin/Release/Spotlight Images.exe"
After install, the service runs in the background and auto-starts on
system start-up Automatic (Delayed Start)
, to prevent resource
usage at logon).
Still using the 64-bit installutil, do C:\...\v4.0.30319> installutil \u "full/path/to/project/bin/Release/Spotlight Images.exe"
Follow instructions in the above link to remove this and only this service. More details on service installation/uninstallation can be found here.
This process runs under the LocalSystem
privileged user which
(as of now) seems to be the only way give the service the right
permissions to access the directory where the images are stored.
- Add an installer to allow easy install/uninstall
- Allow user to specify save directory during install
- Find a way to run the service as a less privileged user
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Copyright © 2019 Mythreya K