Python

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

This is a silent installer for Python.

Python 2.4 and higher are available as MSI packages, which are documented at http://www.python.org/download/releases/2.5/msi/

<?xml version="1.0" encoding="UTF-8"?> 
<packages:packages
        xmlns:packages="http://www.wpkg.org/packages" xmlns:wpkg="http://www.wpkg.org/wpkg" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.wpkg.org/packages ../xsd/packages.xsd" >
    <package id="python"
            name="Python"
            revision="%PKG_VERSION%-201204101449"
            reboot="false"
            priority="10">        
        <variable name="PKG_VERSION" value="2.7.2" />      
		<check type="logical" condition="or">
			<check type="uninstall" condition="exists" path="Python %PKG_VERSION%" />
			<check type="uninstall" condition="exists" path="Python %PKG_VERSION% (64-bit)" />
		</check>		
        
		<install cmd='msiexec /qn /i "%SOFTWARE%\python\python-%version%.msi" ALLUSERS=1' architecture="x86"/>
		<upgrade cmd='msiexec /qn /i "%SOFTWARE%\python\python-%version%.msi" ALLUSERS=1' architecture="x86"/>
		<remove cmd='msiexec /qn /x"%SOFTWARE%\python\python-%version%.msi"' architecture="x86"/>
  
		<install cmd='msiexec /qn /i "%SOFTWARE%\python\python-%PKG_VERSION%.amd64.msi" ALLUSERS=1' architecture="x64"/>
		<upgrade cmd='msiexec /qn /i "%SOFTWARE%\python\python-%PKG_VERSION%.amd64.msi" ALLUSERS=1' architecture="x64"/>
		<remove cmd='msiexec /qn /x"%SOFTWARE%\python\python-%PKG_VERSION%.amd64.msi"' architecture="x64"/>
    </package>
</packages:packages>

For modules use easy_install, works with the most modules, download the script [1]ez_setup.py and the file distutils.cfg for config easy_install. use apache, easy_install get the files of modules (.exe, .egg):

distutils.cfg

[easy_install]

find_links= http://server.apache/pyeasy/
allow_hosts = *.apache

The easy_install get the modules (.exe,.egg) of apache server. The package for easy_install is:

<!--Easy Install python -->
<package
     id="pyeasyinstall"
     name="Easy Install Python"
     revision="3"
     reboot="false"
     priority="398">
    <depends package-id="python"/>
    <check type="file" condition="exists" path="C:\Python25\Scripts\easy_install.exe" />   
    <install cmd='"C:\Python25\python" %SOFTWARE%\python\ez_setup.py' />
    <install cmd='cmd /c xcopy /v /s /i /e /h /c /y /q "%SOFTWARE%\python\distutils.cfg" "C:\Python25\Lib\distutils\"' />
    <upgrade cmd='"C:\Python25\python" %SOFTWARE%\python\ez_setup.py' />
    <upgrade cmd='cmd /c xcopy /v /s /i /e /h /c /y /q "%SOFTWARE%\python\distutils.cfg" "C:\Python25\Lib\distutils\"' />
    <remove cmd='cmd /c if exist "C:\Python25\python\Scripts\easy_install.exe" del "C:\Python25\python\Scripts\easy_install.exe"' >
	<exit code="1" />
	<exit code="0" />
  </remove>
</package>

A template for the modules is:

<package
     id="pynamemodule"
     name="namemodule 2.0.1"
     revision="0"
     reboot="false"
     priority="397">
    <depends package-id="python"/>
    <depends package-id="pyeasyinstall"/>
    <check type="file" condition="exists" path="C:\Python25\Lib\site-packages\namemodule-2.0.1-py2.5-win32.egg" />
    <install cmd='"C:\Python25\Scripts\easy_install.exe" --quiet namemodule' />   
    <upgrade cmd='"C:\Python25\Scripts\easy_install.exe" --quiet --upgrade pynamemodule' />
    <remove cmd='cmd /c if exist "C:\Python25\Lib\site-packages\namemodule-2.0.1-py2.5-win32.egg" del "C:\Python25\Lib\site-packages\namemodule-2.0.1-py2.5-win32.egg"' >
	<exit code="1" />
	<exit code="0" />
    </remove>
</package>