# Create a file with data needed in registry so the distutils
# windows-installer will find this python installation.

# these entries are necessary for the distutils-Windows-installer
reg_data = """REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Python]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION\InstallPath]
@="$PYTHON"
"""

# other entries usually found in the registry
more_reg_data ="""
[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION\InstallPath\InstallGroup]
@="Python $VERSION"

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION\PythonPath]
@="$PYTHON\\Lib\\plat-win;$PYTHON\\Lib;$PYTHON\\DLLs;$PYTHON\\Lib\\lib-tk"

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION\Modules]
@=""

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION\Help]

[HKEY_LOCAL_MACHINE\Software\Python\PythonCore\$VERSION\Help\Main Python Documentation]
@="$PYTHON\\Doc\\index.html"
"""

import sys,string

print "Create registration data for your python."""

reg_data = string.replace(reg_data,"$VERSION",sys.version[0:3])
reg_data = string.replace(reg_data,"$PYTHON",string.replace(sys.prefix,"\\","\\\\"))

print "Save data to file 'python.reg'."

f = open("python.reg","w")
f.write(reg_data)
f.close()

print
print "To register your python (in the registry)"
print "  double-click on the created file 'python.reg'"
print "  or import it with regedit."
print
raw_input("Please press return to continue ...\n")

