Skip to main content

Nuitka but support compile as Windows service

Project description

Nuitka-winsvc User Manual

PyPI PyPI - Python Version License

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nuitka_winsvc-2.2.1.tar.gz (3.6 MB view details)

Uploaded Source

Built Distribution

Nuitka_winsvc-2.2.1-cp311-cp311-win_amd64.whl (3.3 MB view details)

Uploaded CPython 3.11 Windows x86-64

File details

Details for the file nuitka_winsvc-2.2.1.tar.gz.

File metadata

  • Download URL: nuitka_winsvc-2.2.1.tar.gz
  • Upload date:
  • Size: 3.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.9

File hashes

Hashes for nuitka_winsvc-2.2.1.tar.gz
Algorithm Hash digest
SHA256 72dc2224dab69b9c07e1ad4fd8d589dca555c78efb38f83fee9e20bc91895587
MD5 d1c00a828da647f0d3df26423fd0d8a6
BLAKE2b-256 6c6b24e5b87ea12b15086a5bd72b6dac753399b4b2411713304e8b9eb358dc9e

See more details on using hashes here.

File details

Details for the file Nuitka_winsvc-2.2.1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for Nuitka_winsvc-2.2.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a42e2c12ce3d711cb59db90505dae895246227f0e586a1633c306953475b2c32
MD5 812073085cba8989f97a7f97d39c747f
BLAKE2b-256 353dae1f99896bd8a5febe2a7da610a1236852ef313a3a944d195dded27f47ca

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page