pushing python to multiple windows machines

Roger Upole rupole at hotmail.com
Fri Oct 21 09:49:43 EDT 2005


<shkelley at gmail.com> wrote:
>I am working on a project that requires python to be installed on a
> large number of windows servers and was wondering if anyone has found a
> method to do this.  I found the article from 2003, but nobody ever
> stated that they have found an option for this.
>
> http://groups.google.com/group/comp.lang.python/browse_frm/thread/f42f0813bc271995?tvc=1&q=%22Pushing+Python+to+Windows+workstations%22
>
> -shawn
>

You can use WMI to install an Msi installer on a remote machine.
The Win32_Product class has an Install method:

import win32com.client
wmi=win32com.client.gencache.EnsureDispatch('wbemscripting.swbemlocator',0)
s=wmi.ConnectServer('servername')

p=s.Get('win32_product')
inparams=p.Methods_('Install').InParameters
inparams.Properties_('PackageLocation').Value=r'\\someserver\someshare\python-2.4.2.msi'
inparams.Properties_('AllUsers').Value=True

outparams=p.ExecMethod_('Install',inparams)
print outparams.Properties_('ReturnValue')  ## zero on success



     Roger



----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----



More information about the Python-list mailing list