Some checks are pending
CI / Integration (mcr.microsoft.com/mssql/server:2019-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2022-latest) (push) Blocked by required conditions
CI / Build og unit tests (push) Waiting to run
CI / MSI-installer (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2017-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2025-latest) (push) Blocked by required conditions
installer/SQLInsight.wxs (WiX 3 syntax) builds on Linux with wixl (installer/build-msi.sh) and in Forgejo CI on every v* tag. Agent and Web are installed self-contained as Windows services under virtual service accounts (or a gMSA), with a settings page in the wizard or MSI properties for silent installs; the values go to sqlinsight.ini, read after appsettings.json. The data folder is locked to SYSTEM, Administrators and the agent account, the event log source is registered, the web port is opened in the firewall, and the automatic update task is an optional feature. Upgrades happen in place, keep edited settings and the chosen features; uninstall keeps the settings. msi-tables.py writes what wixl lacks (component and feature conditions, Permanent/NeverOverwrite, vital services, REG_EXPAND_SZ) and verify-msi.py checks the result (sequencing, deferred actions, ASCII only). test-msi-wine.sh runs install, upgrade and uninstall under Wine. Installations made with the MSI get new versions as MSI packages run by the update task, so Windows Installer stays in charge of the files. The example instance is removed from the shipped appsettings.json, and the CLI writes UTF-8 to the console. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E3EExwndy8Z22EK2Qpt6BK
32 lines
1.3 KiB
C#
32 lines
1.3 KiB
C#
using Microsoft.Extensions.Configuration.Ini;
|
|
using Microsoft.Extensions.Configuration.Json;
|
|
|
|
namespace SQLInsight.Agent;
|
|
|
|
/// <summary>
|
|
/// sqlinsight.ini, written by the MSI installer from the values given at install time (connection string, port …).
|
|
/// It is read right after appsettings.json, so it overrides the examples there, while appsettings.{Environment}.json,
|
|
/// environment variables and the command line still override it.
|
|
/// </summary>
|
|
public static class InstallerSettings
|
|
{
|
|
public const string FileName = "sqlinsight.ini";
|
|
|
|
public static void Add(IConfigurationBuilder configuration, string directory)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(configuration);
|
|
var source = new IniConfigurationSource { Path = Path.Combine(directory, FileName), Optional = true, ReloadOnChange = false };
|
|
source.ResolveFileProvider();
|
|
var appsettings = configuration.Sources
|
|
.Select((s, i) => (Source: s, Index: i))
|
|
.LastOrDefault(x => x.Source is JsonConfigurationSource json && string.Equals(json.Path, "appsettings.json", StringComparison.OrdinalIgnoreCase));
|
|
if (appsettings.Source is null)
|
|
{
|
|
configuration.Add(source);
|
|
}
|
|
else
|
|
{
|
|
configuration.Sources.Insert(appsettings.Index + 1, source);
|
|
}
|
|
}
|
|
}
|