Skip to content

Commit

Permalink
(maint) Note on install if auto-uninstall possible
Browse files Browse the repository at this point in the history
When installing software at install/upgrade time, choco is going to
know if it is going to be able to automatically remove the software. It
should log that out so the user will know whether the package will need
a chocolateyUninstall.ps1 or not just for the uninstallatin parts.
  • Loading branch information
ferventcoder committed May 1, 2017
1 parent 3789e7a commit cf6d1e6
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -358,14 +358,18 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
var installersDifferences = _registryService.get_installer_key_differences(installersBefore, _registryService.get_installer_keys());
if (installersDifferences.RegistryKeys.Count != 0)
{
//todo v1 - determine the installer type and write it to the snapshot
//todo v1 - note keys passed in
pkgInfo.RegistrySnapshot = installersDifferences;

var key = installersDifferences.RegistryKeys.FirstOrDefault();
if (key != null && key.HasQuietUninstall)
{
pkgInfo.HasSilentUninstall = true;
this.Log().Info(" {0} can be automatically uninstalled.".format_with(packageResult.Name));
}
else if (key != null)
{
this.Log().Info(" {0} may be able to be automatically uninstalled.".format_with(packageResult.Name));
}
}

Expand Down

0 comments on commit cf6d1e6

Please sign in to comment.