mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-26 14:37:44 +01:00
.msi + winget package initial support
This commit is contained in:
@@ -8,6 +8,7 @@ coverage:
|
||||
comment:
|
||||
layout: "header, diff, changes"
|
||||
ignore:
|
||||
- "build"
|
||||
- "src/Tgstation.Server.Host/Database/Design"
|
||||
- "src/Tgstation.Server.Host/Database/Migrations/MySqlDatabaseContextModelSnapshot.cs"
|
||||
- "src/Tgstation.Server.Host/Database/Migrations/PostgresSqlDatabaseContextModelSnapshot.cs"
|
||||
|
||||
@@ -34,7 +34,7 @@ You can of course, as always, ask for help at [#coderbus](irc://irc.rizon.net/co
|
||||
|
||||
### Development Environment
|
||||
|
||||
You need the Dotnet 6.0 SDK and npm>=v5.7 (in your PATH) to compile the server. In order to build the service version you also need a .NET 4.7.1 build chain
|
||||
You need the Dotnet 6.0 SDK and npm>=v5.7 (in your PATH) to compile the server. In order to build the service version you also need a .NET 4.7.2 build chain. In order to build the .msi installer, you'll need [Visual Studio 2022](https://visualstudio.microsoft.com/vs/) or greater and the [Visual Studio Installer Projects Extension](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects).
|
||||
|
||||
The recommended IDE is Visual Studio 2019 which has installation options for both of these.
|
||||
|
||||
|
||||
@@ -920,11 +920,39 @@ jobs:
|
||||
name: packaging-debian
|
||||
path: tgstation-server-v${{ env.TGS_VERSION }}.debian.packaging.tar.xz
|
||||
|
||||
build-msi:
|
||||
name: Build .msi Package
|
||||
needs: start-ci-run-gate
|
||||
runs-on: windows-latest
|
||||
if: "!(cancelled() || failure()) && needs.start-ci-run-gate.result == 'success'"
|
||||
steps:
|
||||
- name: Setup dotnet
|
||||
uses: actions/setup-dotnet@v2
|
||||
with:
|
||||
dotnet-version: ${{ env.TGS_DOTNET_VERSION }}
|
||||
|
||||
- name: Setup VS Dev Environment
|
||||
uses: seanmiddleditch/gha-setup-vsdevenv@v4
|
||||
|
||||
- name: Disable Out of Process Building
|
||||
working-directory: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/Common7/IDE/CommonExtensions/Microsoft/VSI/DisableOutOfProcBuild
|
||||
run: ./DisableOutOfProcBuild.exe
|
||||
|
||||
- name: Build .vdproj
|
||||
shell: powershell
|
||||
run: build/package/winget/build_package.ps1
|
||||
|
||||
- name: Upload .msi
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: packaging-windows
|
||||
path: packaging/build/package/winget/Tgstation.Server.Host.Service.Msi/Release/tgstation-server.msi
|
||||
|
||||
deployment-gate:
|
||||
name: Deployment Gate
|
||||
needs: [ dox-build, docker-build, build-deb, validate-openapi-spec, upload-code-coverage ]
|
||||
needs: [ dox-build, docker-build, build-deb, validate-openapi-spec, upload-code-coverage, build-msi ]
|
||||
runs-on: ubuntu-latest
|
||||
if: "!(cancelled() || failure()) && needs.dox-build.result == 'success' && needs.docker-build.result == 'success' && needs.build-deb.result == 'success' && needs.validate-openapi-spec.result == 'success' && needs.upload-code-coverage.result == 'success' && github.event_name == 'push'"
|
||||
if: "!(cancelled() || failure()) && needs.dox-build.result == 'success' && needs.docker-build.result == 'success' && needs.build-deb.result == 'success' && needs.build-msi.result == 'success' && needs.validate-openapi-spec.result == 'success' && needs.upload-code-coverage.result == 'success' && github.event_name == 'push'"
|
||||
steps:
|
||||
- name: GitHub Requires at Least One Step for a Job
|
||||
run: exit 0
|
||||
@@ -1120,6 +1148,12 @@ jobs:
|
||||
name: packaging-debian
|
||||
path: packaging-debian
|
||||
|
||||
- name: Retrieve .msi
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: packaging-windows
|
||||
path: packaging-windows
|
||||
|
||||
- name: Zip Artifacts
|
||||
shell: powershell
|
||||
run: |
|
||||
@@ -1203,6 +1237,16 @@ jobs:
|
||||
asset_name: tgstation-server-v${{ env.TGS_VERSION }}.debian.packaging.tar.xz
|
||||
asset_content_type: application/x-tar
|
||||
|
||||
- name: Upload .msi
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.DEV_PUSH_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./packaging-windows/tgstation-server.msi
|
||||
asset_name: tgstation-server.msi
|
||||
asset_content_type: application/octet-stream
|
||||
|
||||
deploy-docker:
|
||||
name: Deploy TGS (Docker)
|
||||
needs: deploy-tgs
|
||||
|
||||
@@ -24,3 +24,4 @@ release_notes.md
|
||||
*nupkg
|
||||
*.sqlite3
|
||||
packaging/
|
||||
build/package/winget/Tgstation.Server.Host.Service.Msi/Release/
|
||||
|
||||
@@ -26,7 +26,39 @@ Follow the instructions for your OS below.
|
||||
|
||||
#### Windows
|
||||
|
||||
Download and install the [ASP .NET Core Runtime (>= v6.0)](https://dotnet.microsoft.com/download/dotnet/6.0) (Choose the option to `Run Server Apps` for your system). If you plan to install tgstation-server as a Windows service, you should also ensure that your .NET Framework runtime version is >= v4.7.2 (Most modern systems have it by default. Download can be found on same page). Ensure that the `dotnet` executable file is in your system's `PATH` variable (or that of the user's that will be running the server), you can test this by opening a command prompt and running `dotnet --list-runtimes`.
|
||||
##### Installer
|
||||
|
||||
If you don't have it installed already, download and install the [ASP .NET Core Runtime (>= v6.0)](https://dotnet.microsoft.com/download/dotnet/6.0). Ensure that the `dotnet` executable file is in your system's `PATH` variable (or that of the user's that will be running the server). You can test this by opening a command prompt and running `dotnet --list-runtimes`.
|
||||
|
||||
You should also ensure that your .NET Framework runtime version is >= v4.7.2. Most modern systems have it by default so this isn't much of a concern. If, somehow, you don't have it installed, it can be downloaded [here](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472).
|
||||
|
||||
[Download the latest release .msi](https://github.com/tgstation/tgstation-server/releases/latest). Executing it will take you through the process of installing and configuring your server.
|
||||
|
||||
##### winget
|
||||
|
||||
If you have [winget]() installed. You can easily install the latest version of tgstation-server (provided Microsoft has approved the most recent package manifest).
|
||||
|
||||
Simply run the following command:
|
||||
```sh
|
||||
winget install tgstation-server
|
||||
```
|
||||
|
||||
If you get an error like `This file does not have an app associated with it for performing this action.` run with the `--silent` flag:
|
||||
```sh
|
||||
winget install tgstation-server --silent
|
||||
```
|
||||
|
||||
You won't be prompted to run the setup wizard. However, you can do so immediately after via the shortcut placed on your desktop.
|
||||
|
||||
NOTE:
|
||||
|
||||
`winget` should, theoretically, install the ASP .NET Core 6.0 Runtime as a pre-reqiusite. At the time of this writing, this functionality is untested (TODO). If the runtime isn't automatically installed for you, see above or below for steps on how to download and install it manually.
|
||||
|
||||
##### Manual
|
||||
|
||||
If you don't have it installed already, download and install the [ASP .NET Core Runtime (>= v6.0)](https://dotnet.microsoft.com/download/dotnet/6.0). Ensure that the `dotnet` executable file is in your system's `PATH` variable (or that of the user's that will be running the server). You can test this by opening a command prompt and running `dotnet --list-runtimes`.
|
||||
|
||||
You should also ensure that your .NET Framework runtime version is >= v4.7.2. Most modern systems have it by default so this isn't much of a concern. If, somehow, you don't have it installed, it can be downloaded [here](https://dotnet.microsoft.com/en-us/download/dotnet-framework/net472).
|
||||
|
||||
[Download the latest release .zip](https://github.com/tgstation/tgstation-server/releases/latest). You probably want the `ServerService` package. Choose `ServerConsole` if you prefer not to use the Windows service.
|
||||
|
||||
@@ -36,7 +68,7 @@ If you wish to install the TGS as a service, run `Tgstation.Server.Host.Service.
|
||||
|
||||
Should you want a clean start, be sure to first uninstall the service by running `Tgstation.Server.Host.Service.exe -u` from the command line.
|
||||
|
||||
If using the console version, run ./tgs.bat in the root of the installation directory. Ctrl+C will close the server, terminating all live game instances.
|
||||
If using the console version, run `./tgs.bat` in the root of the installation directory. Ctrl+C will close the server, terminating all live game instances.
|
||||
|
||||
#### Linux
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
|
||||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false"/>
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
||||
@@ -0,0 +1,96 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using var process = new Process();
|
||||
|
||||
var installDir = Path.GetDirectoryName(
|
||||
Assembly.GetExecutingAssembly().Location)!;
|
||||
|
||||
process.StartInfo.WorkingDirectory = installDir;
|
||||
process.StartInfo.FileName = Path.Combine(
|
||||
process.StartInfo.WorkingDirectory,
|
||||
"Tgstation.Server.Host.Service.exe");
|
||||
|
||||
/*
|
||||
https://www.roelvanlisdonk.nl/2009/11/13/how-to-detect-unattended-installation-msiexec-quit-or-qn-in-youre-custom-action-with-c/
|
||||
msiUILevelNoChange 0 Does not change UI level.
|
||||
msiUILevelDefault 1 Uses default UI level.
|
||||
msiUILevelNone 2 Silent installation.
|
||||
msiUILevelBasic 3 Simple progress and error handling.
|
||||
msiUILevelReduced 4 Authored UI and wizard dialog boxes suppressed.
|
||||
msiUILevelFull 5 Authored UI with wizards, progress, and errors.
|
||||
msiUILevelHideCancel 32 If combined with the msiUILevelBasic value, the installer shows progress dialog boxes but does not display a Cancel button on the dialog box to prevent users from canceling the installation.
|
||||
msiUILevelProgressOnly 64 If combined with the msiUILevelBasic value, the installer displays progress dialog boxes but does not display any modal dialog boxes or error dialog boxes.
|
||||
msiUILevelEndDialog 128 If combined with any above value, the installer displays a modal dialog box at the end of a successful installation or if there has been an error. No dialog box is displayed if the user cancels.
|
||||
*/
|
||||
var uiLevel = Int32.Parse(args[0]);
|
||||
|
||||
// leave it to MS to overcomplicate things
|
||||
var interactive = uiLevel switch
|
||||
{
|
||||
0 or 1 or 4 or 5 => true,
|
||||
_ => false,
|
||||
};
|
||||
|
||||
var silent = uiLevel == 2;
|
||||
|
||||
var uninstall = args
|
||||
.Any(arg => arg.Equals("--uninstall", StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var shortcut = uiLevel == 42069;
|
||||
|
||||
process.StartInfo.Arguments = uninstall
|
||||
? "-u"
|
||||
: shortcut
|
||||
? "-c"
|
||||
: $"-i -f {(interactive ? "-c" : String.Empty)} {(silent ? "-s" : String.Empty)}";
|
||||
|
||||
process.Start();
|
||||
|
||||
await process.WaitForExitAsync(CancellationToken.None); // DCT: None available
|
||||
|
||||
foreach (var installLogFile in Directory.EnumerateFiles(installDir, "*.log"))
|
||||
File.Delete(installLogFile);
|
||||
|
||||
if (uninstall)
|
||||
{
|
||||
Directory.Delete(
|
||||
Path.Combine(installDir, "lib"),
|
||||
true);
|
||||
}
|
||||
|
||||
if(shortcut && process.ExitCode == 0)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.Write("tgstation-server is now configured. Would you like to (re)start the service? (Y/n): ");
|
||||
var keyInfo = Console.ReadKey();
|
||||
Console.WriteLine();
|
||||
if (keyInfo.Key == ConsoleKey.Y || keyInfo.Key == ConsoleKey.Enter)
|
||||
{
|
||||
using (var stopService = new Process())
|
||||
{
|
||||
stopService.StartInfo.FileName = "sc";
|
||||
stopService.StartInfo.Arguments = "stop tgstation-server";
|
||||
stopService.Start();
|
||||
await stopService.WaitForExitAsync(CancellationToken.None); // DCT: None available
|
||||
}
|
||||
|
||||
using var startService = new Process();
|
||||
startService.StartInfo.FileName = "sc";
|
||||
startService.StartInfo.Arguments = "start tgstation-server";
|
||||
startService.Start();
|
||||
await startService.WaitForExitAsync(CancellationToken.None); // DCT: None available
|
||||
}
|
||||
|
||||
Console.WriteLine("Press any key to exit this program...");
|
||||
Console.ReadKey();
|
||||
Console.WriteLine();
|
||||
}
|
||||
|
||||
// returning non-zero can make the installation uninstallable, no thanks
|
||||
return uninstall ? 0 : process.ExitCode;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ApplicationManifest>../../../manifest.xml</ApplicationManifest>
|
||||
<ApplicationIcon>../../../tgs.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AdditionalFiles Include="../../../manifest.xml" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+1042
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,21 @@
|
||||
$currentCommit=git rev-parse HEAD
|
||||
|
||||
Remove-Item -Recurse -Force packaging
|
||||
|
||||
git worktree remove -f packaging
|
||||
|
||||
$ErrorActionPreference="Stop"
|
||||
|
||||
git worktree add -f packaging $currentCommit
|
||||
cd packaging
|
||||
Remove-Item -Recurse -Force .git
|
||||
|
||||
[XML]$versionXML = Get-Content build/Version.props
|
||||
$tgsVersion = $versionXML.Project.PropertyGroup.TgsCoreVersion
|
||||
|
||||
(Get-Content build/package/winget/Tgstation.Server.Host.Service.Msi/Tgstation.Server.Host.Service.Msi.vdproj).Replace('22.47.5', $tgsVersion) | Set-Content build/package/winget/Tgstation.Server.Host.Service.Msi/Tgstation.Server.Host.Service.Msi.vdproj
|
||||
|
||||
# We make _some_ assumptions
|
||||
DevEnv tgstation-server.sln /Project build/package/winget/Tgstation.Server.Host.Service.Msi/Tgstation.Server.Host.Service.Msi.vdproj /build Release
|
||||
|
||||
cd ..
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,28 @@
|
||||
# Created using wingetcreate 1.2.6.0
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.installer.1.4.0.schema.json
|
||||
|
||||
PackageIdentifier: Tgstation.Server
|
||||
PackageVersion: 0.0.0 # Set before publish by wingetcreate
|
||||
Installers:
|
||||
- InstallerUrl: https://github.com/tgstation/tgstation-server/releases/download/tgstation-server-v0.0.0/tgstation-server.msi # Set before publish by wingetcreate
|
||||
InstallerLocale: en-US
|
||||
Architecture: x64
|
||||
InstallerType: msi
|
||||
Scope: machine
|
||||
InstallerSha256: F749672C1BDBAC8CD8AEF7352B97E54C21CF389D798D0ED245CA75EC72521460
|
||||
InstallModes:
|
||||
- interactive
|
||||
- silent
|
||||
UpgradeBehavior: uninstallPrevious
|
||||
ProductCode: '{D24887FA-3228-4509-B5F3-4E07E349F278}'
|
||||
RequireExplicitUpgrade: true
|
||||
UnsupportedOSArchitectures:
|
||||
- arm
|
||||
- arm64
|
||||
ElevationRequirement: elevationRequired
|
||||
Dependencies:
|
||||
PackageDependencies:
|
||||
- PackageIdentifier: Microsoft.DotNet.AspNetCore.6
|
||||
ReleaseDate: 2023-06-24
|
||||
ManifestType: installer
|
||||
ManifestVersion: 1.4.0
|
||||
@@ -0,0 +1,12 @@
|
||||
# Created using wingetcreate 1.2.6.0
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.defaultLocale.1.4.0.schema.json
|
||||
|
||||
PackageIdentifier: Tgstation.Server
|
||||
PackageVersion: 0.0.0 # Set before publish by wingetcreate
|
||||
PackageLocale: en-US
|
||||
Publisher: /tg/station 13
|
||||
PackageName: tgstation-server
|
||||
License: AGPL-3.0
|
||||
ShortDescription: A production scale tool for BYOND server management
|
||||
ManifestType: defaultLocale
|
||||
ManifestVersion: 1.4.0
|
||||
@@ -0,0 +1,8 @@
|
||||
# Created using wingetcreate 1.2.6.0
|
||||
# yaml-language-server: $schema=https://aka.ms/winget-manifest.version.1.4.0.schema.json
|
||||
|
||||
PackageIdentifier: Tgstation.Server
|
||||
PackageVersion: 0.0.0 # Set before publish by wingetcreate
|
||||
DefaultLocale: en-US
|
||||
ManifestType: version
|
||||
ManifestVersion: 1.4.0
|
||||
@@ -9,6 +9,7 @@
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
|
||||
<DocumentationFile>bin/$(Configuration)/$(TargetFramework)/$(AssemblyName).xml</DocumentationFile>
|
||||
<ApplicationIcon>../../build/tgs.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
||||
@@ -43,6 +43,18 @@ namespace Tgstation.Server.Host.Service
|
||||
[Option(ShortName = "i")]
|
||||
public bool Install { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The --force or -f option.
|
||||
/// </summary>
|
||||
[Option(ShortName = "f")]
|
||||
public bool Force { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The --silent or -s option.
|
||||
/// </summary>
|
||||
[Option(ShortName = "s")]
|
||||
public bool Silent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The --configure or -c option.
|
||||
/// </summary>
|
||||
@@ -82,14 +94,16 @@ namespace Tgstation.Server.Host.Service
|
||||
/// <summary>
|
||||
/// Attempt to install the TGS Service.
|
||||
/// </summary>
|
||||
static void RunServiceInstall()
|
||||
void RunServiceInstall()
|
||||
{
|
||||
// First check if the service already exists
|
||||
if (Environment.UserInteractive)
|
||||
if (Force || Environment.UserInteractive)
|
||||
foreach (ServiceController sc in ServiceController.GetServices())
|
||||
if (sc.ServiceName == "tgstation-server" || sc.ServiceName == "tgstation-server-4")
|
||||
{
|
||||
DialogResult result = MessageBox.Show($"You already have another TGS service installed ({sc.ServiceName}). Would you like to uninstall it now? Pressing \"No\" will cancel this install.", "TGS Service", MessageBoxButtons.YesNo);
|
||||
DialogResult result = !Force
|
||||
? MessageBox.Show($"You already have another TGS service installed ({sc.ServiceName}). Would you like to uninstall it now? Pressing \"No\" will cancel this install.", "TGS Service", MessageBoxButtons.YesNo)
|
||||
: DialogResult.Yes;
|
||||
if (result != DialogResult.Yes)
|
||||
return; // is this needed after exit?
|
||||
|
||||
@@ -103,6 +117,10 @@ namespace Tgstation.Server.Host.Service
|
||||
// And remove it
|
||||
using var serviceInstaller = new ServiceInstaller();
|
||||
serviceInstaller.Context = new InstallContext($"old-{sc.ServiceName}-uninstall.log", null);
|
||||
|
||||
if (Silent)
|
||||
serviceInstaller.Context.Parameters["LogToConsole"] = false.ToString();
|
||||
|
||||
serviceInstaller.ServiceName = sc.ServiceName;
|
||||
serviceInstaller.Uninstall(null);
|
||||
}
|
||||
@@ -112,8 +130,10 @@ namespace Tgstation.Server.Host.Service
|
||||
processInstaller.Account = ServiceAccount.LocalSystem;
|
||||
|
||||
installer.Context = new InstallContext("tgs-install.log", new string[] { String.Format(CultureInfo.InvariantCulture, "/assemblypath={0}", Assembly.GetEntryAssembly().Location) });
|
||||
installer.Description = "/tg/station 13 server running as a windows service";
|
||||
installer.DisplayName = "/tg/station server";
|
||||
if (Silent)
|
||||
installer.Context.Parameters["LogToConsole"] = false.ToString();
|
||||
installer.Description = "tgstation-server running as a windows service";
|
||||
installer.DisplayName = "tgstation-server";
|
||||
installer.StartType = ServiceStartMode.Automatic;
|
||||
installer.ServicesDependedOn = new string[] { "Tcpip", "Dhcp", "Dnscache" };
|
||||
installer.ServiceName = ServerService.Name;
|
||||
@@ -149,7 +169,7 @@ namespace Tgstation.Server.Host.Service
|
||||
{
|
||||
UseShellExecute = true,
|
||||
Verb = "runas",
|
||||
Arguments = String.Format(CultureInfo.InvariantCulture, "{0} {1}", Install ? "-i" : Uninstall ? "-u" : String.Empty, Configure ? "-c" : String.Empty),
|
||||
Arguments = $"{(Install ? "-i" : Uninstall ? "-u" : String.Empty)} {(Configure ? "-c" : String.Empty)} {(Force ? "-f" : String.Empty)}",
|
||||
FileName = exe,
|
||||
WorkingDirectory = Environment.CurrentDirectory,
|
||||
};
|
||||
@@ -165,16 +185,16 @@ namespace Tgstation.Server.Host.Service
|
||||
|
||||
RunServiceInstall();
|
||||
|
||||
if (Configure)
|
||||
{
|
||||
if (Configure && !Silent)
|
||||
Console.WriteLine("For this first run we'll launch the console runner so you may use the setup wizard.");
|
||||
Console.WriteLine("If it starts successfully, feel free to close it and then start the service from the Windows control panel.");
|
||||
}
|
||||
}
|
||||
else if (Uninstall)
|
||||
using (var installer = new ServiceInstaller())
|
||||
{
|
||||
installer.Context = new InstallContext("tgs-uninstall.log", null);
|
||||
if (Silent)
|
||||
installer.Context.Parameters["LogToConsole"] = false.ToString();
|
||||
|
||||
installer.ServiceName = ServerService.Name;
|
||||
installer.Uninstall(null);
|
||||
}
|
||||
@@ -185,11 +205,23 @@ namespace Tgstation.Server.Host.Service
|
||||
}
|
||||
|
||||
if (Configure)
|
||||
await RunConfigure(CancellationToken.None); // DCT: None available
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Runs the host application with the setup wizard.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The <see cref="CancellationToken"/> for the operation.</param>
|
||||
/// <returns>A <see cref="Task"/> representing the running operation.</returns>
|
||||
async Task RunConfigure(CancellationToken cancellationToken)
|
||||
{
|
||||
using var loggerFactory = LoggerFactory.Create(builder =>
|
||||
{
|
||||
using var loggerFactory = LoggerFactory.Create(builder => builder.AddConsole());
|
||||
await WatchdogFactory.CreateWatchdog(loggerFactory)
|
||||
.RunAsync(true, Array.Empty<string>(), CancellationToken.None); // DCT: None available
|
||||
}
|
||||
if (!Silent)
|
||||
builder.AddConsole();
|
||||
});
|
||||
await WatchdogFactory.CreateWatchdog(loggerFactory)
|
||||
.RunAsync(true, Array.Empty<string>(), cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<EnableNETAnalyzers>true</EnableNETAnalyzers>
|
||||
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
|
||||
<DocumentationFile>bin/$(Configuration)/$(TargetFramework)/$(RuntimeIdentifier)/$(AssemblyName).xml</DocumentationFile>
|
||||
<ApplicationIcon>../../build/tgs.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
||||
@@ -9,6 +9,11 @@
|
||||
<CodeAnalysisRuleSet>../../build/analyzers.ruleset</CodeAnalysisRuleSet>
|
||||
<DocumentationFile>bin/$(Configuration)/$(TargetFramework)/$(AssemblyName).xml</DocumentationFile>
|
||||
<NoWarn>API1000</NoWarn>
|
||||
<NodeModulesFolder>ClientApp/node_modules</NodeModulesFolder>
|
||||
<NpmInstallStampFile>ClientApp/node_modules/.install-stamp</NpmInstallStampFile>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<ApplicationManifest>../../build/manifest.xml</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Release'">
|
||||
@@ -16,14 +21,6 @@
|
||||
<WarningsAsErrors />
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<NodeModulesFolder>ClientApp/node_modules</NodeModulesFolder>
|
||||
<NpmInstallStampFile>ClientApp/node_modules/.install-stamp</NpmInstallStampFile>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
<DockerfileContext>..\..</DockerfileContext>
|
||||
<ApplicationManifest>manifest.xml</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>$(DefineConstants);WATCHDOG_FREE_RESTART</DefineConstants>
|
||||
</PropertyGroup>
|
||||
@@ -86,7 +83,6 @@
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.8" />
|
||||
<!-- Usage: Automatic migration generation using command line -->
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.8">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<!-- Usage: Sqlite ORM plugin -->
|
||||
@@ -117,7 +113,6 @@
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
|
||||
<!-- Usage: Linting -->
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<!-- Usage: OpenAPI spec generator -->
|
||||
@@ -143,15 +138,11 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Remove="ClientApp\package-lock.json" />
|
||||
<Content Remove="ClientApp\package.json" />
|
||||
<Content Remove="ClientApp\tsconfig.json" />
|
||||
<Content Remove="ClientApp\tslint.json" />
|
||||
<None Include="ClientApp\package-lock.json" />
|
||||
<None Include="ClientApp\package.json" />
|
||||
<None Include="ClientApp\tsconfig.json" />
|
||||
<Content Remove="ClientApp\**\*.json" />
|
||||
<None Include="ClientApp\**\*.json" />
|
||||
<ClientApp Include="ClientApp\src\**\*;ClientApp\public\**\*;ClientApp\tsconfig.json;ClientApp\package.json;ClientApp\package-lock.json" />
|
||||
<AdditionalFiles Include="../../build/stylecop.json" />
|
||||
<AdditionalFiles Include="../../build/manifest.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
+39
-1
@@ -30,6 +30,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{6FF654E6
|
||||
build\coverlet.runsettings = build\coverlet.runsettings
|
||||
build\Dockerfile = build\Dockerfile
|
||||
build\GenerateMigrations.sh = build\GenerateMigrations.sh
|
||||
build\manifest.xml = build\manifest.xml
|
||||
build\NugetCommon.props = build\NugetCommon.props
|
||||
build\OpenApiValidationSettings.json = build\OpenApiValidationSettings.json
|
||||
build\stylecop.json = build\stylecop.json
|
||||
@@ -201,11 +202,14 @@ EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Common", "src\Tgstation.Server.Common\Tgstation.Server.Common.csproj", "{70CD9A98-D31A-44A4-81D1-D02764CEEEFD}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "package", "package", "{2648A85F-61AE-428E-95E1-66D06C7A3768}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
build\package\appsettings.Initial.yml = build\package\appsettings.Initial.yml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "deb", "deb", "{457A1F89-6201-4430-BCC6-2F4438A54B9E}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
build\package\deb\appsettings.Initial.yml = build\package\deb\appsettings.Initial.yml
|
||||
build\package\deb\build_package.sh = build\package\deb\build_package.sh
|
||||
build\package\deb\install_artifacts.sh = build\package\deb\install_artifacts.sh
|
||||
build\package\deb\MakeInstall = build\package\deb\MakeInstall
|
||||
build\package\deb\tgs-configure = build\package\deb\tgs-configure
|
||||
build\package\deb\wrap_gpg.sh = build\package\deb\wrap_gpg.sh
|
||||
@@ -216,6 +220,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "debian", "debian", "{08E7C6
|
||||
build\package\deb\debian\changelog = build\package\deb\debian\changelog
|
||||
build\package\deb\debian\control = build\package\deb\debian\control
|
||||
build\package\deb\debian\copyright = build\package\deb\debian\copyright
|
||||
build\package\deb\install_artifacts.sh = build\package\deb\install_artifacts.sh
|
||||
build\package\deb\debian\links = build\package\deb\debian\links
|
||||
build\package\deb\debian\postinst = build\package\deb\debian\postinst
|
||||
build\package\deb\debian\prerm = build\package\deb\debian\prerm
|
||||
@@ -227,6 +232,22 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "upstream", "upstream", "{B4
|
||||
build\package\deb\debian\upstream\metadata = build\package\deb\debian\upstream\metadata
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "winget", "winget", "{506B9092-AF88-4DA2-84FD-C11646B695B0}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
build\package\winget\build_package.ps1 = build\package\winget\build_package.ps1
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tgstation.Server.Host.Service.Configure", "build\package\winget\Tgstation.Server.Host.Service.Configure\Tgstation.Server.Host.Service.Configure.csproj", "{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "manifest", "manifest", "{3F141E03-6ABB-46A8-AA24-1B4B6814E58F}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
build\package\winget\manifest\Tgstation.Server.installer.yaml = build\package\winget\manifest\Tgstation.Server.installer.yaml
|
||||
build\package\winget\manifest\Tgstation.Server.locale.en-US.yaml = build\package\winget\manifest\Tgstation.Server.locale.en-US.yaml
|
||||
build\package\winget\manifest\Tgstation.Server.yaml = build\package\winget\manifest\Tgstation.Server.yaml
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Tgstation.Server.Host.Service.Msi", "build\package\winget\Tgstation.Server.Host.Service.Msi\Tgstation.Server.Host.Service.Msi.vdproj", "{73F75AAF-7885-490A-8262-B5C852AC8A47}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -383,6 +404,19 @@ Global
|
||||
{70CD9A98-D31A-44A4-81D1-D02764CEEEFD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{70CD9A98-D31A-44A4-81D1-D02764CEEEFD}.ReleaseNoService|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{70CD9A98-D31A-44A4-81D1-D02764CEEEFD}.ReleaseNoService|Any CPU.Build.0 = Release|Any CPU
|
||||
{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315}.Debug|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315}.DebugNoService|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315}.ReleaseNoService|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.Debug|Any CPU.ActiveCfg = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.Debug|Any CPU.Build.0 = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.DebugNoService|Any CPU.ActiveCfg = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.DebugNoService|Any CPU.Build.0 = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.Release|Any CPU.ActiveCfg = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.Release|Any CPU.Build.0 = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.ReleaseNoService|Any CPU.ActiveCfg = Release
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47}.ReleaseNoService|Any CPU.Build.0 = Release
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
@@ -415,6 +449,10 @@ Global
|
||||
{457A1F89-6201-4430-BCC6-2F4438A54B9E} = {2648A85F-61AE-428E-95E1-66D06C7A3768}
|
||||
{08E7C650-A447-4DE2-974E-ED123B50F8D6} = {457A1F89-6201-4430-BCC6-2F4438A54B9E}
|
||||
{B4B5570C-8071-46DE-BB55-64C13480C606} = {08E7C650-A447-4DE2-974E-ED123B50F8D6}
|
||||
{506B9092-AF88-4DA2-84FD-C11646B695B0} = {2648A85F-61AE-428E-95E1-66D06C7A3768}
|
||||
{6CC73878-8C37-4ACC-ADAA-A60EBDBC2315} = {506B9092-AF88-4DA2-84FD-C11646B695B0}
|
||||
{3F141E03-6ABB-46A8-AA24-1B4B6814E58F} = {506B9092-AF88-4DA2-84FD-C11646B695B0}
|
||||
{73F75AAF-7885-490A-8262-B5C852AC8A47} = {506B9092-AF88-4DA2-84FD-C11646B695B0}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {DFD36C95-3E49-41C7-ACDB-86BAF5B18A79}
|
||||
|
||||
Reference in New Issue
Block a user