I’ve developed a Python app which installs and manages instances of a Windows Service (also developed in Python). The app works fine and I am now in the process of figuring out how to package it for deployment. My plan was to use Pyinstaller. However I’ve encountered an issue; from what I understand the frozen app doesn’t include a Python interpreter executable, and currently my app installs and removes services using the following code;
subprocess.run(['python', str(service_script), '--startup=auto', 'install'], check=True)
subprocess.run(['python', str(service_script), 'remove'], check=True)
I haven’t actually tried to freeze it yet as I am a novice and still learning how to do so, but I am pretty much certain this won’t work. So my question is, how can I achieve this functionality in a frozen app? Is there an alternative approach which works with Pyinstaller, or perhaps an alternative packaging program which will work?
For clarity I only need to package the app for Windows, as it will be deployed on middleware machines running Windows Server. Manually installing the services is not an option; the whole point of the app is to allow easy management of the service instances via a GUI.