Create a portable version of a python installation on windows

I tested this on the following environvent:

Windows 7 32 SP1 and Windows XP 32 SP2
Python for Windows (cPython) :Windows x86 MSI Installer (2.7.6)

Copy the file c:\windows\System32\python27.dll to the folder of the python installation (e.g. c:\Python27)

Python needs the Microsoft.VC90.CRT manifest and three dll files to run.

Go to the python installation folder.
Create the folder Microsoft.VC90.CRT
Create a new textfile in this folder and open it.
Copy & paste the following text to the file and save it as Microsoft.VC90.CRT.manifest

<?xml version=“1.0″ encoding=“UTF-8″ standalone=“yes“?>
<assembly xmlns=“urn:schemas-microsoft-com:asm.v1″ manifestVersion=“1.0″>
<noInheritable></noInheritable>
<assemblyIdentity type=“win32″ name=“Microsoft.VC90.CRT“ version=“9.0.21022.8″ processorArchitecture=“x86″ publicKeyToken=“1fc8b3b9a1e18e3b“></assemblyIdentity>
<file name=“msvcr90.dll“ hashalg=“SHA1″ hash=“e0dcdcbfcb452747da530fae6b000d47c8674671″><asmv2:hash xmlns:asmv2=“urn:schemas-microsoft-com:asm.v2″ xmlns:dsig=“http://www.w3.org/2000/09/xmldsig#“><dsig:Transforms><dsig:Transform Algorithm=“urn:schemas-microsoft-com:HashTransforms.Identity“></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm=“http://www.w3.org/2000/09/xmldsig#sha1″></dsig:DigestMethod><dsig:DigestValue>KSaO8M0iCtPF6YEr79P1dZsnomY=</dsig:DigestValue></asmv2:hash></file> <file name=“msvcp90.dll“ hashalg=“SHA1″ hash=“81efe890e4ef2615c0bb4dda7b94bea177c86ebd“><asmv2:hash xmlns:asmv2=“urn:schemas-microsoft-com:asm.v2″ xmlns:dsig=“http://www.w3.org/2000/09/xmldsig#“><dsig:Transforms><dsig:Transform Algorithm=“urn:schemas-microsoft-com:HashTransforms.Identity“></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm=“http://www.w3.org/2000/09/xmldsig#sha1″></dsig:DigestMethod><dsig:DigestValue>ojDmTgpYMFRKJYkPcM6ckpYkWUU=</dsig:DigestValue></asmv2:hash></file> <file name=“msvcm90.dll“ hashalg=“SHA1″ hash=“5470081b336abd7b82c6387567a661a729483b04″><asmv2:hash xmlns:asmv2=“urn:schemas-microsoft-com:asm.v2″ xmlns:dsig=“http://www.w3.org/2000/09/xmldsig#“><dsig:Transforms><dsig:Transform Algorithm=“urn:schemas-microsoft-com:HashTransforms.Identity“></dsig:Transform></dsig:Transforms><dsig:DigestMethod Algorithm=“http://www.w3.org/2000/09/xmldsig#sha1″></dsig:DigestMethod><dsig:DigestValue>tVogb8kezDre2mXShlIqpp8ErIg=</dsig:DigestValue></asmv2:hash></file>
</assembly>

 

msvcm90.dll
msvcp90.dll
msvcr90.dll
and copy the files to your Microsoft.VC90.CRT folder.

Copy the whole Microsoft.VC90.CRT to your DLL folder in the python installation.

Thats all.
Now you can put your installation on a usb-key or deliver it to a costumer without installation.