choco icon indicating copy to clipboard operation
choco copied to clipboard

Nuspec - Remove packages prior to installing (Replaces) / Do not install if need is already met (Virtual)

Open tonypags opened this issue 6 years ago • 3 comments

Hi Choco-Experts,

I'm wondering if there's a way to leverage the dependencies feature in the nuspec file to ensure that a program or type of program IS NOT INSTALLED prior to installing my program.

USE CASE 1: I want to install an Anti-Virus program only if no other anti-virus programs are found installed on the computer. I also want to ignore the built-in windows malware tools (Defender, MSE). If I find something like Symantec or Carbon Black installed before I install Cylance, I want it to be removed prior to installation. Uptime states might come into play (if pending reboot or uptime too long, make no changes).

USE CASE 2: Remove old MSPs RMM agent before installing the new one. Here there may be a conflict or there may not be, so there could be an option switch that tells the dependencies removal is required prior to installation, versus the case where the new app should be installed and confirmed working, prior to the old app being uninstalled.

I'm also assuming one will need to build the installer and uninstaller packages for each program you want to remove (or grab them from the community, and internalize them).

This would be a good MSP feature if it had the ability to auto-sync device packages, check for "anti-dependencies" and execute choco uninstallers for them. I could call WMI on the machine to make sure no AV exists and fail out if it is. But before that my known uninstallers specified in the nuspec would run if those apps are found. At MSPs we do take-overs all the time.

tonypags avatar Jun 17 '19 16:06 tonypags

Hi @Hoping-i-Get-poached, If you've logged a request here, we assume you are a customer or have a commercial edition of Chocolatey (even a trial).

So there is a concept of conflicts, replaces, and virtuals that are in other package management frameworks on Linux. These concepts cover nicely what you are looking for - we have plans at some point to put them into Chocolatey. However I'll be clear that this is likely to be package-based (as in "I have the Symantec Chocolatey package installed, but now I want to install a different AV solution" and not "I have the Symantec software installed in Programs and Features, and I want to uninstall that prior to installing this AV Chocolatey package".

It's a good feature request, and it brings up some of the areas we've been thinking about for awhile and how best to approach it with the concepts of package management applied to Windows.

As this is more applicable to choco, I'm going to transfer this over to that repository instead.

ferventcoder avatar Jul 10 '19 16:07 ferventcoder

This is related to #858.

ferventcoder avatar Jul 10 '19 16:07 ferventcoder

Hi @ferventcoder, Yes, sort of, we are “this close” to starting our trial. We are putting together a business proposal for mgmt. for the cost and want to maximize the usage of the trial period. So we’re just getting our ducks in a row, trying to find out as much as possible so we’re not totally green when we start the trial. Once we play around with the pro tools you have we can finalize our proposal and it would then be some time between the end of the trial and the start of the MSP license. Fingers crossed…

Thanks for letting me know you're already thinking about it :-) Good to know

I just had this idea and decided to share it with you all. Not expecting a quick response, but thanks for replying!

tonypags avatar Jul 17 '19 20:07 tonypags