Metadata-Version: 2.4
Name: Nuitka-winsvc
Version: 4.0.1
Summary: Nuitka but support compile as Windows service
Home-page: https://github.com/tabris17/Nuitka-winsvc
Author: tabris17
Author-email: tabris17.cn@gmail.com
License: GNU Affero General Public License v3
Project-URL: Source, https://github.com/tabris17/Nuitka-winsvc
Keywords: windows service,compiler,python,nuitka
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: System :: Software Distribution
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: C
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: POSIX :: BSD :: FreeBSD
Classifier: Operating System :: POSIX :: BSD :: NetBSD
Classifier: Operating System :: POSIX :: BSD :: OpenBSD
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS
Classifier: Operating System :: Android
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Description-Content-Type: text/markdown
License-File: LICENSE-RUNTIME.txt
License-File: LICENSE.txt
Provides-Extra: build-wheel
Requires-Dist: setuptools>=42; extra == "build-wheel"
Requires-Dist: toml; extra == "build-wheel"
Requires-Dist: wheel; extra == "build-wheel"
Provides-Extra: package
Provides-Extra: standalone
Provides-Extra: onefile
Requires-Dist: zstandard>=0.15; extra == "onefile"
Provides-Extra: app
Requires-Dist: zstandard>=0.15; extra == "app"
Provides-Extra: icon-conversion
Requires-Dist: imageio; extra == "icon-conversion"
Provides-Extra: all
Requires-Dist: setuptools>=42; extra == "all"
Requires-Dist: toml; extra == "all"
Requires-Dist: zstandard>=0.15; extra == "all"
Requires-Dist: imageio; extra == "all"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: project-url
Dynamic: provides-extra
Dynamic: summary

# Nuitka-winsvc User Manual

![PyPI](https://img.shields.io/pypi/v/Nuitka-winsvc) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/Nuitka-winsvc) ![License](https://img.shields.io/github/license/tabris17/Nuitka-winsvc)

Nuitka-winsvc is a forked version of Nuitka, it supports compiling EXE as a Windows service.

## Install

You can install Nuitka-winsvc by pip:

```shell
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:

```shell
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:

```shell
.\main.exe install
```

Also you can use the following command to uninstall the service:

```shell
.\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.
