summaryrefslogtreecommitdiffstats
path: root/Tools/msi
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2008-05-25 16:37:34 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2008-05-25 16:37:34 (GMT)
commit367c79a4adb7bf5dec9cd501a0d772b6d95591ed (patch)
tree737001318ff84807e46023e35943f686ad8ae3c5 /Tools/msi
parentf2e23d039c322cf160e082a0eff0b3cfcd91a537 (diff)
downloadcpython-367c79a4adb7bf5dec9cd501a0d772b6d95591ed.zip
cpython-367c79a4adb7bf5dec9cd501a0d772b6d95591ed.tar.gz
cpython-367c79a4adb7bf5dec9cd501a0d772b6d95591ed.tar.bz2
Create grammar pickle files on installation; remove them on uninstallation.
Diffstat (limited to 'Tools/msi')
-rw-r--r--Tools/msi/msi.py6
-rw-r--r--Tools/msi/msilib.py5
2 files changed, 11 insertions, 0 deletions
diff --git a/Tools/msi/msi.py b/Tools/msi/msi.py
index 032d662..d152f75 100644
--- a/Tools/msi/msi.py
+++ b/Tools/msi/msi.py
@@ -382,6 +382,7 @@ def add_ui(db):
])
compileargs = r'-Wi "[TARGETDIR]Lib\compileall.py" -f -x bad_coding|badsyntax|site-packages|py3_ "[TARGETDIR]Lib"'
+ lib2to3args = r'-c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"'
# See "CustomAction Table"
add_data(db, "CustomAction", [
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
@@ -395,6 +396,7 @@ def add_ui(db):
# See "Custom Action Type 18"
("CompilePyc", 18, "python.exe", compileargs),
("CompilePyo", 18, "python.exe", "-O "+compileargs),
+ ("CompileGrammar", 18, "python.exe", lib2to3args),
])
# UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
@@ -424,12 +426,14 @@ def add_ui(db):
("UpdateEditIDLE", None, 1050),
("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801),
+ ("CompileGrammar", "COMPILEALL", 6802),
])
add_data(db, "AdminExecuteSequence",
[("InitialTargetDir", 'TARGETDIR=""', 750),
("SetDLLDirToTarget", 'DLLDIR=""', 751),
("CompilePyc", "COMPILEALL", 6800),
("CompilePyo", "COMPILEALL", 6801),
+ ("CompileGrammar", "COMPILEALL", 6802),
])
#####################################################################
@@ -999,6 +1003,8 @@ def add_files(db):
if dir=="setuptools":
lib.add_file("cli.exe")
lib.add_file("gui.exe")
+ if dir=="lib2to3":
+ lib.removefile("pickle", "*.pickle")
if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
# This should contain all non-.svn files listed in subversion
for f in os.listdir(lib.absolute):
diff --git a/Tools/msi/msilib.py b/Tools/msi/msilib.py
index d65c997..98571ac 100644
--- a/Tools/msi/msilib.py
+++ b/Tools/msi/msilib.py
@@ -571,6 +571,11 @@ class Directory:
[(self.component+"c", self.component, "*.pyc", self.logical, 2),
(self.component+"o", self.component, "*.pyo", self.logical, 2)])
+ def removefile(self, key, pattern):
+ "Add a RemoveFile entry"
+ add_data(self.db, "RemoveFile", [(self.component+key, self.component, pattern, self.logical, 2)])
+
+
class Feature:
def __init__(self, db, id, title, desc, display, level = 1,
parent=None, directory = None, attributes=0):