Example #1
0
def create_registry_entry(dst):
    """moved from install-repository-lai.py
    create repository path in windows registry."""
    dsh_utils.db_print3('ryw_xp:create_registry_entry() entered...', 50)
    try:
        a = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE')
        a = _winreg.CreateKey(a, 'Postmanet')
        a = _winreg.SetValue(a, 'Repository', _winreg.REG_SZ, dst)
    except:
        print 'ERROR>>> Could not set Postmanet\\Repository value in the windows registry.'
Example #2
0
def get_apache_path():
    """called by install-repository-lai.py"""

    dsh_utils.db_print3('ryw_xp:get_apache_path() entered...', 50)
    
    try:
        a = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE')
        a = _winreg.OpenKey(a, 'Apache Group')
        a = _winreg.OpenKey(a, 'Apache')

        # get latest version
        versions = []
        i = 0
        while True:
            try:
                v = _winreg.EnumKey(a, i)
            except:
                break
            versions.append(v)
            i += 1
        # print 'versions =', versions
        if not versions:
            ##raise 'No apache versions found.'
            return ''

        latestversion = max(versions)
        # print 'latest version =', latestversion

        a = _winreg.OpenKey(a, latestversion)
        i = 0
        val = _winreg.EnumValue(a, i)
        while val[0] != 'ServerRoot':
            i += 1
            val = _winreg.EnumValue(a, i)
        # print 'val =', val
        apachepath = val[1]
        print 'apachepath =', apachepath
        return apachepath
    except:
        print 'ERROR>>> Apache installation not found.'
        return ''
Example #3
0
def copy_password_file(src, dst):
    """used to be in install-repository-lai.py."""
    shutil.copyfile(os.path.join(src, 'Passwords'),
                    os.path.join(dst, 'Passwords'))    
    dsh_utils.db_print3('ryw_xp:ryw_password_file() executed.', 50)