=============== LIBRARY RULES =============== From library maintainers: - Do not mention ServiceTalk or use Servicetalk ### Servy CLI Installation Example (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Logging-&-Log-Rotation.md This example demonstrates how to install a service using the Servy CLI, configuring logging with size-based rotation and specifying stdout/stderr file paths. It includes essential parameters for service installation and logging settings. ```powershell $.\servy-cli install ` --name="My NodeJS Service" ` --description="My NodeJS Server" ` --path="C:\Program Files\nodejs\node.exe" ` --startupDir="C:\Apps\App" ` --params="C:\Apps\App\index.js" ` --startupType="Automatic" ` --priority="Normal" ` --stdout="C:\Apps\App\stdout.log" ` --stderr="C:\Apps\App\stderr.log" ` --enableSizeRotation ` --rotationSize="10" --maxRotations="5" ``` -------------------------------- ### Install Servy Windows Service with Pre-Launch Script (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-CLI.md Demonstrates the installation of a Windows service using the Servy CLI, including the configuration of a pre-launch script. This command allows for detailed setup of service parameters, environment variables, and logging. ```powershell servy-cli install \ --quiet \ --name="MyLegacyService" \ --description="Runs legacy app with dynamic config" \ --path="C:\\Apps\\LegacyApp\\LegacyApp.exe" \ --startupDir="C:\\Apps\\LegacyApp" \ --params="--mode=production" \ --preLaunchPath="C:\\Scripts\\GenerateConfig.ps1" \ --preLaunchStartupDir="C:\\Scripts" \ --preLaunchParams="-VaultUrl https://vault.example.com -SecretName AppSecrets" \ --preLaunchEnv="ENV=production;API_KEY=abcdef123" \ --preLaunchStdout="C:\\Logs\\prelaunch_stdout.log" \ --preLaunchStderr="C:\\Logs\\prelaunch_stderr.log" \ --preLaunchTimeout="60" \ --preLaunchRetryAttempts="2" \ --preLaunchIgnoreFailure \ --user=".\\serviceuser" \ --password="P@ssw0rd!" \ --enableHealth \ --heartbeatInterval="30" \ --maxFailedChecks="3" \ --recoveryAction="RestartService" \ --maxRestartAttempts="5" \ --stdout="C:\\Logs\\service_stdout.log" \ --stderr="C:\\Logs\\service_stderr.log" \ --enableRotation \ --rotationSize="10485760" ``` -------------------------------- ### Quick Install Servy using Package Managers Source: https://github.com/defiect/servy-wiki-old/blob/main/Installation-Guide.md Installs Servy using common Windows package managers like WinGet, Chocolatey, or Scoop. Ensure the respective package manager is installed and run the command as an administrator. ```powershell winget install servy ``` ```powershell choco install -y servy ``` ```powershell scoop bucket add extras scoop update innounp scoop install servy ``` -------------------------------- ### Install Servy Service with PowerShell Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-CLI.md This PowerShell example demonstrates how to install a new Servy service. It configures essential parameters like service name, description, executable path, startup directory, and logging. It also shows how to enable log rotation and health checks. ```powershell servy-cli install \ --quiet \ --name="My NodeJS Service" \ --description="My NodeJS Server" \ --path="C:\Program Files\nodejs\node.exe" \ --startupDir="C:\Apps\App" \ --params="C:\Apps\App\index.js" \ --startupType="Automatic" \ --priority="Normal" \ --stdout="C:\Apps\App\stdout.log" \ --stderr="C:\Apps\App\stderr.log" \ --enableRotation \ --rotationSize=10485760 \ --enableHealth \ ``` -------------------------------- ### GitHub Actions Workflow for Servy Service Management Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-Automation-&-CI-CD.md A comprehensive GitHub Actions workflow example for a Windows runner that installs Servy via WinGet, verifies its installation, installs an application as a Windows service using Servy CLI, and starts the service. It demonstrates using PowerShell within GitHub Actions. ```yaml name: Install MyApp with Servy on: workflow_dispatch: jobs: test-servy: runs-on: windows-latest steps: - name: Install Servy via WinGet run: | winget install --id aelassas.Servy -e --accept-package-agreements --accept-source-agreements --silent shell: powershell - name: Verify Servy CLI installed run: | & "C:\Program Files\Servy\servy-cli.exe" --version --quiet shell: powershell - name: Install MyApp as a Windows Service run: | & "C:\Program Files\Servy\servy-cli.exe" install \ --quiet \ --name="MyApp" \ --path="C:\MyApp\MyApp.exe" \ --startupType="Automatic" \ --startupDir="C:\MyApp\" shell: powershell - name: Start MyApp service run: | & "C:\Program Files\Servy\servy-cli.exe" start --quiet --name "MyApp" shell: powershell - name: Verify service status run: | Get-Service -Name MyApp shell: powershell ``` -------------------------------- ### Silent Install Servy with Command Line Arguments Source: https://github.com/defiect/servy-wiki-old/blob/main/Installation-Guide.md Performs a silent installation of Servy without user interaction. This method is useful for automated deployments. It supports both .NET 10.0+ and .NET Framework 4.8 installers. ```powershell # For .NET 10.0+ .servy-1.9-x64-installer.exe /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /SP- /CLOSEAPPLICATIONS /NOCANCEL # For .NET Framework 4.8 .servy-1.9-net48-x64-installer.exe /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /SP- /CLOSEAPPLICATIONS /NOCANCEL ``` ```powershell # For .NET 10.0 Start-Process -FilePath ".\servy-1.9-x64-installer.exe" -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /CLOSEAPPLICATIONS /NOCANCEL' -Verb RunAs -Wait # For .NET Framework 4.8 Start-Process -FilePath ".\servy-1.9-net48-x64-installer.exe" -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /CLOSEAPPLICATIONS /NOCANCEL' -Verb RunAs -Wait # Refresh PATH in current session $env:Path = [Environment]::GetEnvironmentVariable("Path", "Machine") ``` ```powershell # Enable logging for troubleshooting /LOG="servy-install.log" ``` -------------------------------- ### Configure Servy Service with Pre-Launch Script (CLI) Source: https://github.com/defiect/servy-wiki-old/blob/main/Pre‐Launch-&-Post‐Launch-Actions.md This example demonstrates how to install a Servy service using the CLI, specifying various pre-launch script configurations. It includes the path to the script, startup directory, parameters, environment variables, log file paths, timeout, retry attempts, and an option to ignore failures. ```powershell ./servy-cli install ` -n="MyService" ` -d="Runs app with dynamic config" ` -p="C:\Apps\App\App.exe" ` --startupDir="C:\Apps\App" ` --params="--mode=production" ` --preLaunchPath="C:\Scripts\GenerateConfig.ps1" ` --preLaunchStartupDir="C:\Scripts" ` --preLaunchParams="-VaultUrl https://vault.example.com -SecretName AppSecrets" ` --preLaunchEnv="ENV=production;API_KEY=abcdef123" ` --preLaunchStdout="C:\Logs\prelaunch_stdout.log" ` --preLaunchStderr="C:\Logs\prelaunch_stderr.log" ` --preLaunchTimeout="60" ` --preLaunchRetryAttempts="2" ` --preLaunchIgnoreFailure ` ``` -------------------------------- ### Install a Windows Service using Servy Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-PowerShell-Module.md This example demonstrates how to install a new Windows service using the `Install-ServyService` cmdlet. It specifies the service name, description, executable path, startup directory, parameters, and startup type. The `-Quiet` option is used to prevent interactive prompts. ```powershell Install-ServyService ` -Quiet ` -Name "WexflowServer" ` -Description "Wexflow Workflow Engine" ` -Path "C:\Program Files\dotnet\dotnet.exe" ` -StartupDir "C:\Program Files\Wexflow Server\Wexflow.Server" ` -Params "Wexflow.Server.dll" ` -StartupType "Automatic" ``` -------------------------------- ### Configure Servy Service with Post-Launch Script (CLI) Source: https://github.com/defiect/servy-wiki-old/blob/main/Pre‐Launch-&-Post‐Launch-Actions.md This example shows how to install a Servy service using the CLI, configuring a post-launch script. It specifies the path to the script, its startup directory, and any command-line parameters it requires. ```powershell ./servy-cli install ` -n="MyService" ` -d="Runs app with dynamic config" ` -p="C:\Apps\App\App.exe" ` --startupDir="C:\Apps\App" ` --params="--mode=production" ` --postLaunchPath="C:\Scripts\Notify.ps1" ` --postLaunchStartupDir="C:\Scripts" ` --postLaunchParams="-VaultUrl https://vault.example.com -SecretName AppSecrets" ` ``` -------------------------------- ### Install Node.js / Next.js / Express App as a Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a Node.js, Next.js, or Express application as a Windows service. Requires Node.js to be installed. The command specifies the service name, description, path to the Node.js executable, parameters (script file or 'start' for npm/Next.js), the working directory, and the startup type. ```powershell servy-cli install ` --name="MyNodeApp" ` --description="Node.js Express API" ` --path="C:\Program Files\nodejs\node.exe" ` --params="C:\apps\myapp\server.js" ` --startupDir="C:\apps\myapp" ` --startupType="Automatic" ``` ```powershell servy-cli install ` --name="MyNodeApp" ` --description="Node.js App via npm" ` --path="C:\Program Files\nodejs\npm.cmd" ` --params="start" ` --startupDir="C:\apps\myapp" ` --startupType="Automatic" ``` ```powershell servy-cli install ` --name="MyNextApp" ` --description="Next.js App" ` --path="C:\Program Files\nodejs\npm.cmd" ` --params="start" ` --startupDir="C:\apps\myapp" ` --startupType="Automatic" ``` -------------------------------- ### Servy CLI Install Command Parameters Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-CLI.md This section lists and describes the various parameters available for the `servy-cli install` command. It covers options for service naming, executable paths, startup configurations, dependencies, pre/post-launch scripts, logging, and debugging. ```cli --name The service name. Use names without spaces or special characters. --description The service description. --path The path to the executable that runs the service. --startupDir The working directory for the service. --params Parameters to pass to the executable. Use "--param=value" syntax for parameters starting with '--'. --startupType The startup type for the service (e.g., Automatic, Manual, Disabled). --priority The process priority (e.g., Normal, High, Low). --stdout Path to the service's stdout log file. --stderr Path to the service's stderr log file. --enableRotation Enable log file rotation. --rotationSize Maximum size of log files before rotation (in bytes). --enableHealth Enable health check endpoint. --healthPort Port for the health check endpoint. --healthInterval Interval for health checks (in seconds). --healthTimeout Timeout for health checks (in seconds). --dependencies Comma-separated list of service names that this service depends on. --user The service account username (e.g., .\username, DOMAIN\username, or DOMAIN\gMSA$). --password The service account password. --preLaunchPath Path to an executable to run before the service starts. --preLaunchStartupDir Directory for the pre-launch executable. --preLaunchParams Parameters for the pre-launch executable. --preLaunchEnv Environment variables for the pre-launch executable (e.g., VAR1=value;VAR2=value). --preLaunchStdout Path to stdout log file for the pre-launch executable. --preLaunchStderr Path to stderr log file for the pre-launch executable. --preLaunchTimeout Timeout for the pre-launch executable (in seconds). --preLaunchRetryAttempts Number of retry attempts for the pre-launch executable. --preLaunchIgnoreFailure Ignore failure and start service even if pre-launch executable fails. --postLaunchPath Path to an executable to run after the service starts successfully. --postLaunchStartupDir Directory for the post-launch executable. --postLaunchParams Parameters for the post-launch executable. --debug Enable debug logs (records environment variables and process parameters in Event Log). -q, --quiet Suppress spinner and run in non-interactive mode. --help Display this help screen. --version Display version information. ``` -------------------------------- ### Installation Source: https://context7.com/defiect/servy-wiki-old/llms.txt Instructions on how to install Servy using package managers or via silent installation. ```APIDOC ## Installation ### Install Servy via Package Managers Servy can be installed using WinGet, Chocolatey, or Scoop package managers for quick deployment. ```powershell # Install via WinGet (recommended) winget install servy # Install via Chocolatey choco install -y servy # Install via Scoop scoop bucket add extras scoop install servy ``` ### Silent Installation from Installer For automated deployments and CI/CD pipelines, Servy supports silent installation using Inno Setup switches. ```powershell # Download and silent install .NET 10.0+ version Start-Process -FilePath ".\servy-1.9-x64-installer.exe" \ -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /CLOSEAPPLICATIONS /NOCANCEL' \ -Verb RunAs -Wait # Refresh PATH in current session after installation $env:Path = [Environment]::GetEnvironmentVariable("Path", "Machine") # Silent uninstall & "C:\Program Files\Servy\unins000.exe" /VERYSILENT /NORESTART /SUPPRESSMSGBOXES ``` ``` -------------------------------- ### Install Service with Dependencies (CLI) Source: https://github.com/defiect/servy-wiki-old/blob/main/Service-Dependencies.md Installs a new Windows service using the Servy CLI, specifying one or more service dependencies. The service will only start once all listed dependencies are running. Dependencies are provided as a semicolon-separated string. ```powershell ./servy-cli install \ --name="My NodeJS Service" \ --description="My NodeJS Server" \ --path="C:\Program Files\nodejs\node.exe" \ --startupDir="C:\Apps\App" \ --params="C:\Apps\App\index.js" \ --startupType="Automatic" \ --deps="MongoDB; MySQL80" \ ``` -------------------------------- ### Install and Start Servy Application with PowerShell in Azure DevOps Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-Automation-&-CI-CD.md This snippet demonstrates how to use the Servy CLI within an Azure DevOps pipeline to install and start a Servy application. It utilizes PowerShell tasks and assumes a Windows agent is configured. The `--quiet` flag ensures silent operation, and the `--path` argument specifies the installation directory. ```powershell servy-cli install --quiet --name="MyApp" --path="$(Build.ArtifactStagingDirectory)\MyApp.exe" --startupType="Automatic" servy-cli start --quiet --name="MyApp" ``` -------------------------------- ### Install Zig App as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a Zig application executable to run as a Windows service. This command configures the service to start automatically and sets the working directory. ```powershell servy-cli install \ --name="MyZigService" \ --description="Zig background worker" \ --path="C:\apps\zig\myapp.exe" \ --startupDir="C:\apps\zig" \ --startupType="Automatic" ``` -------------------------------- ### Install Deno App as a Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a Deno application or script as a Windows service. Requires Deno to be installed. The command specifies the service name, description, path to the Deno executable, runtime parameters (e.g., 'run --allow-net'), the working directory, and the startup type. Permissions like `--allow-net` can be adjusted as needed. ```powershell servy-cli install ` --name="MyDenoService" ` --description="Deno background script" ` --path="C:\tools\deno\deno.exe" ` --params="run --allow-net C:\apps\deno\worker.ts" ` --startupDir="C:\apps\deno" ` --startupType="Automatic" ``` -------------------------------- ### Install OCaml Script as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs an OCaml script to run as a Windows service using Servy CLI. Requires `ocaml.exe` and the script path. The service will start automatically. ```powershell servy-cli install \ --name="MyOCamlService" \ --description="OCaml background worker" \ --path="C:\OCaml\bin\ocaml.exe" \ --params="C:\apps\ocaml\worker.ml" \ --startupDir="C:\apps\ocaml" \ --startupType="Automatic" ``` -------------------------------- ### Servy CLI Health Monitoring Configuration Example (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Monitoring-&-Health-Checks.md This example demonstrates how to install a service using the Servy CLI, enabling and configuring health monitoring with specific parameters for heartbeat, failed checks, recovery action, and restart attempts. ```powershell ./servy-cli install ` --name="My NodeJS Service" ` --description="My NodeJS Server" ` --path="C:\Program Files\nodejs\node.exe" ` --startupDir="C:\Apps\App" ` --params="C:\Apps\App\index.js" ` --startupType="Automatic" ` --enableHealth ` --heartbeatInterval="10" ` --maxFailedChecks="3" ` --recoveryAction="RestartService" ` --maxRestartAttempts="5" ` ``` -------------------------------- ### Install Pascal/Delphi App as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a Pascal or Delphi compiled application as a Windows service. The service is set to start automatically, and its startup directory is specified. ```powershell servy-cli install \ --name="MyPascalService" \ --description="Delphi background app" \ --path="C:\apps\pascal\worker.exe" \ --startupDir="C:\apps\pascal" \ --startupType="Automatic" ``` -------------------------------- ### Servy Installation via Package Managers Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-Automation-&-CI-CD.md Demonstrates how to install Servy using common Windows package managers like WinGet, Chocolatey, and Scoop. These commands simplify the installation process in automated environments. ```powershell winget install servy ``` ```powershell choco install -y servy ``` ```powershell scoop bucket add extras scoop install servy ``` -------------------------------- ### Install Compiled OCaml App as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a compiled OCaml native executable to run as a Windows service. This bypasses the need for `ocaml.exe` by directly specifying the executable path. The service starts automatically. ```powershell servy-cli install \ --name="MyOCamlService" \ --description="OCaml compiled worker" \ --path="C:\apps\ocaml\worker.exe" \ --startupDir="C:\apps\ocaml" \ --startupType="Automatic" ``` -------------------------------- ### Configure Pre-Launch Script Execution for a Service Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a service and configures it to run a pre-launch script. This script can perform initialization tasks before the main application starts. It supports custom paths, parameters, environment variables, and logging for the pre-launch script. ```powershell servy-cli install ` --quiet ` --name="MyLegacyService" ` --description="Runs legacy app with dynamic config" ` --path="C:\Apps\LegacyApp\LegacyApp.exe" ` --startupDir="C:\Apps\LegacyApp" ` --params="--mode=production" ` --preLaunchPath="C:\Scripts\GenerateConfig.ps1" ` --preLaunchStartupDir="C:\Scripts" ` --preLaunchParams="-VaultUrl https://vault.example.com -SecretName AppSecrets" ` --preLaunchEnv="ENV=production;API_KEY=abcdef123" ` --preLaunchStdout="C:\Logs\prelaunch_stdout.log" ` --preLaunchStderr="C:\Logs\prelaunch_stderr.log" ` --preLaunchTimeout="60" ` --preLaunchRetryAttempts="2" ` --preLaunchIgnoreFailure ``` -------------------------------- ### Install Go Compiled Binary Service with Servy CLI Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a Go compiled binary as a Windows service using the Servy CLI. Specifies the executable path, command-line parameters, startup directory, and startup type. ```bash servy-cli install --name="GoService" --path="C:\apps\my-go-app\my-go-app.exe" \ --params="--port=8080 --mode=worker" --startupDir="C:\apps\my-go-app" --startupType="Automatic" ``` -------------------------------- ### Install Erlang Script as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs an Erlang application or script to run as a Windows service. Requires specifying the Erlang executable and appropriate `-s` parameters for starting the OTP application. The service is set for automatic startup. ```powershell servy-cli install \ --name="MyErlangService" \ --description="Erlang background worker" \ --path="C:\Program Files\erl-25.3\bin\erl.exe" \ --params="-noshell -s my_app start -s init stop" \ --startupDir="C:\apps\erlang" \ --startupType="Automatic" ``` -------------------------------- ### Configure Service Dependencies Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a service and defines its dependencies on other Windows services. This ensures that dependent services are started before this service. ```powershell servy-cli install ` --quiet ` --name="WebAPI" ` --description="Web API requiring database services" ` --path="C:\Apps\WebAPI\api.exe" ` --startupDir="C:\Apps\WebAPI" ` --startupType="Automatic" ` --deps="MongoDB;Redis;MySQL80" ``` -------------------------------- ### GitHub Actions Workflow to Deploy Service with Servy Source: https://context7.com/defiect/servy-wiki-old/llms.txt A GitHub Actions workflow for Windows runners that installs the Servy CLI via WinGet, verifies its installation, and then installs a custom application as a Windows service with specified configurations like health checks and recovery actions. ```yaml name: Deploy Service with Servy on: workflow_dispatch: jobs: deploy-service: runs-on: windows-latest steps: - name: Install Servy via WinGet run: | winget install --id aelassas.Servy -e --accept-package-agreements --accept-source-agreements --silent shell: powershell - name: Verify Servy CLI installed run: | & "C:\Program Files\Servy\servy-cli.exe" --version --quiet shell: powershell - name: Install Application as Windows Service run: | & "C:\Program Files\Servy\servy-cli.exe" install \ --quiet \ --name="MyApp" \ --path="C:\MyApp\MyApp.exe" \ --startupType="Automatic" \ --startupDir="C:\MyApp" \ --enableHealth \ --heartbeatInterval=30 \ --recoveryAction="RestartService" shell: powershell - name: Start and verify service run: | & "C:\Program Files\Servy\servy-cli.exe" start --quiet --name "MyApp" Get-Service -Name MyApp shell: powershell ``` -------------------------------- ### Servy CLI Service Management Commands Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-Automation-&-CI-CD.md Illustrates fundamental Servy CLI commands for managing Windows services, including installation, starting, stopping, and uninstallation. These commands are essential for programmatic service control. ```bash # Install or update a service servy-cli install --name="MyApp" --path="C:\MyApp\MyApp.exe" --startupType="Automatic" # Start a service servy-cli start --name="MyApp" # Stop a service servy-cli stop --name="MyApp" # Uninstall a service servy-cli uninstall --name="MyApp" ``` -------------------------------- ### Install Java JAR Service with Servy CLI Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a Java JAR application as a Windows service using the Servy CLI. Requires the Java JDK path and the application JAR path. Configures automatic startup. ```bash servy-cli install --name="JavaService" --path="C:\Program Files\Java\jdk-21\bin\java.exe" \ --params="-jar C:\apps\springboot\app.jar" --startupDir="C:\apps\springboot" --startupType="Automatic" ``` -------------------------------- ### Silent Installation and Uninstallation (PowerShell) Source: https://context7.com/defiect/servy-wiki-old/llms.txt Performs silent installation and uninstallation of Servy using its installer, suitable for automated deployments and CI/CD pipelines. It utilizes Inno Setup switches for unattended operations. ```powershell # Download and silent install .NET 10.0+ version Start-Process -FilePath ".\servy-1.9-x64-installer.exe" ` -ArgumentList '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP- /CLOSEAPPLICATIONS /NOCANCEL' ` -Verb RunAs -Wait # Refresh PATH in current session after installation $env:Path = [Environment]::GetEnvironmentVariable("Path", "Machine") # Silent uninstall & "C:\Program Files\Servy\unins000.exe" /VERYSILENT /NORESTART /SUPPRESSMSGBOXES ``` -------------------------------- ### Silent Uninstall Servy using Command Line Source: https://github.com/defiect/servy-wiki-old/blob/main/Installation-Guide.md Uninstalls Servy silently without any user interface. This command works for both .NET 10.0+ and .NET Framework 4.8 installations. ```powershell # For .NET 10.0+ and .NET Framework 4.8 & "C:\Program Files\Servy\unins000.exe" /VERYSILENT /NORESTART /SUPPRESSMSGBOXES ``` -------------------------------- ### Install Fortran App as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a Fortran compiled application as a Windows service. This configuration ensures the service starts automatically and defines its execution directory. ```powershell servy-cli install \ --name="MyFortranService" \ --description="Fortran computational service" \ --path="C:\apps\fortran\worker.exe" \ --startupDir="C:\apps\fortran" \ --startupType="Automatic" ``` -------------------------------- ### Servy-CLI Install Command Usage Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-CLI.md This snippet displays the help output for the 'servy-cli install' command, detailing all available options for configuring a Windows service. It covers service naming, display names, descriptions, executable paths, startup parameters, logging, health monitoring, recovery actions, and environment variables. ```powershell PS> servy-cli install --help Servy.CLI 4.0.0+2803e7f199fecf937d0830a5aa71deb90c324521 Copyright © 2025 Akram El Assas. All rights reserved. -n, --name Required. Unique service name to install. --displayName The human-readable name shown in the Windows Services console (services.msc). If left empty, the service name will be used instead. -d, --description Description of the service. -p, --path Required. Path to the executable process. --startupDir Startup directory for the process. --params Additional parameters for the process. Supports environment variable expansion, example: --param="%ProgramData%\MyApp" --param="%MY_VAR%\bin" --startupType Service startup type. Options: Automatic, AutomaticDelayedStart, Manual, Disabled. --priority Process priority level. Options: Idle, BelowNormal, Normal, AboveNormal, High, RealTime. --stdout Path to stdout log file. --stderr Path to stderr log file. --enableRotation Deprecated. Enable size-based log rotation. This option is kept only for backward compatibility. Use --enableSizeRotation instead. --enableSizeRotation Enable size-based log rotation. --rotationSize Log rotation size in Megabytes (MB). Must be greater than or equal to 1 MB. --enableDateRotation Enable date-based log rotation based on the date interval specified by --dateRotationType. When both size-based and date-based rotation are enabled, size rotation takes precedence. --dateRotationType Date rotation type. Options: Daily, Weekly, Monthly. --maxRotations Maximum rotated log files to keep. Set to 0 or leave empty for unlimited. --enableHealth Enable health monitoring. --heartbeatInterval Heartbeat interval in seconds. --maxFailedChecks Maximum allowed failed health checks. --recoveryAction Recovery action on failure. Options: None, RestartService, RestartProcess, RestartComputer. Restart service and restart computer actions are not available if the service runs under NT AUTHORITY\NetworkService, NT AUTHORITY\LocalService, or a user account without the required privileges. Only the restart process action will be available for these accounts. --maxRestartAttempts Maximum restart attempts on failure. --failureProgramPath The failure program path. Configure a script or executable to run when the process fails to start. If health monitoring is disabled, the program will run when the process fails to start. If health monitoring is enabled, the program will only run after all configured recovery action retries have failed. --failureProgramStartupDir Specifies the directory in which the failure program will start. Defaults to the failure program directory. --failureProgramParams Additional parameters for the failure program. --env Environment variables for the process. Enter variables in the format varName=varValue separated by semicolons (;). Use \= to escape '=', \" to escape '"', \; to escape ';' and \\ to escape '\'. Supports environment variable expansion, example: VAR1=%ProgramData%\MyApp; VAR2=%VAR1%\bin --deps Specify one or more Windows service names (not display names) that this service depends on separated with semicolons (;). Use service key ``` -------------------------------- ### Install Service with Servy CLI for CI/CD Source: https://github.com/defiect/servy-wiki-old/blob/main/Integration-with-Monitoring-Tools.md This PowerShell script demonstrates how to use the Servy CLI to install a new service. It configures essential parameters like service name, description, executable path, startup directory, parameters, startup type, health monitoring, recovery actions, and log file rotation. This is useful for automating service deployments in CI/CD pipelines. ```powershell .\servy-cli install ` --name "MyNodeApp" ` --description "Node.js API Service" ` --path "C:\Program Files\nodejs\node.exe" ` --startupDir "C:\Apps\MyNodeApp" ` --params "C:\Apps\MyNodeApp\server.js" ` --startupType Automatic ` --enableHealth ` --heartbeatInterval 10 ` --maxFailedChecks 3 ` --recoveryAction RestartService ` --stdout "C:\Logs\MyNodeApp_stdout.log" ` --stderr "C:\Logs\MyNodeApp_stderr.log" ` --enableRotation ` --rotationSize 10485760 ``` -------------------------------- ### Install a Windows Service using Servy Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a new Windows service with detailed configuration. This includes service name, description, executable path, startup directory, parameters, startup type, and health monitoring settings. ```powershell Install-ServyService ` -Quiet ` -Name "WexflowServer" ` -Description "Wexflow Workflow Engine" ` -Path "C:\Program Files\dotnet\dotnet.exe" ` -StartupDir "C:\Program Files\Wexflow Server\Wexflow.Server" ` -Params "Wexflow.Server.dll" ` -StartupType "Automatic" ` -EnableHealth ` -HeartbeatInterval 30 ` -MaxFailedChecks 3 ` -RecoveryAction "RestartService" ``` -------------------------------- ### Install-ServyService Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-PowerShell-Module.md Installs a new Windows service with the specified parameters. ```APIDOC ## Install-ServyService ### Description Installs a new Windows service with the specified parameters. ### Method Install ### Endpoint N/A (Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **-Quiet** (switch) - Optional - **-Name** (string) - Required - The name of the service. - **-DisplayName** (string) - Optional - The display name of the service. - **-Description** (string) - Optional - The description of the service. - **-Path** (string) - Required - The path to the executable for the service. - **-StartupDir** (string) - Optional - The startup directory for the service. - **-Params** (string) - Optional - Parameters to pass to the service executable. - **-StartupType** (string) - Optional - The startup type for the service (Automatic, Manual, Disabled). - **-ProcessPriority** (string) - Optional - The process priority for the service (Idle, BelowNormal, Normal, AboveNormal, High, RealTime). - **-StdoutPath** (string) - Optional - Path for stdout redirection. - **-StderrPath** (string) - Optional - Path for stderr redirection. - **-EnableRotation** (switch) - Optional - Enables log rotation. - **-EnableSizeRotation** (switch) - Optional - Enables log rotation based on size. - **-RotationSize** (int) - Optional - The maximum size for log rotation in bytes. - **-EnableDateRotation** (switch) - Optional - Enables log rotation based on date. - **-DateRotationType** (string) - Optional - The type of date rotation (Daily, Weekly, Monthly). - **-MaxRotations** (int) - Optional - The maximum number of log files to keep. - **-EnableHealth** (switch) - Optional - Enables health checking for the service. - **-HeartbeatInterval** (int) - Optional - The interval in seconds for health check heartbeats. - **-MaxFailedChecks** (int) - Optional - The maximum number of failed health checks before recovery action. - **-RecoveryAction** (string) - Optional - The action to take on service failure (None, RestartService, RestartProcess, RestartComputer). - **-MaxRestartAttempts** (int) - Optional - The maximum number of restart attempts after failure. - **-FailureProgramPath** (string) - Optional - Path to a program to run on failure. - **-FailureProgramStartupDir** (string) - Optional - Startup directory for the failure program. - **-FailureProgramParams** (string) - Optional - Parameters for the failure program. - **-EnvironmentVariables** (string) - Optional - Environment variables for the service (e.g., "VAR1=value1;VAR2=value2"). - **-ServiceDependencies** (string) - Optional - Comma-separated list of service dependencies. - **-User** (string) - Optional - The user account to run the service under. - **-Password** (string) - Optional - The password for the user account. - **-PreLaunchPath** (string) - Optional - Path to a program to run before launching the service. - **-PreLaunchStartupDir** (string) - Optional - Startup directory for the pre-launch program. - **-PreLaunchParams** (string) - Optional - Parameters for the pre-launch program. - **-PreLaunchEnv** (string) - Optional - Environment variables for the pre-launch program. - **-PreLaunchStdout** (string) - Optional - Path for stdout redirection for the pre-launch program. - **-PreLaunchStderr** (string) - Optional - Path for stderr redirection for the pre-launch program. - **-PreLaunchTimeout** (int) - Optional - Timeout in seconds for the pre-launch program. - **-PreLaunchRetryAttempts** (int) - Optional - Number of retry attempts for the pre-launch program. - **-PreLaunchIgnoreFailure** (switch) - Optional - Ignore failure of the pre-launch program. - **-PostLaunchPath** (string) - Optional - Path to a program to run after launching the service. - **-PostLaunchStartupDir** (string) - Optional - Startup directory for the post-launch program. - **-PostLaunchParams** (string) - Optional - Parameters for the post-launch program. - **-EnableDebugLogs** (switch) - Optional - Enables debug logging. ### Request Example ```powershell Install-ServyService -Name "MyService" -DisplayName "My Awesome Service" -Path "C:\path\to\my\service.exe" -Description "This is a sample service." ``` ### Response #### Success Response (200) Indicates successful installation of the service. #### Response Example ```json { "message": "Service 'MyService' installed successfully." } ``` ``` -------------------------------- ### Start-ServyService Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-PowerShell-Module.md Starts a Windows service. ```APIDOC ## Start-ServyService ### Description Starts a Windows service. ### Method Start ### Endpoint N/A (Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **-Quiet** (switch) - Optional - **-Name** (string) - Required - The name of the service to start. ### Request Example ```powershell Start-ServyService -Name "MyService" ``` ### Response #### Success Response (200) Indicates that the service has been started or is already running. #### Response Example ```json { "message": "Service 'MyService' started successfully." } ``` ``` -------------------------------- ### Configure Post-Launch Script Execution for a Service Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a service and configures it to run a post-launch script after successful startup. This is useful for tasks like sending notifications or performing database migrations. ```powershell servy-cli install ` --quiet ` --name="MyService" ` --description="Service with post-launch notification" ` --path="C:\Apps\App\App.exe" ` --startupDir="C:\Apps\App" ` --params="--mode=production" ` --postLaunchPath="C:\Scripts\Notify.ps1" ` --postLaunchStartupDir="C:\Scripts" ` --postLaunchParams="-SlackWebhook https://hooks.slack.com/xxx -Message 'Service started'" ``` -------------------------------- ### Install .NET Application Service with Servy CLI Source: https://context7.com/defiect/servy-wiki-old/llms.txt Installs a .NET application (DLL) as a Windows service using the Servy CLI. Requires the dotnet runtime path and the DLL path. Configures automatic startup and startup directory. ```bash servy-cli install --name="DotNetApp" --path="C:\Program Files\dotnet\dotnet.exe" \ --params="C:\apps\dotnetapp\app.dll" --startupDir="C:\apps\dotnetapp" --startupType="Automatic" ``` -------------------------------- ### Silent Servy Installation with Windows Executables Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-Automation-&-CI-CD.md Provides commands for performing silent installations of Servy using its Windows installer executables. These commands are suitable for automated deployments where user interaction should be suppressed. ```batch .\servy-2.2-x64-installer.exe /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /SP- .\servy-2.2-net48-x64-installer.exe /VERYSILENT /NORESTART /SUPPRESSMSGBOXES /SP- ``` -------------------------------- ### Install Lua Script as Service Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs a Lua script to run as a Windows service for automation tasks. Ensure the Lua interpreter path and the Lua script file path are correctly specified. ```powershell servy-cli install \ --name="MyLuaService" \ --description="Lua automation script" \ --path="C:\Lua\5.4\lua.exe" \ --params="C:\apps\lua\script.lua" \ --startupDir="C:\apps\lua" \ --startupType="Automatic" ``` -------------------------------- ### Show-ServyHelp Source: https://github.com/defiect/servy-wiki-old/blob/main/Servy-PowerShell-Module.md Displays help information for all Servy CLI commands. ```APIDOC ## Show-ServyHelp ### Description Displays help information for all Servy CLI commands. ### Method Show Help ### Endpoint N/A (Cmdlet) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **-Quiet** (switch) - Optional ### Request Example ```powershell Show-ServyHelp ``` ### Response #### Success Response (200) Displays detailed help information for Servy CLI commands in the console. #### Response Example ``` [Help text will be displayed here] ``` ``` -------------------------------- ### Install Elixir Script as Service (PowerShell) Source: https://github.com/defiect/servy-wiki-old/blob/main/Examples-&-Recipes.md Installs an Elixir script (`.exs`) or mix task to run as a Windows service. It specifies the Elixir runtime, script path, and configures automatic startup. ```powershell servy-cli install \ --name="MyElixirService" \ --description="Elixir background worker" \ --path="C:\Program Files\Elixir\bin\elixir.bat" \ --params="C:\apps\elixir\worker.exs" \ --startupDir="C:\apps\elixir" \ --startupType="Automatic" ```