'Adds code to the installer to compute the location of Python.
Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
registry for each version of Python.
Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
else from PYTHON.MACHINE.X.Y.
Properties PYTHONX.Y will be set to TARGETDIRX.Y\python.exe'

def add_find_python(self):

    start = 402
    for ver in self.versions:
        install_path = ('SOFTWARE\\Python\\PythonCore\\%s\\InstallPath' % ver)
        machine_reg = ('python.machine.' + ver)
        user_reg = ('python.user.' + ver)
        machine_prop = ('PYTHON.MACHINE.' + ver)
        user_prop = ('PYTHON.USER.' + ver)
        machine_action = ('PythonFromMachine' + ver)
        user_action = ('PythonFromUser' + ver)
        exe_action = ('PythonExe' + ver)
        target_dir_prop = ('TARGETDIR' + ver)
        exe_prop = ('PYTHON' + ver)
        if msilib.Win64:
            Type = 18
        else:
            Type = 2
        add_data(self.db, 'RegLocator', [(machine_reg, 2, install_path, None, Type), (user_reg, 1, install_path, None, Type)])
        add_data(self.db, 'AppSearch', [(machine_prop, machine_reg), (user_prop, user_reg)])
        add_data(self.db, 'CustomAction', [(machine_action, 307, target_dir_prop, (('[' + machine_prop) + ']')), (user_action, 307, target_dir_prop, (('[' + user_prop) + ']')), (exe_action, 307, exe_prop, (('[' + target_dir_prop) + ']\\python.exe'))])
        add_data(self.db, 'InstallExecuteSequence', [(machine_action, machine_prop, start), (user_action, user_prop, (start + 1)), (exe_action, None, (start + 2))])
        add_data(self.db, 'InstallUISequence', [(machine_action, machine_prop, start), (user_action, user_prop, (start + 1)), (exe_action, None, (start + 2))])
        add_data(self.db, 'Condition', [(('Python' + ver), 0, ('NOT    TARGETDIR' + ver))])
        start += 4
    return
