# 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/tabris17/Nuitka-winsvc",
"name": "Nuitka-winsvc",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "windows service, compiler, python, nuitka",
"author": "tabris17",
"author_email": "tabris17.cn@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/93/86/29bce82f94ec076af9dfe40d34bf4b5cd1cd1af34a7f2001d6e0dd5f0605/nuitka_winsvc-2.1.6.tar.gz",
"platform": null,
"description": "# Nuitka-winsvc User Manual\r\n\r\n\r\n\r\n![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) \r\n\r\n\r\n\r\nNuitka-winsvc is a forked version of Nuitka, it supports compiling EXE as a Windows service. \r\n\r\n\r\n\r\n## Install\r\n\r\n\r\n\r\nYou can install Nuitka-winsvc by pip: \r\n\r\n\r\n\r\n```shell\r\n\r\npip install nuitka-winsvc\r\n\r\n```\r\n\r\n\r\n\r\n## Usage\r\n\r\n\r\n\r\nIn addition to supporting all the command line arguments of Nuitka, Nuitka-winsvc also provides 7 additional arguments for compiling the Windows services:\r\n\r\n\r\n\r\n- `--windows-service` \r\n\r\n Enable Windows service mode, works only when compiling for Windows and **onefile** mode enabled.\r\n\r\n- `--windows-service-name` \r\n\r\n Name of the Windows service. If not provided, the target program name will be used as the service name.\r\n\r\n- `--windows-service-display-name` \r\n\r\n Display name of the Windows service. If not provided, the product name will be attempted to use.\r\n\r\n- `--windows-service-description` \r\n\r\n Description of the Windows service. If not provided, the file description will be attempted to use.\r\n\r\n- `--windows-service-cmdline` \r\n\r\n Additional command line arguments that will be passed to the service, such as `--config config.json --output output.log` .\r\n\r\n- `--windows-service-install` \r\n\r\n Windows service installation command-line argument. Default value is `install` .\r\n\r\n- `--windows-service-uninstall` \r\n\r\n Windows service uninstallation command-line argument. Default value is `uninstall` .\r\n\r\n\r\n\r\nUse the following command to build a Windows service:\r\n\r\n\r\n\r\n```shell\r\n\r\npython -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\r\n\r\n```\r\n\r\n\r\n\r\nWhen the python program is compiled successfully, you can use the following command to install the service:\r\n\r\n\r\n\r\n```shell\r\n\r\n.\\main.exe install\r\n\r\n```\r\n\r\n\r\n\r\nAlso you can use the following command to uninstall the service:\r\n\r\n\r\n\r\n```shell\r\n\r\n.\\main.exe uninstall\r\n\r\n```\r\n\r\n\r\n\r\nNote: Administrator privileges is required when installing and uninstalling the Windows services. You should run the above commands as administrator. \r\n\r\n\r\n\r\nThe 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.\r\n\r\n",
"bugtrack_url": null,
"license": "Apache License, Version 2.0",
"summary": "Nuitka but support compile as Windows service",
"version": "2.1.6",
"project_urls": {
"Homepage": "https://github.com/tabris17/Nuitka-winsvc",
"Source": "https://github.com/tabris17/Nuitka-winsvc"
},
"split_keywords": [
"windows service",
" compiler",
" python",
" nuitka"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a8d345f1a47ab659140415b22969e031124050d6b816630abc8fec193ab4f8b1",
"md5": "56cbb750e3e8922bae7438bea9226b63",
"sha256": "4b9c28a12fbb91be691f5412f4e8dc314ca2fdee525d589693a0255971cc157f"
},
"downloads": -1,
"filename": "Nuitka_winsvc-2.1.6-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "56cbb750e3e8922bae7438bea9226b63",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": null,
"size": 3270934,
"upload_time": "2024-04-22T03:12:21",
"upload_time_iso_8601": "2024-04-22T03:12:21.647266Z",
"url": "https://files.pythonhosted.org/packages/a8/d3/45f1a47ab659140415b22969e031124050d6b816630abc8fec193ab4f8b1/Nuitka_winsvc-2.1.6-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "938629bce82f94ec076af9dfe40d34bf4b5cd1cd1af34a7f2001d6e0dd5f0605",
"md5": "4a86a74df2a05648c1647bdba40d9deb",
"sha256": "ea0f6133e86dacb30211f85fd1dd4c5c9f0ee2d1a20baff6c8c0deab3e27c8f4"
},
"downloads": -1,
"filename": "nuitka_winsvc-2.1.6.tar.gz",
"has_sig": false,
"md5_digest": "4a86a74df2a05648c1647bdba40d9deb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3591255,
"upload_time": "2024-04-22T03:12:27",
"upload_time_iso_8601": "2024-04-22T03:12:27.171491Z",
"url": "https://files.pythonhosted.org/packages/93/86/29bce82f94ec076af9dfe40d34bf4b5cd1cd1af34a7f2001d6e0dd5f0605/nuitka_winsvc-2.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-22 03:12:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "tabris17",
"github_project": "Nuitka-winsvc",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "nuitka-winsvc"
}