[2015.5.3-2] windows pkg.remove msiexec fails
Hello,
Running 2015.5.3-2 on server and minions.
Tried to uninstall a package with the following command,
salt 'AC1*.ktm.*' pkg.remove 'Node.js' version=0.12.6
Salt init.sls configuration
msiexec: True
uninstaller: 'msiexec.exe'
uninstall_flags: '/qn /x {0961D375-33E3-45D7-A0EA-F58693D9FBE5}'
Execution fails
[INFO ] Executing command ['msiexec', '/x', 'msiexec.exe', '/qn', '/x', '{4B289DDD-4822-4706-902D-EE51DD657040}'] in directory 'C:\\Users\\andrewc'
Reworked the init.sls configuration
msiexec: True
uninstaller: '{0961D375-33E3-45D7-A0EA-F58693D9FBE5}'
uninstall_flags: '/qn'
Does this seem correct?
@getabc, does your second init.sls state succeed?
@twangboy
@jfindlay @twangboy yes the second state succeeded.
[INFO ] Executing command ['msiexec', '/x', '{0961D375-33E3-45D7-A0EA-F58693D9FBE5}', '/qn'] in directory 'C:\\Users\\andrewc'
@jfindlay @getabc Maybe some clearer documentation?
Question is, will the sls files in the salt-winrepo uninstall successfully.
Most of them are making use of uninstaller: 'msiexec.exe'
@getabc They will fail just like yours did. Putting the GUID for the uninstaller parameter will be the solution there. That's the only way to have both the installer and the uninstaller work properly. @TheBigBear might want to take note of this.
@twangboy ok noted, I had simply copied other sls files as my templates and not noticed the problem in in-installing, sorry. Will go over them sometime next week probably , unless somebody beats me to it. I guess it's high time to go and read the docs and see what they say. ;-)
@TheBigBear I'm not sure that information is in the docs. It's just what I noticed as I was troubleshooting this issue. It should be better documented.
@jacobhammons ^^^^
OK, thanks @getabc, I will work on correcting them.
This issue affects at least the following 33 winrepo sls files:
https://github.com/saltstack/salt-winrepo/blob/master/adobeair.sls https://github.com/saltstack/salt-winrepo/blob/master/adobeflashplayeractivex.sls https://github.com/saltstack/salt-winrepo/blob/master/adobeflashplayerplugin.sls https://github.com/saltstack/salt-winrepo/blob/master/adobereader-dc.sls https://github.com/saltstack/salt-winrepo/blob/master/adobereader.sls https://github.com/saltstack/salt-winrepo/blob/master/autopsy.sls https://github.com/saltstack/salt-winrepo/blob/master/curl.sls https://github.com/saltstack/salt-winrepo/blob/master/curl_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/inkscape.sls https://github.com/saltstack/salt-winrepo/blob/master/libreoffice.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2008-redist.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2008-redist_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2008-sp1-atl-redist.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2008-sp1-atl-redist_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2008-sp1-mfc-redist.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2008-sp1-mfc-redist_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2010-sp1-mfc-redist.sls https://github.com/saltstack/salt-winrepo/blob/master/ms-vcpp-2010-sp1-mfc-redist_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/mysql-essential.sls https://github.com/saltstack/salt-winrepo/blob/master/mysql-installer-community.sls https://github.com/saltstack/salt-winrepo/blob/master/openoffice.sls https://github.com/saltstack/salt-winrepo/blob/master/pdf24creator.sls https://github.com/saltstack/salt-winrepo/blob/master/realvnc.sls https://github.com/saltstack/salt-winrepo/blob/master/skype-msi.sls https://github.com/saltstack/salt-winrepo/blob/master/svn.sls https://github.com/saltstack/salt-winrepo/blob/master/tightvnc.sls https://github.com/saltstack/salt-winrepo/blob/master/tightvnc_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/tortoise-git.sls https://github.com/saltstack/salt-winrepo/blob/master/tortoise-git_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/tortoise-hg.sls https://github.com/saltstack/salt-winrepo/blob/master/tortoise-hg_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/tortoise-svn.sls https://github.com/saltstack/salt-winrepo/blob/master/tortoise-svn_x86.sls
These 32 occurrences are now fixed in commit https://github.com/saltstack/salt-winrepo/commit/b67d20e01630116be7571080c9711e0438a92bf9 this fixes #25778
@twangboy, ok these 32 are now all fixed.
But there are another 10 or so that use "strange" ways of calling the uninstaller, by giving the installer URL again pointing to a msi URL as the uninstaller string, I heavily suspect those won't un-install cleanly either. I will test, then find the correct GUID for them to create working un-installs for them as well. (some samples are: chromedl by @cro or nsclient by @crazybus - and many more)
@twangboy @TheBigBear would there be any benefit to add the mseiexec ALLUSERS=1 flag? I know you are looking to include it at code level (#25839)
Sorry, there were another 19 of those wrong msiexec.exe uninstallers, that I missed first time around.
https://github.com/saltstack/salt-winrepo/blob/master/7zip.sls https://github.com/saltstack/salt-winrepo/blob/master/7zip_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/adobereader-xi.sls https://github.com/saltstack/salt-winrepo/blob/master/adobeshockwaveplayer.sls https://github.com/saltstack/salt-winrepo/blob/master/chrome.sls https://github.com/saltstack/salt-winrepo/blob/master/conemu-alpha.sls https://github.com/saltstack/salt-winrepo/blob/master/conemu-alpha_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/conemu-preview.sls https://github.com/saltstack/salt-winrepo/blob/master/conemu-preview_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/emet.sls https://github.com/saltstack/salt-winrepo/blob/master/icloud.sls https://github.com/saltstack/salt-winrepo/blob/master/itunes.sls https://github.com/saltstack/salt-winrepo/blob/master/itunes_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/jre.sls https://github.com/saltstack/salt-winrepo/blob/master/jre_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/jre8.sls https://github.com/saltstack/salt-winrepo/blob/master/jre8_x86.sls https://github.com/saltstack/salt-winrepo/blob/master/keepass-2x.sls https://github.com/saltstack/salt-winrepo/blob/master/keepass.sls https://github.com/saltstack/salt-winrepo/blob/master/quicktime.sls
All fixed in commit https://github.com/saltstack/salt-winrepo/commit/c8388874c5d2f848440db6c8a18d66f36ceed358
@getabc Adding all users has been added with the following PR: #25848. Basically, if you set msiexec: True in the software definition in win-repo, it will add the all users flag. If for some reason the ALLUSERS="1" causes problems, it can be overridden by adding allusers: False to the software definition.
@getabc and @twangboy @jfindlay @cro I did some more testing on the parameters that can be passed as the 'uninstaller' and both passing the windows GUID (aka msi product code) or the actual URL to the msi work.
So I will add that finding to the documentation page as well.
(I got supsicious when I found that @cro had written a sample for 7zip in the docs that used the passing of the msi as a 'salt://' 'URL'.)
@TheBigBear That's easier than installing just to grab the product code. I'm going to close this issue.
@TheBigBear @twangboy @jfindlay thanks gents
@twangboy I agree. I use either Orca or a power shell script to get the msi product codes, most of the time.