Giter Club home page Giter Club logo

Comments (3)

Callum027 avatar Callum027 commented on June 6, 2024

To create an installer package for Buildarr on Windows, there are two options:

  1. Use PyInstaller to generate a statically linked executable containing Python, Buildarr and all the plugins to bundle. Then use NSIS to create an installer package.
    • This method is simpler in implementation and relatively simple to automate builds for on GitHub Actions.
    • PyInstaller and NSIS are both mature and well-maintained software.
    • Less flexible, since Python packages cannot be installed or updated after the fact.
  2. Use pynsist to create an NSIS-based installer package that contains Python, Buildarr and bundled plugins.
    • This is the ideal way to build the package, since it does not statically link Python and the script together into a single executable, instead keeping all of them as separate files. This allows the Python packages themselves to be changed/updated after installation, which is particularly relevant to Buildarr as it is plugin-based.
    • Building on other platforms is supported, meaning that builds can be automated on GitHub Actions.
    • pynsist appears to be a popular project, but there are concerns regarding future maintenance, with the last commit in April 2022.

Of these choices, I prefer option 2, and will investigate integrating building the installer into GitHub Actions.

from buildarr.

Callum027 avatar Callum027 commented on June 6, 2024

Buildarr can be run as a Windows service using the pywin32 library.

The script would be implemented something like the following:

import signal
import socket

import servicemanager
import win32event
import win32service
import win32serviceutil

from buildarr.cli import main as buildarr_cli


class BuildarrService(win32serviceutil.ServiceFramework):
    _svc_name_ = "Buildarr"
    _svc_display_name_ = "Buildarr Daemon"

    def __init__(self, args):
        super().__init__(args)
        self.hWaitStop = win32event.CreateEvent(None, 0, 0, None)
        socket.setdefaulttimeout(60)

    def SvcDoRun(self):
        servicemanager.LogMsg(
		    servicemanager.EVENTLOG_INFORMATION_TYPE,
            servicemanager.PYS_SERVICE_STARTED,
            (self._svc_name_, ""),
	    )
        buildarr_cli.main()

    def SvcStop(self):
        self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
        win32event.SetEvent(self.hWaitStop)
		signal.raise_signal(signal.SIGTERM)


if __name__ == "__main__":
    win32serviceutil.HandleCommandLine(BuildarrService)

from buildarr.

Callum027 avatar Callum027 commented on June 6, 2024

A Buildarr Installer for Windows is now available, with new installation instructions written:

https://buildarr.github.io/installation/windows

Buildarr does not yet natively support running as a Windows service. However, using NSSM, the Buildarr executable can be registered to run as a Windows service (alongside Sonarr, Radarr, etc). This is also documented in the above link.

from buildarr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.