ryw.db_print3('dst is: ' + dst, 50)

    su.createdirpath(dst)

    #
    # on XP: RepositoryRoot = 'e:\\Postmanet\\repository'
    # on Linux: RepositoryRoot = '/home/rywang/Postmanet/repository'
    #
    repositoryRootString = ryw_bizarro.script_repository_root_string(dst)
    ryw.db_print3('repo root is: ' + repositoryRootString, 50)
    
    #RYW
    #su.copytree(common, os.path.join(dst, 'Common'), isInstall = True)
    su.copyscripttree(common,
                      os.path.join(dst, 'Common'),
                      [],
                      repositoryRootString,
                      isInstall = True,
                      repositoryRoot = dst)

    ryw.db_print3('completed copying Common files.', 50)

    # RYW
    su.copytree(os.path.join(topdir, 'icons'),
                os.path.join(dst, 'WWW', 'icons'), isInstall = True)
    ryw.db_print3('completed copying icons.', 50)

    #su.copytree(os.path.join(src, 'pythonscriptsforclient'),
    #            os.path.join(dst, 'pythonscriptsforclient'), isInstall = True)
    
    # RYW put Nihao code on server so it can be shipped to clients too.
    #su.copytree(os.path.join(topdir, 'Nihao', 'cgi-bin', 'Nihao'),
    ##    pythonpath = _winreg.EnumValue(a, 0)[1]
    ##    print 'pythonpath =', pythonpath
    ##except:
    ##    print 'ERROR>>> Python installation not found. Quitting.'
    ##    sys.exit(1)
    ### ----

    # ---- get apache path ----

    apachepath = get_apache_path()
    if apachepath:
        create_httpd_conf(apachepath, dst)

    create_registry_entry(dst)

    ## TODO: remove pythonpath later
    pythonpath = sys.executable

    su.createdirpath(dst)

    su.copytree(common, os.path.join(dst, 'Common'))

    su.copyscripttree(os.path.join(src, 'cgi-bin', 'Nihao'),
                      os.path.join(dst, 'cgi-bin', 'Nihao'),
                      [os.path.join(dst, 'Common')],
                      "NihaoRoot = '%s'" % dst.replace('\\', '\\\\'))

    su.copytree(os.path.join(src, 'WWW', 'Nihao'),
                os.path.join(dst, 'WWW', 'Nihao'))

    create_registry_entry(dst)

    # TODO: pythonpath unnecessary, but some other script may still want to read it from Resources.txt
    pythonpath = sys.executable

    su.createdirpath(dst)

    su.copytree(common, os.path.join(dst, 'Common'))
    su.copytree(os.path.join(src, 'pythonscriptsforclient'), os.path.join(dst, 'pythonscriptsforclient'))
    su.copytree(os.path.join(src, 'WWW'), os.path.join(dst, 'WWW'))

    # special treatment for scripts in
    pylist = ['bin', 'cgi-bin']

    for d in pylist:
        su.copyscripttree(os.path.join(src, d), os.path.join(dst, d), [os.path.join(dst, 'Common')], "RepositoryRoot = '%s'" % dst.replace('\\', '\\\\'))

##    for d in pylist:
##        if not os.path.exists(os.path.join(dst, d)):
##            os.mkdir(dst + d)
##
##        for py in os.listdir(src + d):
##            su.copyScript(os.path.join(src + d, py), os.path.join(dst + d, py), [dst + 'Common'], "RepositoryRoot = '" + dst.replace('\\', '\\\\') + "'")

    if not os.path.exists(os.path.join(dst, 'QUEUES')):
        os.mkdir(os.path.join(dst, 'QUEUES'))

    if not os.path.exists(os.path.join(dst, 'Passwords')):
        shutil.copyfile(os.path.join(src, 'Passwords'), os.path.join(dst, 'Passwords'))

    if not os.path.exists(os.path.join(dst, 'Endpoints.pk')):