[Python-checkins] python/nondist/sandbox/msi msi.py, 1.26,
1.27 msilib.py, 1.10, 1.11
loewis at users.sourceforge.net
loewis at users.sourceforge.net
Fri Aug 13 17:25:31 CEST 2004
Update of /cvsroot/python/python/nondist/sandbox/msi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16471
Modified Files:
msi.py msilib.py
Log Message:
Add support for advertised shortcuts and extensions
Index: msi.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** msi.py 5 Aug 2004 20:29:05 -0000 1.26
--- msi.py 13 Aug 2004 15:25:28 -0000 1.27
***************
*** 281,284 ****
--- 281,286 ----
# Bitmaps
+ if not os.path.exists(srcdir+r"\PC\python_icon.exe"):
+ raise "Run icons.mak in PC directory"
add_data(db, "Binary",
[("PythonWin", msilib.Binary(srcdir+r"\PCbuild\installer.bmp")), # 152x328 pixels
***************
*** 287,290 ****
--- 289,295 ----
("py.ico",msilib.Binary(srcdir+r"\PC\py.ico")),
])
+ add_data(db, "Icon",
+ [("python_icon.exe", msilib.Binary(srcdir+r"\PC\python_icon.exe"))])
+
# Scripts
open("inst.vbs","w").write("""
***************
*** 681,685 ****
# column.
def add_features(db):
! global default_feature, tcltk, htmlfiles, tools, testsuite, ext_feature
default_feature = Feature(db, "DefaultFeature", "Python",
"Python Interpreter and Libraries",
--- 686,690 ----
# column.
def add_features(db):
! global default_feature, tcltk, idle, htmlfiles, tools, testsuite, ext_feature
default_feature = Feature(db, "DefaultFeature", "Python",
"Python Interpreter and Libraries",
***************
*** 688,693 ****
"Make this Python installation the default Python installation", 3,
parent = default_feature)
! tcltk = Feature(db, "TclTk", "Tcl/Tk", "Tkinter, IDLE, pydoc", 5,
parent = default_feature)
htmlfiles = Feature(db, "Documentation", "Documentation",
"Python HTMLHelp File", 7, parent = default_feature)
--- 693,700 ----
"Make this Python installation the default Python installation", 3,
parent = default_feature)
! tcltk = Feature(db, "TclTk", "Tcl/Tk", "Tkinter, pydoc", 5,
parent = default_feature)
+ idle = Feature(db, "IDLE", "IDLE", "IDLE (Python GUI)", 6,
+ parent = tcltk)
htmlfiles = Feature(db, "Documentation", "Documentation",
"Python HTMLHelp File", 7, parent = default_feature)
***************
*** 768,773 ****
if dir == "CVS" or dir.startswith("plat-"):
continue
! elif dir in ["lib-tk", "idlelib", "Icons"]:
tcltk.set_current()
elif dir in ['test', 'output']:
testsuite.set_current()
--- 775,782 ----
if dir == "CVS" or dir.startswith("plat-"):
continue
! elif dir in ["lib-tk"]:
tcltk.set_current()
+ elif dir in ["idlelib", "Icons"]:
+ idle.set_current()
elif dir in ['test', 'output']:
testsuite.set_current()
***************
*** 775,778 ****
--- 784,791 ----
default_feature.set_current()
lib = Directory(db, cab, parent, dir, dir, "%s|%s" % (parent.make_short(dir), dir))
+ # Register keyfiles for components which need them
+ if dir=="idlelib":
+ lib.start_component("idlelib", keyfile="idle.pyw")
+ # Add additional files
dirs[dir]=lib
lib.glob("*.txt")
***************
*** 874,878 ****
lib = Directory(db, cab, tooldir, f, f, "%s|%s" % (tooldir.make_short(f), f))
lib.glob("*.py")
! lib.glob("*.pyw")
lib.remove_pyc()
lib.glob("*.txt")
--- 887,891 ----
lib = Directory(db, cab, tooldir, f, f, "%s|%s" % (tooldir.make_short(f), f))
lib.glob("*.py")
! lib.glob("*.pyw", exclude=['pydocgui.pyw'])
lib.remove_pyc()
lib.glob("*.txt")
***************
*** 882,888 ****
--- 895,904 ----
if f == 'Scripts':
lib.add_file("README.txt", src="README")
+ lib.start_component("pydocgui.pyw", tcltk, keyfile="pydocgui.pyw")
+ lib.add_file("pydocgui.pyw")
# Add documentation
htmlfiles.set_current()
lib = Directory(db, cab, root, "Doc", "Doc", "DOC|Doc")
+ lib.start_component("documentation", keyfile="Python%s%s.chm" % (major,minor))
lib.add_file("Python%s%s.chm" % (major, minor))
***************
*** 903,907 ****
"InstallPath"),
("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4,
! None, "py.ext"),
("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4,
"&%s <> 2" % ext_feature.id, "py.IDLE")])
--- 919,923 ----
"InstallPath"),
("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4,
! None, None),
("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4,
"&%s <> 2" % ext_feature.id, "py.IDLE")])
***************
*** 916,941 ****
pat2 = r"Software\Classes\%sPython.%sFile\DefaultIcon"
pat3 = r"Software\Classes\%sPython.%sFile"
add_data(db, "Registry",
! [# Extensions
! ("py.ext", -1, r"Software\Classes\."+ext, "",
! "Python.File", "REGISTRY.def"),
! ("pyw.ext", -1, r"Software\Classes\."+ext+'w', "",
! "Python.NoConFile", "REGISTRY.def"),
! ("pyc.ext", -1, r"Software\Classes\."+ext+'c', "",
! "Python.CompiledFile", "REGISTRY.def"),
! ("pyo.ext", -1, r"Software\Classes\."+ext+'o', "",
! "Python.CompiledFile", "REGISTRY.def"),
! # MIME types
! ("py.mime", -1, r"Software\Classes\."+ext, "Content Type",
! "text/plain", "REGISTRY.def"),
! ("pyw.mime", -1, r"Software\Classes\."+ext+'w', "Content Type",
! "text/plain", "REGISTRY.def"),
! #Verbs
! ("py.open", -1, pat % (testprefix, "", "open"), "",
! r'"[TARGETDIR]python.exe" "%1" %*', "REGISTRY.def"),
! ("pyw.open", -1, pat % (testprefix, "NoCon", "open"), "",
! r'"[TARGETDIR]pythonw.exe" "%1" %*', "REGISTRY.def"),
! ("pyc.open", -1, pat % (testprefix, "Compiled", "open"), "",
! r'"[TARGETDIR]python.exe" "%1" %*', "REGISTRY.def"),
("py.IDLE", -1, pat % (testprefix, "", ewi), "",
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
--- 932,957 ----
pat2 = r"Software\Classes\%sPython.%sFile\DefaultIcon"
pat3 = r"Software\Classes\%sPython.%sFile"
+ # Advertised extensions
+ add_data(db, "Extension",
+ [("py", "python.exe", "Python.File", None, default_feature.id),
+ ("pyw", "pythonw.exe", "Python.NoConFile", None, default_feature.id),
+ ("pyc", "python.exe", "Python.CompiledFile", None, default_feature.id),
+ ("pyo", "python.exe", "Python.CompiledFile", None, default_feature.id)])
+ # add_data(db, "MIME") XXX
+ add_data(db, "Verb",
+ [("py", "open", 1, None, r'-n -e "%1"'),
+ ("pyw", "open", 1, None, r'-n -e "%1"'),
+ ("pyc", "open", 1, None, r'-n -e "%1"'),
+ ("pyo", "open", 1, None, r'-n -e "%1"')])
+ add_data(db, "ProgId",
+ [("Python.File", None, None, "Python File", "python_icon.exe", 0),
+ ("Python.NoConFile", None, None, "Python File (no console)", "python_icon.exe", 0),
+ ("Python.CompiledFile", None, None, "Compiled Python File", "python_icon.exe", 1)])
+
+ # Non-advertised verbs: for advertised verbs, we would need to invoke the same
+ # executable for both open and "Edit with IDLE". This cannot work, as we want
+ # to use pythonw.exe in either case
add_data(db, "Registry",
! [#Verbs
("py.IDLE", -1, pat % (testprefix, "", ewi), "",
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
***************
*** 944,961 ****
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
"REGISTRY.tcl"),
- #Icons
- ("py.icon", -1, pat2 % (testprefix, ""), "",
- r'[TARGETDIR]py.ico', "REGISTRY.def"),
- ("pyw.icon", -1, pat2 % (testprefix, "NoCon"), "",
- r'[TARGETDIR]py.ico', "REGISTRY.def"),
- ("pyc.icon", -1, pat2 % (testprefix, "Compiled"), "",
- r'[TARGETDIR]pyc.ico', "REGISTRY.def"),
- # Descriptions
- ("py.txt", -1, pat3 % (testprefix, ""), "",
- "Python File", "REGISTRY.def"),
- ("pyw.txt", -1, pat3 % (testprefix, "NoCon"), "",
- "Python File (no console)", "REGISTRY.def"),
- ("pyc.txt", -1, pat3 % (testprefix, "Compiled"), "",
- "Compiled Python File", "REGISTRY.def"),
])
--- 960,963 ----
***************
*** 982,1011 ****
add_data(db, "Shortcut",
[# Advertised shortcuts: targets are features, not files
! # The key file of the component is then entered as the real target
! # XXX, advertised shortcuts don't work, so make them unadvertised
! # for now
! #("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe",
! # tcltk.id, r"[TARGETDIR]Lib\idlelib\idle.pyw",
! # None, None, None, "py.ico", None, "TARGETDIR"),
! #("PyDoc", "MenuDir", "MODDOCS|Module Docs", "pythonw.exe",
! # default_feature.id, r"[TARGETDIR]Tools\scripts\pydocgui.pyw",
! # None, None, None, "py.ico", None, "TARGETDIR"),
! #("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe",
! # default_feature.id, None,
! # None, None, None, "py.ico", None, "TARGETDIR"),
! ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "REGISTRY",
! r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Lib\idlelib\idle.pyw",
! None, None, None, None, None, "TARGETDIR"),
! ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "REGISTRY",
! r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Tools\scripts\pydocgui.pyw",
! None, None, None, None, None, "TARGETDIR"),
! ("Python", "MenuDir", "PYTHON|Python (command line)", "REGISTRY",
! r"[TARGETDIR]python.exe", None,
! None, None, None, None, None, "TARGETDIR"),
!
! ## Non-advertised features: must be associated with a registry component
! ("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY",
! r"[TARGETDIR]Doc\python%s%s.chm" % (major, minor), None,
! None, None, None, None, None, None),
("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY",
SystemFolderName+"msiexec", "/x%s" % product_code,
--- 984,996 ----
add_data(db, "Shortcut",
[# Advertised shortcuts: targets are features, not files
! ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe",
! idle.id, r"[TARGETDIR]Lib\idlelib\idle.pyw", None, None, "python_icon.exe", 0, None, "TARGETDIR"),
! ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "pythonw.exe",
! tcltk.id, r"[TARGETDIR]Tools\scripts\pydocgui.pyw", None, None, "python_icon.exe", 0, None, "TARGETDIR"),
! ("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe",
! default_feature.id, None, None, None, "python_icon.exe", 2, None, "TARGETDIR"),
! ("Manual", "MenuDir", "MANUAL|Python Manuals", "documentation",
! htmlfiles.id, None, None, None, None, None, None, None),
! ## Non-advertised shortcuts: must be associated with a registry component
("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY",
SystemFolderName+"msiexec", "/x%s" % product_code,
Index: msilib.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** msilib.py 1 Aug 2004 22:14:19 -0000 1.10
--- msilib.py 13 Aug 2004 15:25:28 -0000 1.11
***************
*** 430,435 ****
add_data(db, "Directory", [(logical, blogical, default)])
! def start_component(self, component, feature = None, flags = 0, keyfile = None):
uuid = gen_uuid()
self.component = component
if Win64:
--- 430,437 ----
add_data(db, "Directory", [(logical, blogical, default)])
! def start_component(self, component = None, feature = None, flags = 0, keyfile = None):
uuid = gen_uuid()
+ if component is None:
+ component = self.logical
self.component = component
if Win64:
***************
*** 522,528 ****
# self.logical, 2)])
! def glob(self, pattern):
files = glob.glob1(self.absolute, pattern)
for f in files:
self.add_file(f)
return files
--- 524,531 ----
# self.logical, 2)])
! def glob(self, pattern, exclude = None):
files = glob.glob1(self.absolute, pattern)
for f in files:
+ if exclude and f in exclude: continue
self.add_file(f)
return files
More information about the Python-checkins
mailing list