Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eac02e6

Browse files
committed
Add missing have_tcl conditions
1 parent 2a21679 commit eac02e6

1 file changed

Lines changed: 15 additions & 8 deletions

File tree

Tools/msi/msi.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,10 @@ def add_ui(db):
330330
add_data(db, "Binary", [("Script", msilib.Binary("inst.vbs"))])
331331
# See "Custom Action Type 6"
332332
add_data(db, "CustomAction",
333-
[("CheckDir", 6, "Script", "CheckDir"),
334-
("UpdateEditIDLE", 6, "Script", "UpdateEditIDLE")])
333+
[("CheckDir", 6, "Script", "CheckDir")])
334+
if have_tcl:
335+
add_data(db, "CustomAction",
336+
[("UpdateEditIDLE", 6, "Script", "UpdateEditIDLE")])
335337
os.unlink("inst.vbs")
336338

337339

@@ -1035,6 +1037,16 @@ def add_registry(db):
10351037
ewi = "Edit with IDLE"
10361038
pat2 = r"Software\Classes\%sPython.%sFile\DefaultIcon"
10371039
pat3 = r"Software\Classes\%sPython.%sFile"
1040+
tcl_verbs = []
1041+
if have_tcl:
1042+
tcl_verbs=[
1043+
("py.IDLE", -1, pat % (testprefix, "", ewi), "",
1044+
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
1045+
"REGISTRY.tcl"),
1046+
("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "",
1047+
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
1048+
"REGISTRY.tcl"),
1049+
]
10381050
add_data(db, "Registry",
10391051
[# Extensions
10401052
("py.ext", -1, r"Software\Classes\."+ext, "",
@@ -1057,12 +1069,7 @@ def add_registry(db):
10571069
r'"[TARGETDIR]pythonw.exe" "%1" %*', "REGISTRY.def"),
10581070
("pyc.open", -1, pat % (testprefix, "Compiled", "open"), "",
10591071
r'"[TARGETDIR]python.exe" "%1" %*', "REGISTRY.def"),
1060-
("py.IDLE", -1, pat % (testprefix, "", ewi), "",
1061-
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
1062-
"REGISTRY.tcl"),
1063-
("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "",
1064-
r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"',
1065-
"REGISTRY.tcl"),
1072+
] + tcl_verbs + [
10661073
#Icons
10671074
("py.icon", -1, pat2 % (testprefix, ""), "",
10681075
r'[TARGETDIR]py.ico', "REGISTRY.def"),

0 commit comments

Comments
 (0)