microsoft / msix-packaging

MSIX SDK
MIT License
963 stars 163 forks source link

[Feature Request] Make it possible to specify the recovery options for a packaged service #574

Open ynborokh opened 1 year ago

ynborokh commented 1 year ago

I didn't find any possibility of setting the recovery options for a service added to an MSIX package. The service is added to the package manifest as a desktop6:Service element as described here. But after the package is installed, all recovery options for the service are set to Take no action: image And there is no possibility to change them neither manually: image nor via the sc failure cmd command (Result: Error: OpenService FAILED 5: Access is denied. is returned), nor from OpenService function call (it returns NULL and the GetLastError returns ACCES_DENIED=5 code), even if cmd and code are launched with the elevated privileges. It stops me from using this approach because I would like to rely on the service, so I want to set a restart recovery action. But with the Take no action recovery action, once the service process crashes, it will never be restarted by OS. Is it possible to add this tuning?

bmoore117 commented 1 year ago

Would love this feature as well!