Update of /cvsroot/python/python/nondist/sandbox/msi
In directory sc8-pr-cvs1:/tmp/cvs-serv17550
Modified Files:
msi.py
Log Message:
Add advanced options dialog (default python, all users install).
Delete Verb/ProgId/Extension tables, as they cannot be conditionalized.
Index: msi.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** msi.py 1 Jan 2004 15:41:06 -0000 1.3
--- msi.py 2 Jan 2004 20:43:24 -0000 1.4
***************
*** 73,77 ****
msilib.add_tables(db, sequence)
add_data(db, "Property", [("UpgradeCode", upgrade_code),
! ("ALLUSERS", "2")])
db.Commit()
return db
--- 73,78 ----
msilib.add_tables(db, sequence)
add_data(db, "Property", [("UpgradeCode", upgrade_code),
! ("DEFAULTPYTHON", "1"),
! ("WhichUsers", "ALL")])
db.Commit()
return db
***************
*** 156,160 ****
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
("InitialTargetDir", 307, "TARGETDIR",
! "[WindowsVolume]Python%s%s" % (major, minor))
])
--- 157,161 ----
# msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty
("InitialTargetDir", 307, "TARGETDIR",
! "[WindowsVolume]Python%s%s" % (major, minor)),
])
***************
*** 171,174 ****
--- 172,176 ----
[("InitialTargetDir", 'TARGETDIR=""', 750)])
+ #####################################################################
# Standard dialogs: FatalError, UserExit, ExitDialog
fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
***************
*** 207,210 ****
--- 209,213 ----
c.event("EndDialog", "Return")
+ #####################################################################
# Required dialog: FilesInUse, ErrorDlg
inuse = PyDialog(db, "FilesInUse", x, y, w, h, 19, title,
***************
*** 237,240 ****
--- 240,244 ----
error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry")
+ #####################################################################
# Global "Query Cancel" dialog
cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title,
***************
*** 250,253 ****
--- 254,258 ----
c.event("EndDialog", "Return")
+ #####################################################################
# Global "Wait for costing" dialog
costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title,
***************
*** 260,263 ****
--- 265,269 ----
c.event("EndDialog", "Exit")
+ #####################################################################
# Preparation dialog: no user input except cancellation
prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title,
***************
*** 301,304 ****
--- 307,311 ----
c.event("DirectoryListNew", "0")
+ #####################################################################
# SelectFeaturesDlg
features = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal|track_disk_space,
***************
*** 311,319 ****
c=features.back("< Back", "Next")
! c.event("NewDialog", "SelectDirectoryDlg") # XXX InstallMode=""
c=features.next("Next >", "Cancel")
c.mapping("SelectionNoItems", "Enabled")
! c.event("EndDialog", "Return")
c=features.cancel("Cancel", "Tree")
--- 318,328 ----
c=features.back("< Back", "Next")
! c.event("NewDialog", "SelectDirectoryDlg")
c=features.next("Next >", "Cancel")
c.mapping("SelectionNoItems", "Enabled")
! c.event("[ALLUSERS]", "2", 'VersionNT and WhichUsers="ALL"', order=1)
! c.event("SpawnDialog", "DiskCostDlg", "OutOfDiskSpace=1", order=2)
! c.event("EndDialog", "Return", "OutOfDiskSpace<>1", order=3)
c=features.cancel("Cancel", "Tree")
***************
*** 334,337 ****
--- 343,349 ----
c.event("SpawnDialog", "DiskCostDlg")
+ c=features.xbutton("Advanced", "Advanced", None, 0.30)
+ c.event("SpawnDialog", "AdvancedDlg")
+
c=features.text("ItemDescription", 140, 180, 210, 50, 3,
"Multiline description of the currently selected item.")
***************
*** 342,345 ****
--- 354,358 ----
c.mapping("SelectionSize", "Text")
+ #####################################################################
# Disk cost
cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title,
***************
*** 358,363 ****
None, "{120}{70}{70}{70}{70}", None, None)
cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return")
-
# Installation Progress dialog (modeless)
progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
--- 371,403 ----
None, "{120}{70}{70}{70}{70}", None, None)
cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return")
+ #####################################################################
+ # Advanced Options
+ advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title,
+ "OK", "OK", "OK")
+ advanced.title("Advanced Options")
+ #0x10: Numeric property
+ advanced.control("Default", "CheckBox", 135, 60, 160, 20, 19,
+ "DEFAULTPYTHON", "Install as Default Python Installation",
+ "AdminInstall", None)
+ g = advanced.radiogroup("AdminInstall", 135, 90, 160, 50, 3,
+ "WhichUsers", "", "OK")
+ # ALLUSERS should not be tempered with on W9x
+ g.condition("Hide", "Windows9x or NOT Privileged")
+ g.add("ALL", 0, 5, 150, 20, "Install for all users")
+ g.add("JUSTME", 0, 25, 150, 20, "Install just for me")
+
+ # Alternative texts if AdminInstall is not available
+ c=advanced.text("Unprivileged", 135, 90, 160, 50, 3,
+ "Installing Python for all users is not possible, because you lack privileges.")
+ c.condition("Hide", "Privileged")
+ c=advanced.text("W9X", 135, 80, 160, 90, 3,
+ "Installing Python for all users is not possible on Windows 9x.")
+ c.condition("Hide", "NOT Windows9x")
+
+ advanced.cancel("Ok", "Default", name="OK").event("EndDialog", "Return")
+
+
+ #####################################################################
# Installation Progress dialog (modeless)
progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
***************
*** 454,469 ****
cab = CAB("python")
tmpfiles = []
root = Directory(db, cab, None, srcdir, "TARGETDIR", "SourceDir")
! # Create separate components for python.exe and pythonw.exe so we can
! # create advertised shortcuts
! root.start_component("python.exe", default_feature, "python.exe")
root.add_file("PCBuild/python.exe")
- root.start_component("pythonw.exe", default_feature, "pythonw.exe")
root.add_file("PCBuild/pythonw.exe")
- # Add all other root files into the TARGETDIR component
- root.start_component("TARGETDIR", default_feature)
- root.add_file("PCBuild/w9xpopen.exe") # XXX: separate component to only install on W9x
-
root.add_file("PCBuild/python%s%s.dll" % (major, minor)) # XXX separate component for system32
# XXX determine dependencies
--- 494,509 ----
cab = CAB("python")
tmpfiles = []
+ # Add all executables, icons, text files into the TARGETDIR component
root = Directory(db, cab, None, srcdir, "TARGETDIR", "SourceDir")
! default_feature.set_current()
root.add_file("PCBuild/python.exe")
root.add_file("PCBuild/pythonw.exe")
+ root.add_file("PCBuild/w9xpopen.exe")
+ root.add_file("PC/py.ico")
+ root.add_file("PC/pyc.ico")
+ root.add_file("README.txt", src="README")
+ root.add_file("NEWS.txt", src="Misc/NEWS")
+ root.add_file("LICENSE.txt", src="LICENSE")
root.add_file("PCBuild/python%s%s.dll" % (major, minor)) # XXX separate component for system32
# XXX determine dependencies
***************
*** 473,481 ****
tmpfiles.append("msvcr71.dll")
- root.add_file("README.txt", src="README")
- root.add_file("NEWS.txt", src="Misc/NEWS")
- root.add_file("LICENSE.txt", src="LICENSE")
- dirs={}
# Add all .py files in Lib, except lib-tk, test
pydirs = [(root,"Lib")]
while pydirs:
--- 513,518 ----
tmpfiles.append("msvcr71.dll")
# Add all .py files in Lib, except lib-tk, test
+ dirs={}
pydirs = [(root,"Lib")]
while pydirs:
***************
*** 506,509 ****
--- 543,556 ----
lib.glob("*.gif")
lib.add_file("idle.icns")
+ if dir=="command":
+ lib.add_file("wininst.exe")
+ if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email":
+ # This should contain all non-CVS files listed in CVS
+ for f in os.listdir(lib.absolute):
+ if f.endswith(".txt") or f=="CVS":continue
+ if f.endswith(".au") or f.endswith(".gif"):
+ lib.add_file(f)
+ else:
+ print "WARNING: New file %s in email/test/data" % f
for f in os.listdir(lib.absolute):
if os.path.isdir(os.path.join(lib.absolute, f)):
***************
*** 541,544 ****
--- 588,592 ----
lib = Directory(db, cab, root, "include", "include", "INCLUDE|include")
lib.glob("*.h")
+ lib.add_file("pyconfig.h", src="../PC/pyconfig.h")
# Add import libraries
lib = Directory(db, cab, root, "PCBuild", "libs", "LIBS|libs")
***************
*** 582,632 ****
def add_registry(db):
! # File extensions, associated with the REGISTRY component
# msidbComponentAttributesRegistryKeyPath = 4
add_data(db, "Component",
[("REGISTRY", msilib.gen_uuid(), "TARGETDIR", 4, None,
! "InstallPath")])
add_data(db, "FeatureComponents",
! [(default_feature.id, "REGISTRY")])
! add_data(db, "Extension",
! # Apparently, the key file of the component is used as the command;
! # the verb table only contributes the arguments. As the result, all
! # verbs for an extension must use the same command.
! # (Verb.Command is just the localized UI label of the verb)
! [(ext, 'python.exe', testprefix+'Python.File', None, default_feature.id),
! (ext+'w', 'pythonw.exe', testprefix+'Python.NoConFile', None, default_feature.id),
! (ext+'c', 'python.exe', testprefix+'Python.CompiledFile', None, default_feature.id),
! ])
! add_data(db, "ProgId",
! [(testprefix+'Python.File', None, None, 'Python File', 'py.ico', None),
! (testprefix+'Python.NoConFile', None, None,
! 'Python File (no console)', 'py.ico', None),
! (testprefix+'Python.CompiledFile', None, None,
! 'Compiled Python File', 'pyc.ico', None)])
! add_data(db, "Icon",
! [('py.ico', Binary(srcdir+r"\PC\py.ico")),
! ('pyc.ico', Binary(srcdir+r"\PC\pyc.ico"))])
! add_data(db, "Verb",
! [(ext, 'open', 1, None, '"%1" %*'),
! (ext+'w', 'open', 1, None, '"%1" %*'),
! (ext+'c', 'open', 1, None, '"%1" %*'),
! ])
! # IDLE verbs depend on the tcltk feature.
! # For several reasons (see above) we cannot author them into the Verb table
! add_data(db, "Component",
! [("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4, None,
! None)])
! add_data(db, "FeatureComponents", [(tcltk.id, "REGISTRY.tcl")])
! pat = r"Software\Classes\%sPython.%sFile\shell\Edit with IDLE\command"
add_data(db, "Registry",
! [("IDLE.py", -1, pat % (testprefix, ""), "",
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
"REGISTRY.tcl"),
! ("IDLE.pyw", -1, pat % (testprefix, "NoCon"), "",
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
! "REGISTRY.tcl")
])
# Registry keys
- # -1 for Root specifies "dependent on ALLUSERS property"
prefix = r"Software\%sPython\PythonCore\%s" % (testprefix, short_version)
add_data(db, "Registry",
--- 630,698 ----
def add_registry(db):
! # File extensions, associated with the REGISTRY.def component
! # IDLE verbs depend on the tcltk feature.
# msidbComponentAttributesRegistryKeyPath = 4
+ # -1 for Root specifies "dependent on ALLUSERS property"
add_data(db, "Component",
[("REGISTRY", msilib.gen_uuid(), "TARGETDIR", 4, None,
! "InstallPath"),
! ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4,
! "DEFAULTPYTHON=1", None),
! ("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4,
! "DEFAULTPYTHON=1", None)])
add_data(db, "FeatureComponents",
! [(default_feature.id, "REGISTRY"),
! (default_feature.id, "REGISTRY.def"),
! (tcltk.id, "REGISTRY.tcl")])
!
! pat = r"Software\Classes\%sPython.%sFile\shell\%s\command"
! ewi = "Edit with IDLE"
! 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"',
"REGISTRY.tcl"),
! ("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "",
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"),
])
+
# Registry keys
prefix = r"Software\%sPython\PythonCore\%s" % (testprefix, short_version)
add_data(db, "Registry",
***************
*** 640,644 ****
("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"),
("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe",
! "", r"[TARGETDIR]Python.exe", "REGISTRY")
])
# Shortcuts
--- 706,710 ----
("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"),
("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe",
! "", r"[TARGETDIR]Python.exe", "REGISTRY.def")
])
# Shortcuts