1
# (c) Canonical Ltd, 2006
2
# written by Alexander Belchenko for bzr project
4
# This script will be executed after installation of bzrlib package
5
# and before installer exits.
6
# All printed data will appear on the last screen of installation
8
# The main goal of this script is to create special batch file
9
# launcher for bzr. Typical content of this batch file is:
12
# This file works only on Windows 2000/XP. For win98 there is
13
# should be "%1 %2 %3 %4 %5 %6 %7 %8 %9" instead of "%*".
14
# Or even more complex thing.
16
# [bialix]: bzr de-facto does not support win98.
17
# Although it seems to work on. Sometimes.
22
if len(sys.argv) == 2 and sys.argv[1] == "-install":
23
# try to detect version number automatically
29
ver = bzrlib.__version__
32
# XXX change message for something more appropriate
35
Congratulation! Bzr successfully installed.
39
batch_path = "bzr.bat"
44
scripts_dir = os.path.join(prefix, "Scripts")
45
script_path = os.path.join(scripts_dir, "bzr")
46
python_path = os.path.join(prefix, "python.exe")
47
batch_str = "@%s %s %%*\n" % (python_path, script_path)
48
batch_path = script_path + ".bat"
49
f = file(batch_path, "w")
52
file_created(batch_path) # registering manually created files for
53
# auto-deinstallation procedure
55
# inform user where batch launcher is.
56
print "Created:", batch_path
57
print "Use this batch file to run bzr"
59
print "ERROR: Unable to create %s: %s" % (batch_path, e)