Nuitka but support compile as Windows service
Project description
Nuitka-winsvc User Manual
Nuitka-winsvc is a forked version of Nuitka, it supports compiling EXE as a Windows service.
Install
You can install Nuitka-winsvc by pip:
pip install nuitka-winsvc
Usage
In addition to supporting all the command line arguments of Nuitka, Nuitka-winsvc also provides 7 additional arguments for compiling the Windows services:
-
--windows-service
Enable Windows service mode, works only when compiling for Windows and onefile mode enabled.
-
--windows-service-name
Name of the Windows service. If not provided, the target program name will be used as the service name.
-
--windows-service-display-name
Display name of the Windows service. If not provided, the product name will be attempted to use.
-
--windows-service-description
Description of the Windows service. If not provided, the file description will be attempted to use.
-
--windows-service-cmdline
Additional command line arguments that will be passed to the service, such as
--config config.json --output output.log
. -
--windows-service-install
Windows service installation command-line argument. Default value is
install
. -
--windows-service-uninstall
Windows service uninstallation command-line argument. Default value is
uninstall
.
Use the following command to build a Windows service:
python -m nuitka --onefile --output-dir=build --windows-service --windows-service-name=myservice --windows-service-display-name="My Service" --windows-service-description="This is the description of my service" --windows-service-cmdline="-c config.yml -o output.log" --windows-service-install=install --windows-service-uninstall=uninstall main.py
When the python program is compiled successfully, you can use the following command to install the service:
.\main.exe install
Also you can use the following command to uninstall the service:
.\main.exe uninstall
Note: Administrator privileges is required when installing and uninstalling the Windows services. You should run the above commands as administrator.
The compiled EXE executable file can be run both as a Windows service and as a regular Windows program. However, it is important to note that the Windows service installation and uninstallation command-line arguments which specified by --windows-service-install
and --windows-service-uninstall
of Nuitka-winsvc compilation arguments will override the original behavior of the program. Therefore, the compiled Python program should avoid using the same command line arguments.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nuitka_winsvc-2.5.1.tar.gz
.
File metadata
- Download URL: nuitka_winsvc-2.5.1.tar.gz
- Upload date:
- Size: 3.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d30258e0b9ae75a3081019d6ae4049ea5baca4b4ace2fe70830aa7a272687c26 |
|
MD5 | d613824c05c821ce96b8d2f74acbce21 |
|
BLAKE2b-256 | d724fe200df4864860111e1184ce1d38fb73e2ecbdf15625755d1524c32ddbae |
File details
Details for the file Nuitka_winsvc-2.5.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: Nuitka_winsvc-2.5.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 3.5 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 542d4a67f0205100c7794d32aa90786f92c2a354c1e38074b94d2741618662b1 |
|
MD5 | ce13558467fca5fa8e3f832b02637b75 |
|
BLAKE2b-256 | 50746249d50482d5e168a7556718c04b4cfbd5ed8e988e1ff0e68af4bbf7de39 |