Ask Your Question
0

Uninstalling programs in windows that are less than X version

asked 2016-09-22 03:46:46 -0500

itaremyinitials gravatar image

updated 2016-10-07 13:07:37 -0500

Hi puppeters,

I am working on some puppet manifests to manage windows machines, and so , for a while I was installing 7zip -for example- using this method:

package { '7-Zip 9.20 (x64 edition)': - ensure => installed, - source => 'http://downloads.sourceforge.net/sevenzip/7z920-x64.msi', - provider => 'windows' - }

Now I have changed that, so chocolatey will be managing this install . -The thing here- is; I want to change my puppet manifest to remove the 7zip old version (no matter what old version is that, because I am managing a big number of machines), I thought to try matching with a regex any package that has a version less than ‘7zip 16.02.0.20160811' but that turned up too complicated , is there any way i can achieve the same goal with less effort , (Also I know that i can do the same with a batch file), but i want a more cleaner solution to that.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2016-10-06 12:48:33 -0500

joshc gravatar image

You should be able to specify the MSI PackageCode as the title of the resource:

package { '<package code>':
  ensure => absent,
  source => '...',
  provider => windows
}

See https://docs.puppet.com/puppet/4.7/re...packagewindows.html#known-issues-prior-to-puppet-34--pe-32 for info about how to get the package code for a given MSI.

edit flag offensive delete link more

Comments

This is definitely one way to do it!

rob gravatar imagerob ( 2016-10-07 13:05:14 -0500 )edit
0

answered 2016-10-07 13:07:13 -0500

One option is the one that joshc mentioned. Another is that Chocolatey is moving towards supporting the ability to uninstall software it doesn't manage as packages (licensed versions). This is something you will be able to take advantage of in Puppet manifests with a simple switch in the uninstall_options.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-09-22 03:46:46 -0500

Seen: 50 times

Last updated: Oct 07 '16