Windows Package Manager with MSI files

453 views
Skip to first unread message

Joe Healy

unread,
Jan 30, 2013, 12:55:55 AM1/30/13
to salt-...@googlegroups.com
Hi,

We've been playing with the windows package manager with some success,
but have a question regarding uninstallation of msi files.

Our particular example is 7-zip.

We are able to install msi installers nicely, but uninstalling
silently seems to give us trouble.

To install an msi file we have used the following init.sls file

7zip:
9.22:
installer: salt://win/repo/7zip/7z922-x64.msi
full_name: 7zip 9.22
reboot: False
install_flags: ' /q '
uninstaller: salt://win/repo/7zip/7z922-x64.msi
uninstall_flags: ' /qn /x'

following the directions in
https://salt.readthedocs.org/en/latest/ref/windows-package-manager.html?highlight=windows
we have been able to install but not uninstall.

we have tested the install and uninstall commands on the windows
minion directly. To install we require

7z922-x64.msi \q

however to uninstall we understand that the command needs to be

msiexec \qn \x program.msi

but are unsure how to send this through salt.

Cheers,

Joe

David Boucha

unread,
Jan 30, 2013, 1:16:44 AM1/30/13
to salt users list

I'm posting this from my phone, so this is completely untested, but try changing the following 2 lines:


uninstaller: salt://win/repo/7zip/7z922-x64.msi uninstall_flags: ' /qn /x'

To:
uninstaller: 'msiexec'
uninstall_flags: ' /qn /x 7z922-x64.msi'

You might need the full path to the cached installer

I might need to add in some logic to handle situations like this better.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Joe Healy

unread,
Jan 30, 2013, 1:22:01 AM1/30/13
to salt-...@googlegroups.com
Thanks for the quick response.

I tried the full paths to msiexec and the cached installer, but
msiexec still popped up a dialog.

It may be something in the way it is run though. I'll keep playing
with various options from the command line then trying to replicate
through the pkg manager.

Also should the pkg.installed state work - we get errors that the
windows version in unavailable.

Thanks,

Joe

Joe Healy

unread,
Jan 30, 2013, 2:10:41 AM1/30/13
to salt-...@googlegroups.com
The following ended up working:

uninstaller: msiexec
uninstall_flags: ' /qn /x
"C:\salt\var\cache\salt\minion\files\base\win\repo\7zip\7z922-x64.msi"
'

Thanks very much for your help.

Joe


On Wed, Jan 30, 2013 at 5:16 PM, David Boucha <da...@saltstack.com> wrote:

David Boucha

unread,
Jan 30, 2013, 12:14:14 PM1/30/13
to salt users list
I need to come up with a less clunky way to do that, but I'm glad it's working!  Thanks for the feedback. There's still work to do to solidify all the Windows stuff.
Dave Boucha  |  Sr. Engineer


5272 South College Drive, Suite 301 | Murray, UT 84123

office 801-305-3563
da...@saltstack.com | www.saltstack.com

David Boucha

unread,
Feb 14, 2013, 9:44:27 PM2/14/13
to salt users list
Joe,

I've come up with a better way to handle msi installers that require using msiexec. 

Joe Healy

unread,
Feb 14, 2013, 10:23:06 PM2/14/13
to salt-...@googlegroups.com
Great - I'm out of the office, so it will be monday before we can try this, but looks like it will be much simpler.

thanks very much.

Joe
Reply all
Reply to author
Forward
0 new messages