Commit 8c9e8a0
* Add Installer.Core shared library and retarget InstallerGui + Tests (#755)
Phase 1 extraction of shared installation logic into Installer.Core class
library. InstallerGui and Installer.Tests now consume the shared library
instead of duplicating code. CLI Installer refactor is next.
New files:
- Installer.Core/InstallationService.cs — all static install/upgrade methods
- Installer.Core/DependencyInstaller.cs — community dependency downloads
- Installer.Core/ScriptProvider.cs — filesystem + embedded resource abstraction
- Installer.Core/Patterns.cs — shared regex patterns ([GeneratedRegex])
- Installer.Core/Models/ — InstallationProgress, ServerInfo, InstallationResult,
UpgradeInfo, InstallationResultCode (enum mapping CLI exit codes 0-8)
Key changes:
- SQL scripts embedded as assembly resources for future Dashboard integration
- ScriptProvider.FromDirectory() for CLI/GUI, FromEmbeddedResources() for Dashboard
- AutoDiscover() searches filesystem then falls back to embedded
- Comprehensive [DEBUG] logging throughout all methods for GUI diagnostics
- upgrade.txt missing warning (was silently skipped, now logged)
- GenerateSummaryReport gains optional outputDirectory parameter
Retargeted:
- InstallerGui references Installer.Core, old InstallationService.cs deleted
- Installer.Tests targets net8.0 (was net8.0-windows), no WPF dependency
- Tests use ScriptProvider.FromDirectory() instead of raw file paths
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Refactor CLI Installer to thin wrapper over Installer.Core (#755)
Program.cs rewritten from 2,122 lines to 1,172 lines (45% reduction).
All duplicated logic removed — CLI now delegates to Installer.Core for:
- Connection string building (InstallationService.BuildConnectionString)
- Connection testing (InstallationService.TestConnectionAsync)
- Script discovery (ScriptProvider.FromDirectory)
- SQL file execution (InstallationService.ExecuteInstallationAsync)
- Upgrade detection and execution (ExecuteAllUpgradesAsync)
- Uninstall (InstallationService.ExecuteUninstallAsync)
- Version detection (InstallationService.GetInstalledVersionAsync)
- Community dependencies (DependencyInstaller)
- Validation (InstallationService.RunValidationAsync)
- Installation history (InstallationService.LogInstallationHistoryAsync)
- Summary reports (InstallationService.GenerateSummaryReport)
What stays in Program.cs (console-specific):
- Argument parsing, interactive prompts, retry loop
- Console output helpers (WriteSuccess/WriteError/WriteWarning)
- ReadPassword, WaitForExit, CheckForInstallerUpdateAsync
- Error log generation (WriteErrorLog)
Fixes during review:
- Added missing exit code 8 (UpgradesFailed) to --help text
- Fixed encryption default label in error message (was "optional", is "mandatory")
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Fix doomed transaction error handling in delta framework and ensure_collection_table (#756)
When calculate_deltas was called inside a collector's transaction and failed,
the CATCH block tried to INSERT into collection_log while the transaction was
doomed (XACT_STATE = -1), swallowing the real error with "The current transaction
cannot be committed." Same pattern in ensure_collection_table where INSERT
happened before ROLLBACK.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* Add XACT_STATE check after third-party proc calls in XML processors (#695)
sp_BlitzLock and sp_HumanEventsBlockViewer can fail internally and doom
the caller's transaction. Without checking XACT_STATE after the call,
the next write attempt produces "cannot be committed" which swallows
the real error. Now we detect the doomed state, rollback, and surface
a meaningful error message.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 91f46f7 commit 8c9e8a0
21 files changed
Lines changed: 3206 additions & 3726 deletions
File tree
- Installer.Core
- Models
- Installer.Tests
- InstallerGui
- Services
- Installer
- install
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
0 commit comments