add program install info, remove it, or check for it for Windows
This code is made as an example automatically referencing program-inst-manager.dll
.
// create installation info for example
var installInfo = new ProgramInstallInfo
{
DisplayIcon = "example.ico",
DisplayName = "Example Program",
DisplayVersion = "1.3.2.0",
InstallLocation = @"C:\Program Files (x86)\Example Program",
Publisher = "Example Publisher",
SystemComponent = false,
UninstallString = @"C:\Program Files(x86)\Example Program\uninstall.exe",
URLInfoAbout = "https://example.com",
CanModify = true,
CanRepair = true,
ModifyPath = @"C:\Program Files (x86)\Example Program\modify.exe"
};
bool hasInstall = Installation.CheckForInstallInfo(installInfo);
// add install info to Registry if not already added
if (!hasInstall) InstallationManager.AddInstallInfo(installInfo);
// remove install info from Registry if already added
if (hasInstall) InstallationManager.RemoveInstallInfo(installInfo);
ProgramInstallInfo
: Installation info for your programInstallationManager
CheckForInstallInfo
- Returns
true
orfalse
depending on whether or not the specified program installation info was added to the Registry
- Returns
AddInstallInfo
- Adds the provided program installation info to the Registry
RemoveInstallInfo
- Removes the specified program installation info from the Registry