Skip to content

Commit

Permalink
win: improve and unify service start/stop logic
Browse files Browse the repository at this point in the history
This commit introduces a more structured approach to starting, stopping,
and managing Windows services. By abstracting service control operations
into dedicated functions (`StopService`, `StartService`, etc.), it
improves code readability and facilitates future maintenance.

The modifications include:

- Creation of files (`%APPDIR%`\privacy.sexy-<serviceName>`) for
  managing service restart states. This approach simplifies the process
  of determining whether a service was running before the script
  executed and should therefore be restarted afterward.
- Using `DeleteFiles` and `ClearDirectoryContents` functions to safely
  remove files without affecting service operations. This is enabled by
  using shared funtions for service operations.
  • Loading branch information
undergroundwires committed Mar 14, 2024
1 parent 4ac1425 commit adc2089
Showing 1 changed file with 173 additions and 58 deletions.
Loading

0 comments on commit adc2089

Please sign in to comment.