Added path escaping and improved error handling of wing_service_manager_install_service
This fixes two issues with wing_service_manager_install_service
:
-
No error check was made to make sure the path was below
MAX_PATH
chars orGetModuleFileNameW
was failing for any other reason. This in practice should never happen, but in practice an executable can be run with a longer path (see for example https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file#enable-long-paths-in-windows-10-version-1607-and-later ). -
The executable name was not escaped. This has the potential for creating bugs if the executable contains spaces in its path.