Net4x.DapperLibrary.Installation
1.9.9
dotnet add package Net4x.DapperLibrary.Installation --version 1.9.9
NuGet\Install-Package Net4x.DapperLibrary.Installation -Version 1.9.9
<PackageReference Include="Net4x.DapperLibrary.Installation" Version="1.9.9" />
<PackageVersion Include="Net4x.DapperLibrary.Installation" Version="1.9.9" />
<PackageReference Include="Net4x.DapperLibrary.Installation" />
paket add Net4x.DapperLibrary.Installation --version 1.9.9
#r "nuget: Net4x.DapperLibrary.Installation, 1.9.9"
#:package Net4x.DapperLibrary.Installation@1.9.9
#addin nuget:?package=Net4x.DapperLibrary.Installation&version=1.9.9
#tool nuget:?package=Net4x.DapperLibrary.Installation&version=1.9.9
DapperLibrary.Installation
Helpers to detect and perform basic installation tasks for native components (MSI installers) and to assist Docker installation checks on supported runtimes.
Overview
This project contains small utilities used by the DapperLibraries to ensure required native components or tools are available on the host (for example, LocalDB, Docker, or other MSI-packaged dependencies). It provides a minimal download abstraction, a registry-based installed-apps enumerator and an installer orchestrator that can invoke MSIs silently.
Main types
InstallationEnsurer/InstallationEnsurerInternal- Entry point:
InstallationEnsurer.GetInstance(ILogger? logger)returns anIInstallationEnsurer. EnsureIsInstalled(IFileDownloader fileDownloader, string urlOrPath, bool useDocker, params string[] keywords)attempts to detect a previously installed product by scanning the Windows uninstall registry for display names that contain all providedkeywords.- If the product is not found, the method will copy or download the provided installer (
urlOrPath) to a temporary.msifile and invokemsiexec.exewith quiet install arguments. - On .NET 6+ builds and on Windows the implementation may attempt Docker installer actions if
useDockeristrue(calls intoDapperLibrary.Dockerhelpers conditionally).
- Entry point:
IFileDownloader/FileDownloader/InstallationWebClientIFileDownloaderis a tiny abstraction:void DownloadFile(string urlOrPath, string fileName).FileDownloader.InstanceusesInstallationWebClient(a thin wrapper aroundSystem.Net.WebClient) to download the installer whenurlOrPathis a remote URI.
Key behaviors
Installed-apps detection is Windows-specific and reads:
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall(32-bit view) and, on 64-bit OS, the 64-bit view as well.- It collects
DisplayNamevalues and checks whether the providedkeywordsall appear in a display name.
Installer execution
- When no matching installed product is found the installer file (remote URL or local path) is copied to a temporary
.msilocation and executed viamsiexec.exewith a/i ... /qargument to perform a quiet install. - The temporary file is deleted after the installer process exits (best-effort; deletion failures are logged but do not fail the method).
- When no matching installed product is found the installer file (remote URL or local path) is copied to a temporary
Docker support
- When compiled for modern runtimes (
NET6_0_OR_GREATER) the internal ensurer checksRuntimeInformationand will attempt to invokeDockerInstaller.Instance.EnsureIsInstalled()whenuseDockeris requested on Windows. The Docker installation flow is platform-specific and may require elevation.
- When compiled for modern runtimes (
Usage example
var logger = /* obtain logger or null */;
var ensurer = InstallationEnsurer.GetInstance(logger);
var downloader = FileDownloader.Instance; // implements IFileDownloader
// Ensure a component is installed by providing a URL or local path to an MSI
bool installed = ensurer.EnsureIsInstalled(downloader, "https://example.com/mycomponent.msi", useDocker: false, "Component", "Vendor");
Important notes and safety
- The registry-based detection only works on Windows.
GetInstalledApps()relies on the Windows registry and will not function on non-Windows platforms. - Running installers programmatically requires caution: the library invokes
msiexec.exeand executes downloaded binaries. Only use trusted installer URLs/paths. - The code attempts best-effort cleanup of temporary files; antivirus or permission issues may prevent deletion.
- Docker installer flows (automatic download/installation) require administrator privileges and are platform-specific. On macOS the code will recommend manual installation.
Compatibility
- The project contains conditional compilation for multiple target frameworks. The registry/
msiexecflow is intended for Windows/.NET Framework and modern .NET builds running on Windows. - For cross-platform scenarios, prefer using platform-appropriate package management or container-based alternatives rather than invoking MSIs.
Extensibility
- Implement
IFileDownloaderto provide custom download behavior (proxy, authenticated downloads, local caching). - Swap the
IFile/InputOutput.Instanceimplementation used by the internal ensurer if you need custom I/O behavior in tests.
License / Contributing
See repository root for license and contribution guidelines.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Framework | net40 is compatible. net403 was computed. net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
.NETFramework 4.0
- Net4x.Extensions.Logging.Library (>= 2.5.0.2)
- Net4x.StandardTypesWrappers (>= 1.2.0.1)
-
.NETFramework 4.5
- Net4x.Extensions.Logging.Library (>= 2.5.0.2)
- Net4x.StandardTypesWrappers (>= 1.2.0.1)
-
.NETFramework 4.6.1
- Net4x.DapperLibrary.Docker (>= 1.9.9)
- Net4x.StandardTypesWrappers (>= 1.2.0.1)
- System.Configuration.ConfigurationManager (>= 9.0.0)
- System.Data.Common (>= 4.3.0)
-
net10.0
- Net4x.DapperLibrary.Docker (>= 1.9.9)
- Net4x.StandardTypesWrappers (>= 1.2.0.1)
-
net6.0
- Net4x.DapperLibrary.Docker (>= 1.9.9)
- Net4x.StandardTypesWrappers (>= 1.2.0.1)
-
net8.0
- Net4x.DapperLibrary.Docker (>= 1.9.9)
- Net4x.StandardTypesWrappers (>= 1.2.0.1)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Net4x.DapperLibrary.Installation:
| Package | Downloads |
|---|---|
|
Net4x.DapperLibrary.MockSqlServer
Package Description |
|
|
Net4x.Xsd2Db.Base
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.9.9 | 23 | 12/22/2025 |
| 1.6.0.12 | 151 | 12/12/2025 |
| 1.6.0.11 | 136 | 12/12/2025 |
| 1.6.0.10 | 448 | 12/9/2025 |
| 1.6.0.9 | 221 | 12/4/2025 |
| 1.6.0.8 | 209 | 12/4/2025 |
| 1.6.0.7 | 273 | 11/30/2025 |
| 1.6.0.6 | 204 | 11/27/2025 |
| 1.6.0.5 | 252 | 11/22/2025 |
| 1.6.0.4 | 160 | 11/16/2025 |
| 1.6.0.3 | 202 | 11/15/2025 |
| 1.6.0.2 | 296 | 11/14/2025 |
| 1.6.0.1 | 260 | 11/10/2025 |
| 1.6.0 | 235 | 11/9/2025 |
| 1.5.0.3 | 231 | 11/5/2025 |
| 1.5.0.2 | 250 | 11/3/2025 |
| 1.5.0.1 | 225 | 11/3/2025 |
| 1.5.0 | 181 | 10/26/2025 |
| 1.4.1.6 | 216 | 10/24/2025 |
| 1.4.1.5 | 214 | 10/22/2025 |
| 1.4.1.4 | 252 | 10/22/2025 |
| 1.4.1.2 | 235 | 5/30/2025 |
| 1.4.1.1 | 240 | 4/30/2025 |
| 1.4.1 | 239 | 4/30/2025 |
| 1.4.0 | 286 | 3/31/2025 |
| 1.1.0 | 1,378 | 8/26/2023 |
| 1.1.0-at20230506034359 | 988 | 5/7/2023 |