57
59
print "Use this batch file to run bzr"
58
60
except Exception, e:
59
61
print "ERROR: Unable to create %s: %s" % (batch_path, e)
63
# make entry in APPDATA
64
appdata = get_special_folder_path("CSIDL_APPDATA")
65
dst = os.path.join(appdata, "bazaar", "2.0")
66
if not os.path.isdir(dst):
69
print "Configuration files stored in %s" % \
70
dst.encode(locale.getpreferredencoding(), 'replace')
71
# create dummy bazaar.conf
72
f = file(os.path.join(dst,'bazaar.conf'), 'w')
73
f.write("# main configuration file of Bazaar-NG\n"
75
"#email=Your Name <you@domain.com>\n")
78
## this hunk borrowed from pywin32_postinstall.py
79
# use bdist_wininst builtins to create a shortcut.
80
# CSIDL_COMMON_PROGRAMS only available works on NT/2000/XP, and
81
# will fail there if the user has no admin rights.
82
if get_root_hkey()==_winreg.HKEY_LOCAL_MACHINE:
84
fldr = get_special_folder_path("CSIDL_COMMON_PROGRAMS")
86
# No CSIDL_COMMON_PROGRAMS on this platform
87
fldr = get_special_folder_path("CSIDL_PROGRAMS")
89
# non-admin install - always goes in this user's start menu.
90
fldr = get_special_folder_path("CSIDL_PROGRAMS")
92
# make Bazaar-NG entry
93
fldr = os.path.join(fldr, 'Bazaar-NG')
94
if not os.path.isdir(fldr):
96
directory_created(fldr)
98
# link to documentation
99
docs = os.path.join(sys.exec_prefix, 'Doc', 'Bazaar-NG', 'index.htm')
100
dst = os.path.join(fldr, 'Documentation.lnk')
101
create_shortcut(docs, 'Bazaar-NG Documentation', dst)
103
print 'Documentation for Bazaar-NG: Start => Programs => Bazaar-NG'
106
cmd = os.environ.get('COMSPEC', 'cmd.exe')
107
dst = os.path.join(fldr, 'Start bzr.lnk')
109
'Start bzr in cmd shell',
112
os.path.join(sys.exec_prefix, 'Scripts'))