mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
Undiamond Python headers
This change gets the Python codebase into a state where it conforms to the conventions of this codebase. It's now possible to include headers from Python, without worrying about ordering. Python has traditionally solved that problem by "diamonding" everything in Python.h, but that's problematic since it means any change to any Python header invalidates all the build artifacts. Lastly it makes tooling not work. Since it is hard to explain to Emacs when I press C-c C-h to add an import line it shouldn't add the header that actually defines the symbol, and instead do follow the nonstandard Python convention. Progress has been made on letting Python load source code from the zip executable structure via the standard C library APIs. System calss now recognizes zip!FILENAME alternative URIs as equivalent to zip:FILENAME since Python uses colon as its delimiter. Some progress has been made on embedding the notice license terms into the Python object code. This is easier said than done since Python has an extremely complicated ownership story. - Some termios APIs have been added - Implement rewinddir() dirstream API - GetCpuCount() API added to Cosmopolitan Libc - More bugs in Cosmopolitan Libc have been fixed - zipobj.com now has flags for mangling the path - Fixed bug a priori with sendfile() on certain BSDs - Polyfill F_DUPFD and F_DUPFD_CLOEXEC across platforms - FIOCLEX / FIONCLEX now polyfilled for fast O_CLOEXEC changes - APE now supports a hybrid solution to no-self-modify for builds - Many BSD-only magnums added, e.g. O_SEARCH, O_SHLOCK, SF_NODISKIO
This commit is contained in:
parent
20bb8db9f8
commit
b420ed8248
762 changed files with 18410 additions and 53772 deletions
154
third_party/python/Tools/demo/hanoi.py
vendored
154
third_party/python/Tools/demo/hanoi.py
vendored
|
@ -1,154 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Animated Towers of Hanoi using Tk with optional bitmap file in background.
|
||||
|
||||
Usage: hanoi.py [n [bitmapfile]]
|
||||
|
||||
n is the number of pieces to animate; default is 4, maximum 15.
|
||||
|
||||
The bitmap file can be any X11 bitmap file (look in /usr/include/X11/bitmaps for
|
||||
samples); it is displayed as the background of the animation. Default is no
|
||||
bitmap.
|
||||
"""
|
||||
|
||||
from tkinter import Tk, Canvas
|
||||
|
||||
# Basic Towers-of-Hanoi algorithm: move n pieces from a to b, using c
|
||||
# as temporary. For each move, call report()
|
||||
def hanoi(n, a, b, c, report):
|
||||
if n <= 0: return
|
||||
hanoi(n-1, a, c, b, report)
|
||||
report(n, a, b)
|
||||
hanoi(n-1, c, b, a, report)
|
||||
|
||||
|
||||
# The graphical interface
|
||||
class Tkhanoi:
|
||||
|
||||
# Create our objects
|
||||
def __init__(self, n, bitmap = None):
|
||||
self.n = n
|
||||
self.tk = tk = Tk()
|
||||
self.canvas = c = Canvas(tk)
|
||||
c.pack()
|
||||
width, height = tk.getint(c['width']), tk.getint(c['height'])
|
||||
|
||||
# Add background bitmap
|
||||
if bitmap:
|
||||
self.bitmap = c.create_bitmap(width//2, height//2,
|
||||
bitmap=bitmap,
|
||||
foreground='blue')
|
||||
|
||||
# Generate pegs
|
||||
pegwidth = 10
|
||||
pegheight = height//2
|
||||
pegdist = width//3
|
||||
x1, y1 = (pegdist-pegwidth)//2, height*1//3
|
||||
x2, y2 = x1+pegwidth, y1+pegheight
|
||||
self.pegs = []
|
||||
p = c.create_rectangle(x1, y1, x2, y2, fill='black')
|
||||
self.pegs.append(p)
|
||||
x1, x2 = x1+pegdist, x2+pegdist
|
||||
p = c.create_rectangle(x1, y1, x2, y2, fill='black')
|
||||
self.pegs.append(p)
|
||||
x1, x2 = x1+pegdist, x2+pegdist
|
||||
p = c.create_rectangle(x1, y1, x2, y2, fill='black')
|
||||
self.pegs.append(p)
|
||||
self.tk.update()
|
||||
|
||||
# Generate pieces
|
||||
pieceheight = pegheight//16
|
||||
maxpiecewidth = pegdist*2//3
|
||||
minpiecewidth = 2*pegwidth
|
||||
self.pegstate = [[], [], []]
|
||||
self.pieces = {}
|
||||
x1, y1 = (pegdist-maxpiecewidth)//2, y2-pieceheight-2
|
||||
x2, y2 = x1+maxpiecewidth, y1+pieceheight
|
||||
dx = (maxpiecewidth-minpiecewidth) // (2*max(1, n-1))
|
||||
for i in range(n, 0, -1):
|
||||
p = c.create_rectangle(x1, y1, x2, y2, fill='red')
|
||||
self.pieces[i] = p
|
||||
self.pegstate[0].append(i)
|
||||
x1, x2 = x1 + dx, x2-dx
|
||||
y1, y2 = y1 - pieceheight-2, y2-pieceheight-2
|
||||
self.tk.update()
|
||||
self.tk.after(25)
|
||||
|
||||
# Run -- never returns
|
||||
def run(self):
|
||||
while 1:
|
||||
hanoi(self.n, 0, 1, 2, self.report)
|
||||
hanoi(self.n, 1, 2, 0, self.report)
|
||||
hanoi(self.n, 2, 0, 1, self.report)
|
||||
hanoi(self.n, 0, 2, 1, self.report)
|
||||
hanoi(self.n, 2, 1, 0, self.report)
|
||||
hanoi(self.n, 1, 0, 2, self.report)
|
||||
|
||||
# Reporting callback for the actual hanoi function
|
||||
def report(self, i, a, b):
|
||||
if self.pegstate[a][-1] != i: raise RuntimeError # Assertion
|
||||
del self.pegstate[a][-1]
|
||||
p = self.pieces[i]
|
||||
c = self.canvas
|
||||
|
||||
# Lift the piece above peg a
|
||||
ax1, ay1, ax2, ay2 = c.bbox(self.pegs[a])
|
||||
while 1:
|
||||
x1, y1, x2, y2 = c.bbox(p)
|
||||
if y2 < ay1: break
|
||||
c.move(p, 0, -1)
|
||||
self.tk.update()
|
||||
|
||||
# Move it towards peg b
|
||||
bx1, by1, bx2, by2 = c.bbox(self.pegs[b])
|
||||
newcenter = (bx1+bx2)//2
|
||||
while 1:
|
||||
x1, y1, x2, y2 = c.bbox(p)
|
||||
center = (x1+x2)//2
|
||||
if center == newcenter: break
|
||||
if center > newcenter: c.move(p, -1, 0)
|
||||
else: c.move(p, 1, 0)
|
||||
self.tk.update()
|
||||
|
||||
# Move it down on top of the previous piece
|
||||
pieceheight = y2-y1
|
||||
newbottom = by2 - pieceheight*len(self.pegstate[b]) - 2
|
||||
while 1:
|
||||
x1, y1, x2, y2 = c.bbox(p)
|
||||
if y2 >= newbottom: break
|
||||
c.move(p, 0, 1)
|
||||
self.tk.update()
|
||||
|
||||
# Update peg state
|
||||
self.pegstate[b].append(i)
|
||||
|
||||
|
||||
def main():
|
||||
import sys
|
||||
|
||||
# First argument is number of pegs, default 4
|
||||
if sys.argv[1:]:
|
||||
n = int(sys.argv[1])
|
||||
else:
|
||||
n = 4
|
||||
|
||||
# Second argument is bitmap file, default none
|
||||
if sys.argv[2:]:
|
||||
bitmap = sys.argv[2]
|
||||
# Reverse meaning of leading '@' compared to Tk
|
||||
if bitmap[0] == '@': bitmap = bitmap[1:]
|
||||
else: bitmap = '@' + bitmap
|
||||
else:
|
||||
bitmap = None
|
||||
|
||||
# Create the graphical objects...
|
||||
h = Tkhanoi(n, bitmap)
|
||||
|
||||
# ...and run!
|
||||
h.run()
|
||||
|
||||
|
||||
# Call main when run as script
|
||||
if __name__ == '__main__':
|
||||
main()
|
262
third_party/python/Tools/demo/life.py
vendored
262
third_party/python/Tools/demo/life.py
vendored
|
@ -1,262 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
A curses-based version of Conway's Game of Life.
|
||||
|
||||
An empty board will be displayed, and the following commands are available:
|
||||
E : Erase the board
|
||||
R : Fill the board randomly
|
||||
S : Step for a single generation
|
||||
C : Update continuously until a key is struck
|
||||
Q : Quit
|
||||
Cursor keys : Move the cursor around the board
|
||||
Space or Enter : Toggle the contents of the cursor's position
|
||||
|
||||
Contributed by Andrew Kuchling, Mouse support and color by Dafydd Crosby.
|
||||
"""
|
||||
|
||||
import curses
|
||||
import random
|
||||
|
||||
|
||||
class LifeBoard:
|
||||
"""Encapsulates a Life board
|
||||
|
||||
Attributes:
|
||||
X,Y : horizontal and vertical size of the board
|
||||
state : dictionary mapping (x,y) to 0 or 1
|
||||
|
||||
Methods:
|
||||
display(update_board) -- If update_board is true, compute the
|
||||
next generation. Then display the state
|
||||
of the board and refresh the screen.
|
||||
erase() -- clear the entire board
|
||||
make_random() -- fill the board randomly
|
||||
set(y,x) -- set the given cell to Live; doesn't refresh the screen
|
||||
toggle(y,x) -- change the given cell from live to dead, or vice
|
||||
versa, and refresh the screen display
|
||||
|
||||
"""
|
||||
def __init__(self, scr, char=ord('*')):
|
||||
"""Create a new LifeBoard instance.
|
||||
|
||||
scr -- curses screen object to use for display
|
||||
char -- character used to render live cells (default: '*')
|
||||
"""
|
||||
self.state = {}
|
||||
self.scr = scr
|
||||
Y, X = self.scr.getmaxyx()
|
||||
self.X, self.Y = X - 2, Y - 2 - 1
|
||||
self.char = char
|
||||
self.scr.clear()
|
||||
|
||||
# Draw a border around the board
|
||||
border_line = '+' + (self.X * '-') + '+'
|
||||
self.scr.addstr(0, 0, border_line)
|
||||
self.scr.addstr(self.Y + 1, 0, border_line)
|
||||
for y in range(0, self.Y):
|
||||
self.scr.addstr(1 + y, 0, '|')
|
||||
self.scr.addstr(1 + y, self.X + 1, '|')
|
||||
self.scr.refresh()
|
||||
|
||||
def set(self, y, x):
|
||||
"""Set a cell to the live state"""
|
||||
if x < 0 or self.X <= x or y < 0 or self.Y <= y:
|
||||
raise ValueError("Coordinates out of range %i,%i" % (y, x))
|
||||
self.state[x, y] = 1
|
||||
|
||||
def toggle(self, y, x):
|
||||
"""Toggle a cell's state between live and dead"""
|
||||
if x < 0 or self.X <= x or y < 0 or self.Y <= y:
|
||||
raise ValueError("Coordinates out of range %i,%i" % (y, x))
|
||||
if (x, y) in self.state:
|
||||
del self.state[x, y]
|
||||
self.scr.addch(y + 1, x + 1, ' ')
|
||||
else:
|
||||
self.state[x, y] = 1
|
||||
if curses.has_colors():
|
||||
# Let's pick a random color!
|
||||
self.scr.attrset(curses.color_pair(random.randrange(1, 7)))
|
||||
self.scr.addch(y + 1, x + 1, self.char)
|
||||
self.scr.attrset(0)
|
||||
self.scr.refresh()
|
||||
|
||||
def erase(self):
|
||||
"""Clear the entire board and update the board display"""
|
||||
self.state = {}
|
||||
self.display(update_board=False)
|
||||
|
||||
def display(self, update_board=True):
|
||||
"""Display the whole board, optionally computing one generation"""
|
||||
M, N = self.X, self.Y
|
||||
if not update_board:
|
||||
for i in range(0, M):
|
||||
for j in range(0, N):
|
||||
if (i, j) in self.state:
|
||||
self.scr.addch(j + 1, i + 1, self.char)
|
||||
else:
|
||||
self.scr.addch(j + 1, i + 1, ' ')
|
||||
self.scr.refresh()
|
||||
return
|
||||
|
||||
d = {}
|
||||
self.boring = 1
|
||||
for i in range(0, M):
|
||||
L = range(max(0, i - 1), min(M, i + 2))
|
||||
for j in range(0, N):
|
||||
s = 0
|
||||
live = (i, j) in self.state
|
||||
for k in range(max(0, j - 1), min(N, j + 2)):
|
||||
for l in L:
|
||||
if (l, k) in self.state:
|
||||
s += 1
|
||||
s -= live
|
||||
if s == 3:
|
||||
# Birth
|
||||
d[i, j] = 1
|
||||
if curses.has_colors():
|
||||
# Let's pick a random color!
|
||||
self.scr.attrset(curses.color_pair(
|
||||
random.randrange(1, 7)))
|
||||
self.scr.addch(j + 1, i + 1, self.char)
|
||||
self.scr.attrset(0)
|
||||
if not live:
|
||||
self.boring = 0
|
||||
elif s == 2 and live:
|
||||
# Survival
|
||||
d[i, j] = 1
|
||||
elif live:
|
||||
# Death
|
||||
self.scr.addch(j + 1, i + 1, ' ')
|
||||
self.boring = 0
|
||||
self.state = d
|
||||
self.scr.refresh()
|
||||
|
||||
def make_random(self):
|
||||
"Fill the board with a random pattern"
|
||||
self.state = {}
|
||||
for i in range(0, self.X):
|
||||
for j in range(0, self.Y):
|
||||
if random.random() > 0.5:
|
||||
self.set(j, i)
|
||||
|
||||
|
||||
def erase_menu(stdscr, menu_y):
|
||||
"Clear the space where the menu resides"
|
||||
stdscr.move(menu_y, 0)
|
||||
stdscr.clrtoeol()
|
||||
stdscr.move(menu_y + 1, 0)
|
||||
stdscr.clrtoeol()
|
||||
|
||||
|
||||
def display_menu(stdscr, menu_y):
|
||||
"Display the menu of possible keystroke commands"
|
||||
erase_menu(stdscr, menu_y)
|
||||
|
||||
# If color, then light the menu up :-)
|
||||
if curses.has_colors():
|
||||
stdscr.attrset(curses.color_pair(1))
|
||||
stdscr.addstr(menu_y, 4,
|
||||
'Use the cursor keys to move, and space or Enter to toggle a cell.')
|
||||
stdscr.addstr(menu_y + 1, 4,
|
||||
'E)rase the board, R)andom fill, S)tep once or C)ontinuously, Q)uit')
|
||||
stdscr.attrset(0)
|
||||
|
||||
|
||||
def keyloop(stdscr):
|
||||
# Clear the screen and display the menu of keys
|
||||
stdscr.clear()
|
||||
stdscr_y, stdscr_x = stdscr.getmaxyx()
|
||||
menu_y = (stdscr_y - 3) - 1
|
||||
display_menu(stdscr, menu_y)
|
||||
|
||||
# If color, then initialize the color pairs
|
||||
if curses.has_colors():
|
||||
curses.init_pair(1, curses.COLOR_BLUE, 0)
|
||||
curses.init_pair(2, curses.COLOR_CYAN, 0)
|
||||
curses.init_pair(3, curses.COLOR_GREEN, 0)
|
||||
curses.init_pair(4, curses.COLOR_MAGENTA, 0)
|
||||
curses.init_pair(5, curses.COLOR_RED, 0)
|
||||
curses.init_pair(6, curses.COLOR_YELLOW, 0)
|
||||
curses.init_pair(7, curses.COLOR_WHITE, 0)
|
||||
|
||||
# Set up the mask to listen for mouse events
|
||||
curses.mousemask(curses.BUTTON1_CLICKED)
|
||||
|
||||
# Allocate a subwindow for the Life board and create the board object
|
||||
subwin = stdscr.subwin(stdscr_y - 3, stdscr_x, 0, 0)
|
||||
board = LifeBoard(subwin, char=ord('*'))
|
||||
board.display(update_board=False)
|
||||
|
||||
# xpos, ypos are the cursor's position
|
||||
xpos, ypos = board.X // 2, board.Y // 2
|
||||
|
||||
# Main loop:
|
||||
while True:
|
||||
stdscr.move(1 + ypos, 1 + xpos) # Move the cursor
|
||||
c = stdscr.getch() # Get a keystroke
|
||||
if 0 < c < 256:
|
||||
c = chr(c)
|
||||
if c in ' \n':
|
||||
board.toggle(ypos, xpos)
|
||||
elif c in 'Cc':
|
||||
erase_menu(stdscr, menu_y)
|
||||
stdscr.addstr(menu_y, 6, ' Hit any key to stop continuously '
|
||||
'updating the screen.')
|
||||
stdscr.refresh()
|
||||
# Activate nodelay mode; getch() will return -1
|
||||
# if no keystroke is available, instead of waiting.
|
||||
stdscr.nodelay(1)
|
||||
while True:
|
||||
c = stdscr.getch()
|
||||
if c != -1:
|
||||
break
|
||||
stdscr.addstr(0, 0, '/')
|
||||
stdscr.refresh()
|
||||
board.display()
|
||||
stdscr.addstr(0, 0, '+')
|
||||
stdscr.refresh()
|
||||
|
||||
stdscr.nodelay(0) # Disable nodelay mode
|
||||
display_menu(stdscr, menu_y)
|
||||
|
||||
elif c in 'Ee':
|
||||
board.erase()
|
||||
elif c in 'Qq':
|
||||
break
|
||||
elif c in 'Rr':
|
||||
board.make_random()
|
||||
board.display(update_board=False)
|
||||
elif c in 'Ss':
|
||||
board.display()
|
||||
else:
|
||||
# Ignore incorrect keys
|
||||
pass
|
||||
elif c == curses.KEY_UP and ypos > 0:
|
||||
ypos -= 1
|
||||
elif c == curses.KEY_DOWN and ypos + 1 < board.Y:
|
||||
ypos += 1
|
||||
elif c == curses.KEY_LEFT and xpos > 0:
|
||||
xpos -= 1
|
||||
elif c == curses.KEY_RIGHT and xpos + 1 < board.X:
|
||||
xpos += 1
|
||||
elif c == curses.KEY_MOUSE:
|
||||
mouse_id, mouse_x, mouse_y, mouse_z, button_state = curses.getmouse()
|
||||
if (mouse_x > 0 and mouse_x < board.X + 1 and
|
||||
mouse_y > 0 and mouse_y < board.Y + 1):
|
||||
xpos = mouse_x - 1
|
||||
ypos = mouse_y - 1
|
||||
board.toggle(ypos, xpos)
|
||||
else:
|
||||
# They've clicked outside the board
|
||||
curses.flash()
|
||||
else:
|
||||
# Ignore incorrect keys
|
||||
pass
|
||||
|
||||
|
||||
def main(stdscr):
|
||||
keyloop(stdscr) # Enter the main loop
|
||||
|
||||
if __name__ == '__main__':
|
||||
curses.wrapper(main)
|
172
third_party/python/Tools/demo/redemo.py
vendored
172
third_party/python/Tools/demo/redemo.py
vendored
|
@ -1,172 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""Basic regular expression demonstration facility (Perl style syntax)."""
|
||||
|
||||
from tkinter import *
|
||||
import re
|
||||
|
||||
class ReDemo:
|
||||
|
||||
def __init__(self, master):
|
||||
self.master = master
|
||||
|
||||
self.promptdisplay = Label(self.master, anchor=W,
|
||||
text="Enter a Perl-style regular expression:")
|
||||
self.promptdisplay.pack(side=TOP, fill=X)
|
||||
|
||||
self.regexdisplay = Entry(self.master)
|
||||
self.regexdisplay.pack(fill=X)
|
||||
self.regexdisplay.focus_set()
|
||||
|
||||
self.addoptions()
|
||||
|
||||
self.statusdisplay = Label(self.master, text="", anchor=W)
|
||||
self.statusdisplay.pack(side=TOP, fill=X)
|
||||
|
||||
self.labeldisplay = Label(self.master, anchor=W,
|
||||
text="Enter a string to search:")
|
||||
self.labeldisplay.pack(fill=X)
|
||||
self.labeldisplay.pack(fill=X)
|
||||
|
||||
self.showframe = Frame(master)
|
||||
self.showframe.pack(fill=X, anchor=W)
|
||||
|
||||
self.showvar = StringVar(master)
|
||||
self.showvar.set("first")
|
||||
|
||||
self.showfirstradio = Radiobutton(self.showframe,
|
||||
text="Highlight first match",
|
||||
variable=self.showvar,
|
||||
value="first",
|
||||
command=self.recompile)
|
||||
self.showfirstradio.pack(side=LEFT)
|
||||
|
||||
self.showallradio = Radiobutton(self.showframe,
|
||||
text="Highlight all matches",
|
||||
variable=self.showvar,
|
||||
value="all",
|
||||
command=self.recompile)
|
||||
self.showallradio.pack(side=LEFT)
|
||||
|
||||
self.stringdisplay = Text(self.master, width=60, height=4)
|
||||
self.stringdisplay.pack(fill=BOTH, expand=1)
|
||||
self.stringdisplay.tag_configure("hit", background="yellow")
|
||||
|
||||
self.grouplabel = Label(self.master, text="Groups:", anchor=W)
|
||||
self.grouplabel.pack(fill=X)
|
||||
|
||||
self.grouplist = Listbox(self.master)
|
||||
self.grouplist.pack(expand=1, fill=BOTH)
|
||||
|
||||
self.regexdisplay.bind('<Key>', self.recompile)
|
||||
self.stringdisplay.bind('<Key>', self.reevaluate)
|
||||
|
||||
self.compiled = None
|
||||
self.recompile()
|
||||
|
||||
btags = self.regexdisplay.bindtags()
|
||||
self.regexdisplay.bindtags(btags[1:] + btags[:1])
|
||||
|
||||
btags = self.stringdisplay.bindtags()
|
||||
self.stringdisplay.bindtags(btags[1:] + btags[:1])
|
||||
|
||||
def addoptions(self):
|
||||
self.frames = []
|
||||
self.boxes = []
|
||||
self.vars = []
|
||||
for name in ('IGNORECASE',
|
||||
'MULTILINE',
|
||||
'DOTALL',
|
||||
'VERBOSE'):
|
||||
if len(self.boxes) % 3 == 0:
|
||||
frame = Frame(self.master)
|
||||
frame.pack(fill=X)
|
||||
self.frames.append(frame)
|
||||
val = getattr(re, name).value
|
||||
var = IntVar()
|
||||
box = Checkbutton(frame,
|
||||
variable=var, text=name,
|
||||
offvalue=0, onvalue=val,
|
||||
command=self.recompile)
|
||||
box.pack(side=LEFT)
|
||||
self.boxes.append(box)
|
||||
self.vars.append(var)
|
||||
|
||||
def getflags(self):
|
||||
flags = 0
|
||||
for var in self.vars:
|
||||
flags = flags | var.get()
|
||||
flags = flags
|
||||
return flags
|
||||
|
||||
def recompile(self, event=None):
|
||||
try:
|
||||
self.compiled = re.compile(self.regexdisplay.get(),
|
||||
self.getflags())
|
||||
bg = self.promptdisplay['background']
|
||||
self.statusdisplay.config(text="", background=bg)
|
||||
except re.error as msg:
|
||||
self.compiled = None
|
||||
self.statusdisplay.config(
|
||||
text="re.error: %s" % str(msg),
|
||||
background="red")
|
||||
self.reevaluate()
|
||||
|
||||
def reevaluate(self, event=None):
|
||||
try:
|
||||
self.stringdisplay.tag_remove("hit", "1.0", END)
|
||||
except TclError:
|
||||
pass
|
||||
try:
|
||||
self.stringdisplay.tag_remove("hit0", "1.0", END)
|
||||
except TclError:
|
||||
pass
|
||||
self.grouplist.delete(0, END)
|
||||
if not self.compiled:
|
||||
return
|
||||
self.stringdisplay.tag_configure("hit", background="yellow")
|
||||
self.stringdisplay.tag_configure("hit0", background="orange")
|
||||
text = self.stringdisplay.get("1.0", END)
|
||||
last = 0
|
||||
nmatches = 0
|
||||
while last <= len(text):
|
||||
m = self.compiled.search(text, last)
|
||||
if m is None:
|
||||
break
|
||||
first, last = m.span()
|
||||
if last == first:
|
||||
last = first+1
|
||||
tag = "hit0"
|
||||
else:
|
||||
tag = "hit"
|
||||
pfirst = "1.0 + %d chars" % first
|
||||
plast = "1.0 + %d chars" % last
|
||||
self.stringdisplay.tag_add(tag, pfirst, plast)
|
||||
if nmatches == 0:
|
||||
self.stringdisplay.yview_pickplace(pfirst)
|
||||
groups = list(m.groups())
|
||||
groups.insert(0, m.group())
|
||||
for i in range(len(groups)):
|
||||
g = "%2d: %r" % (i, groups[i])
|
||||
self.grouplist.insert(END, g)
|
||||
nmatches = nmatches + 1
|
||||
if self.showvar.get() == "first":
|
||||
break
|
||||
|
||||
if nmatches == 0:
|
||||
self.statusdisplay.config(text="(no match)",
|
||||
background="yellow")
|
||||
else:
|
||||
self.statusdisplay.config(text="")
|
||||
|
||||
|
||||
# Main function, run when invoked as a stand-alone Python program.
|
||||
|
||||
def main():
|
||||
root = Tk()
|
||||
demo = ReDemo(root)
|
||||
root.protocol('WM_DELETE_WINDOW', root.quit)
|
||||
root.mainloop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
635
third_party/python/Tools/demo/sortvisu.py
vendored
635
third_party/python/Tools/demo/sortvisu.py
vendored
|
@ -1,635 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
Sorting algorithms visualizer using Tkinter.
|
||||
|
||||
This module is comprised of three ``components'':
|
||||
|
||||
- an array visualizer with methods that implement basic sorting
|
||||
operations (compare, swap) as well as methods for ``annotating'' the
|
||||
sorting algorithm (e.g. to show the pivot element);
|
||||
|
||||
- a number of sorting algorithms (currently quicksort, insertion sort,
|
||||
selection sort and bubble sort, as well as a randomization function),
|
||||
all using the array visualizer for its basic operations and with calls
|
||||
to its annotation methods;
|
||||
|
||||
- and a ``driver'' class which can be used as a Grail applet or as a
|
||||
stand-alone application.
|
||||
"""
|
||||
|
||||
from tkinter import *
|
||||
import random
|
||||
|
||||
XGRID = 10
|
||||
YGRID = 10
|
||||
WIDTH = 6
|
||||
|
||||
|
||||
class Array:
|
||||
|
||||
class Cancelled(BaseException):
|
||||
pass
|
||||
|
||||
def __init__(self, master, data=None):
|
||||
self.master = master
|
||||
self.frame = Frame(self.master)
|
||||
self.frame.pack(fill=X)
|
||||
self.label = Label(self.frame)
|
||||
self.label.pack()
|
||||
self.canvas = Canvas(self.frame)
|
||||
self.canvas.pack()
|
||||
self.report = Label(self.frame)
|
||||
self.report.pack()
|
||||
self.left = self.canvas.create_line(0, 0, 0, 0)
|
||||
self.right = self.canvas.create_line(0, 0, 0, 0)
|
||||
self.pivot = self.canvas.create_line(0, 0, 0, 0)
|
||||
self.items = []
|
||||
self.size = self.maxvalue = 0
|
||||
if data:
|
||||
self.setdata(data)
|
||||
|
||||
def setdata(self, data):
|
||||
olditems = self.items
|
||||
self.items = []
|
||||
for item in olditems:
|
||||
item.delete()
|
||||
self.size = len(data)
|
||||
self.maxvalue = max(data)
|
||||
self.canvas.config(width=(self.size+1)*XGRID,
|
||||
height=(self.maxvalue+1)*YGRID)
|
||||
for i in range(self.size):
|
||||
self.items.append(ArrayItem(self, i, data[i]))
|
||||
self.reset("Sort demo, size %d" % self.size)
|
||||
|
||||
speed = "normal"
|
||||
|
||||
def setspeed(self, speed):
|
||||
self.speed = speed
|
||||
|
||||
def destroy(self):
|
||||
self.frame.destroy()
|
||||
|
||||
in_mainloop = 0
|
||||
stop_mainloop = 0
|
||||
|
||||
def cancel(self):
|
||||
self.stop_mainloop = 1
|
||||
if self.in_mainloop:
|
||||
self.master.quit()
|
||||
|
||||
def step(self):
|
||||
if self.in_mainloop:
|
||||
self.master.quit()
|
||||
|
||||
def wait(self, msecs):
|
||||
if self.speed == "fastest":
|
||||
msecs = 0
|
||||
elif self.speed == "fast":
|
||||
msecs = msecs//10
|
||||
elif self.speed == "single-step":
|
||||
msecs = 1000000000
|
||||
if not self.stop_mainloop:
|
||||
self.master.update()
|
||||
id = self.master.after(msecs, self.master.quit)
|
||||
self.in_mainloop = 1
|
||||
self.master.mainloop()
|
||||
self.master.after_cancel(id)
|
||||
self.in_mainloop = 0
|
||||
if self.stop_mainloop:
|
||||
self.stop_mainloop = 0
|
||||
self.message("Cancelled")
|
||||
raise Array.Cancelled
|
||||
|
||||
def getsize(self):
|
||||
return self.size
|
||||
|
||||
def show_partition(self, first, last):
|
||||
for i in range(self.size):
|
||||
item = self.items[i]
|
||||
if first <= i < last:
|
||||
self.canvas.itemconfig(item, fill='red')
|
||||
else:
|
||||
self.canvas.itemconfig(item, fill='orange')
|
||||
self.hide_left_right_pivot()
|
||||
|
||||
def hide_partition(self):
|
||||
for i in range(self.size):
|
||||
item = self.items[i]
|
||||
self.canvas.itemconfig(item, fill='red')
|
||||
self.hide_left_right_pivot()
|
||||
|
||||
def show_left(self, left):
|
||||
if not 0 <= left < self.size:
|
||||
self.hide_left()
|
||||
return
|
||||
x1, y1, x2, y2 = self.items[left].position()
|
||||
## top, bot = HIRO
|
||||
self.canvas.coords(self.left, (x1 - 2, 0, x1 - 2, 9999))
|
||||
self.master.update()
|
||||
|
||||
def show_right(self, right):
|
||||
if not 0 <= right < self.size:
|
||||
self.hide_right()
|
||||
return
|
||||
x1, y1, x2, y2 = self.items[right].position()
|
||||
self.canvas.coords(self.right, (x2 + 2, 0, x2 + 2, 9999))
|
||||
self.master.update()
|
||||
|
||||
def hide_left_right_pivot(self):
|
||||
self.hide_left()
|
||||
self.hide_right()
|
||||
self.hide_pivot()
|
||||
|
||||
def hide_left(self):
|
||||
self.canvas.coords(self.left, (0, 0, 0, 0))
|
||||
|
||||
def hide_right(self):
|
||||
self.canvas.coords(self.right, (0, 0, 0, 0))
|
||||
|
||||
def show_pivot(self, pivot):
|
||||
x1, y1, x2, y2 = self.items[pivot].position()
|
||||
self.canvas.coords(self.pivot, (0, y1 - 2, 9999, y1 - 2))
|
||||
|
||||
def hide_pivot(self):
|
||||
self.canvas.coords(self.pivot, (0, 0, 0, 0))
|
||||
|
||||
def swap(self, i, j):
|
||||
if i == j: return
|
||||
self.countswap()
|
||||
item = self.items[i]
|
||||
other = self.items[j]
|
||||
self.items[i], self.items[j] = other, item
|
||||
item.swapwith(other)
|
||||
|
||||
def compare(self, i, j):
|
||||
self.countcompare()
|
||||
item = self.items[i]
|
||||
other = self.items[j]
|
||||
return item.compareto(other)
|
||||
|
||||
def reset(self, msg):
|
||||
self.ncompares = 0
|
||||
self.nswaps = 0
|
||||
self.message(msg)
|
||||
self.updatereport()
|
||||
self.hide_partition()
|
||||
|
||||
def message(self, msg):
|
||||
self.label.config(text=msg)
|
||||
|
||||
def countswap(self):
|
||||
self.nswaps = self.nswaps + 1
|
||||
self.updatereport()
|
||||
|
||||
def countcompare(self):
|
||||
self.ncompares = self.ncompares + 1
|
||||
self.updatereport()
|
||||
|
||||
def updatereport(self):
|
||||
text = "%d cmps, %d swaps" % (self.ncompares, self.nswaps)
|
||||
self.report.config(text=text)
|
||||
|
||||
|
||||
class ArrayItem:
|
||||
|
||||
def __init__(self, array, index, value):
|
||||
self.array = array
|
||||
self.index = index
|
||||
self.value = value
|
||||
self.canvas = array.canvas
|
||||
x1, y1, x2, y2 = self.position()
|
||||
self.item_id = array.canvas.create_rectangle(x1, y1, x2, y2,
|
||||
fill='red', outline='black', width=1)
|
||||
self.canvas.tag_bind(self.item_id, '<Button-1>', self.mouse_down)
|
||||
self.canvas.tag_bind(self.item_id, '<Button1-Motion>', self.mouse_move)
|
||||
self.canvas.tag_bind(self.item_id, '<ButtonRelease-1>', self.mouse_up)
|
||||
|
||||
def delete(self):
|
||||
item_id = self.item_id
|
||||
self.array = None
|
||||
self.item_id = None
|
||||
self.canvas.delete(item_id)
|
||||
|
||||
def mouse_down(self, event):
|
||||
self.lastx = event.x
|
||||
self.lasty = event.y
|
||||
self.origx = event.x
|
||||
self.origy = event.y
|
||||
self.canvas.tag_raise(self.item_id)
|
||||
|
||||
def mouse_move(self, event):
|
||||
self.canvas.move(self.item_id,
|
||||
event.x - self.lastx, event.y - self.lasty)
|
||||
self.lastx = event.x
|
||||
self.lasty = event.y
|
||||
|
||||
def mouse_up(self, event):
|
||||
i = self.nearestindex(event.x)
|
||||
if i >= self.array.getsize():
|
||||
i = self.array.getsize() - 1
|
||||
if i < 0:
|
||||
i = 0
|
||||
other = self.array.items[i]
|
||||
here = self.index
|
||||
self.array.items[here], self.array.items[i] = other, self
|
||||
self.index = i
|
||||
x1, y1, x2, y2 = self.position()
|
||||
self.canvas.coords(self.item_id, (x1, y1, x2, y2))
|
||||
other.setindex(here)
|
||||
|
||||
def setindex(self, index):
|
||||
nsteps = steps(self.index, index)
|
||||
if not nsteps: return
|
||||
if self.array.speed == "fastest":
|
||||
nsteps = 0
|
||||
oldpts = self.position()
|
||||
self.index = index
|
||||
newpts = self.position()
|
||||
trajectory = interpolate(oldpts, newpts, nsteps)
|
||||
self.canvas.tag_raise(self.item_id)
|
||||
for pts in trajectory:
|
||||
self.canvas.coords(self.item_id, pts)
|
||||
self.array.wait(50)
|
||||
|
||||
def swapwith(self, other):
|
||||
nsteps = steps(self.index, other.index)
|
||||
if not nsteps: return
|
||||
if self.array.speed == "fastest":
|
||||
nsteps = 0
|
||||
myoldpts = self.position()
|
||||
otheroldpts = other.position()
|
||||
self.index, other.index = other.index, self.index
|
||||
mynewpts = self.position()
|
||||
othernewpts = other.position()
|
||||
myfill = self.canvas.itemcget(self.item_id, 'fill')
|
||||
otherfill = self.canvas.itemcget(other.item_id, 'fill')
|
||||
self.canvas.itemconfig(self.item_id, fill='green')
|
||||
self.canvas.itemconfig(other.item_id, fill='yellow')
|
||||
self.array.master.update()
|
||||
if self.array.speed == "single-step":
|
||||
self.canvas.coords(self.item_id, mynewpts)
|
||||
self.canvas.coords(other.item_id, othernewpts)
|
||||
self.array.master.update()
|
||||
self.canvas.itemconfig(self.item_id, fill=myfill)
|
||||
self.canvas.itemconfig(other.item_id, fill=otherfill)
|
||||
self.array.wait(0)
|
||||
return
|
||||
mytrajectory = interpolate(myoldpts, mynewpts, nsteps)
|
||||
othertrajectory = interpolate(otheroldpts, othernewpts, nsteps)
|
||||
if self.value > other.value:
|
||||
self.canvas.tag_raise(self.item_id)
|
||||
self.canvas.tag_raise(other.item_id)
|
||||
else:
|
||||
self.canvas.tag_raise(other.item_id)
|
||||
self.canvas.tag_raise(self.item_id)
|
||||
try:
|
||||
for i in range(len(mytrajectory)):
|
||||
mypts = mytrajectory[i]
|
||||
otherpts = othertrajectory[i]
|
||||
self.canvas.coords(self.item_id, mypts)
|
||||
self.canvas.coords(other.item_id, otherpts)
|
||||
self.array.wait(50)
|
||||
finally:
|
||||
mypts = mytrajectory[-1]
|
||||
otherpts = othertrajectory[-1]
|
||||
self.canvas.coords(self.item_id, mypts)
|
||||
self.canvas.coords(other.item_id, otherpts)
|
||||
self.canvas.itemconfig(self.item_id, fill=myfill)
|
||||
self.canvas.itemconfig(other.item_id, fill=otherfill)
|
||||
|
||||
def compareto(self, other):
|
||||
myfill = self.canvas.itemcget(self.item_id, 'fill')
|
||||
otherfill = self.canvas.itemcget(other.item_id, 'fill')
|
||||
if self.value < other.value:
|
||||
myflash = 'white'
|
||||
otherflash = 'black'
|
||||
outcome = -1
|
||||
elif self.value > other.value:
|
||||
myflash = 'black'
|
||||
otherflash = 'white'
|
||||
outcome = 1
|
||||
else:
|
||||
myflash = otherflash = 'grey'
|
||||
outcome = 0
|
||||
try:
|
||||
self.canvas.itemconfig(self.item_id, fill=myflash)
|
||||
self.canvas.itemconfig(other.item_id, fill=otherflash)
|
||||
self.array.wait(500)
|
||||
finally:
|
||||
self.canvas.itemconfig(self.item_id, fill=myfill)
|
||||
self.canvas.itemconfig(other.item_id, fill=otherfill)
|
||||
return outcome
|
||||
|
||||
def position(self):
|
||||
x1 = (self.index+1)*XGRID - WIDTH//2
|
||||
x2 = x1+WIDTH
|
||||
y2 = (self.array.maxvalue+1)*YGRID
|
||||
y1 = y2 - (self.value)*YGRID
|
||||
return x1, y1, x2, y2
|
||||
|
||||
def nearestindex(self, x):
|
||||
return int(round(float(x)/XGRID)) - 1
|
||||
|
||||
|
||||
# Subroutines that don't need an object
|
||||
|
||||
def steps(here, there):
|
||||
nsteps = abs(here - there)
|
||||
if nsteps <= 3:
|
||||
nsteps = nsteps * 3
|
||||
elif nsteps <= 5:
|
||||
nsteps = nsteps * 2
|
||||
elif nsteps > 10:
|
||||
nsteps = 10
|
||||
return nsteps
|
||||
|
||||
def interpolate(oldpts, newpts, n):
|
||||
if len(oldpts) != len(newpts):
|
||||
raise ValueError("can't interpolate arrays of different length")
|
||||
pts = [0]*len(oldpts)
|
||||
res = [tuple(oldpts)]
|
||||
for i in range(1, n):
|
||||
for k in range(len(pts)):
|
||||
pts[k] = oldpts[k] + (newpts[k] - oldpts[k])*i//n
|
||||
res.append(tuple(pts))
|
||||
res.append(tuple(newpts))
|
||||
return res
|
||||
|
||||
|
||||
# Various (un)sorting algorithms
|
||||
|
||||
def uniform(array):
|
||||
size = array.getsize()
|
||||
array.setdata([(size+1)//2] * size)
|
||||
array.reset("Uniform data, size %d" % size)
|
||||
|
||||
def distinct(array):
|
||||
size = array.getsize()
|
||||
array.setdata(range(1, size+1))
|
||||
array.reset("Distinct data, size %d" % size)
|
||||
|
||||
def randomize(array):
|
||||
array.reset("Randomizing")
|
||||
n = array.getsize()
|
||||
for i in range(n):
|
||||
j = random.randint(0, n-1)
|
||||
array.swap(i, j)
|
||||
array.message("Randomized")
|
||||
|
||||
def insertionsort(array):
|
||||
size = array.getsize()
|
||||
array.reset("Insertion sort")
|
||||
for i in range(1, size):
|
||||
j = i-1
|
||||
while j >= 0:
|
||||
if array.compare(j, j+1) <= 0:
|
||||
break
|
||||
array.swap(j, j+1)
|
||||
j = j-1
|
||||
array.message("Sorted")
|
||||
|
||||
def selectionsort(array):
|
||||
size = array.getsize()
|
||||
array.reset("Selection sort")
|
||||
try:
|
||||
for i in range(size):
|
||||
array.show_partition(i, size)
|
||||
for j in range(i+1, size):
|
||||
if array.compare(i, j) > 0:
|
||||
array.swap(i, j)
|
||||
array.message("Sorted")
|
||||
finally:
|
||||
array.hide_partition()
|
||||
|
||||
def bubblesort(array):
|
||||
size = array.getsize()
|
||||
array.reset("Bubble sort")
|
||||
for i in range(size):
|
||||
for j in range(1, size):
|
||||
if array.compare(j-1, j) > 0:
|
||||
array.swap(j-1, j)
|
||||
array.message("Sorted")
|
||||
|
||||
def quicksort(array):
|
||||
size = array.getsize()
|
||||
array.reset("Quicksort")
|
||||
try:
|
||||
stack = [(0, size)]
|
||||
while stack:
|
||||
first, last = stack[-1]
|
||||
del stack[-1]
|
||||
array.show_partition(first, last)
|
||||
if last-first < 5:
|
||||
array.message("Insertion sort")
|
||||
for i in range(first+1, last):
|
||||
j = i-1
|
||||
while j >= first:
|
||||
if array.compare(j, j+1) <= 0:
|
||||
break
|
||||
array.swap(j, j+1)
|
||||
j = j-1
|
||||
continue
|
||||
array.message("Choosing pivot")
|
||||
j, i, k = first, (first+last) // 2, last-1
|
||||
if array.compare(k, i) < 0:
|
||||
array.swap(k, i)
|
||||
if array.compare(k, j) < 0:
|
||||
array.swap(k, j)
|
||||
if array.compare(j, i) < 0:
|
||||
array.swap(j, i)
|
||||
pivot = j
|
||||
array.show_pivot(pivot)
|
||||
array.message("Pivot at left of partition")
|
||||
array.wait(1000)
|
||||
left = first
|
||||
right = last
|
||||
while 1:
|
||||
array.message("Sweep right pointer")
|
||||
right = right-1
|
||||
array.show_right(right)
|
||||
while right > first and array.compare(right, pivot) >= 0:
|
||||
right = right-1
|
||||
array.show_right(right)
|
||||
array.message("Sweep left pointer")
|
||||
left = left+1
|
||||
array.show_left(left)
|
||||
while left < last and array.compare(left, pivot) <= 0:
|
||||
left = left+1
|
||||
array.show_left(left)
|
||||
if left > right:
|
||||
array.message("End of partition")
|
||||
break
|
||||
array.message("Swap items")
|
||||
array.swap(left, right)
|
||||
array.message("Swap pivot back")
|
||||
array.swap(pivot, right)
|
||||
n1 = right-first
|
||||
n2 = last-left
|
||||
if n1 > 1: stack.append((first, right))
|
||||
if n2 > 1: stack.append((left, last))
|
||||
array.message("Sorted")
|
||||
finally:
|
||||
array.hide_partition()
|
||||
|
||||
def demosort(array):
|
||||
while 1:
|
||||
for alg in [quicksort, insertionsort, selectionsort, bubblesort]:
|
||||
randomize(array)
|
||||
alg(array)
|
||||
|
||||
|
||||
# Sort demo class -- usable as a Grail applet
|
||||
|
||||
class SortDemo:
|
||||
|
||||
def __init__(self, master, size=15):
|
||||
self.master = master
|
||||
self.size = size
|
||||
self.busy = 0
|
||||
self.array = Array(self.master)
|
||||
|
||||
self.botframe = Frame(master)
|
||||
self.botframe.pack(side=BOTTOM)
|
||||
self.botleftframe = Frame(self.botframe)
|
||||
self.botleftframe.pack(side=LEFT, fill=Y)
|
||||
self.botrightframe = Frame(self.botframe)
|
||||
self.botrightframe.pack(side=RIGHT, fill=Y)
|
||||
|
||||
self.b_qsort = Button(self.botleftframe,
|
||||
text="Quicksort", command=self.c_qsort)
|
||||
self.b_qsort.pack(fill=X)
|
||||
self.b_isort = Button(self.botleftframe,
|
||||
text="Insertion sort", command=self.c_isort)
|
||||
self.b_isort.pack(fill=X)
|
||||
self.b_ssort = Button(self.botleftframe,
|
||||
text="Selection sort", command=self.c_ssort)
|
||||
self.b_ssort.pack(fill=X)
|
||||
self.b_bsort = Button(self.botleftframe,
|
||||
text="Bubble sort", command=self.c_bsort)
|
||||
self.b_bsort.pack(fill=X)
|
||||
|
||||
# Terrible hack to overcome limitation of OptionMenu...
|
||||
class MyIntVar(IntVar):
|
||||
def __init__(self, master, demo):
|
||||
self.demo = demo
|
||||
IntVar.__init__(self, master)
|
||||
def set(self, value):
|
||||
IntVar.set(self, value)
|
||||
if str(value) != '0':
|
||||
self.demo.resize(value)
|
||||
|
||||
self.v_size = MyIntVar(self.master, self)
|
||||
self.v_size.set(size)
|
||||
sizes = [1, 2, 3, 4] + list(range(5, 55, 5))
|
||||
if self.size not in sizes:
|
||||
sizes.append(self.size)
|
||||
sizes.sort()
|
||||
self.m_size = OptionMenu(self.botleftframe, self.v_size, *sizes)
|
||||
self.m_size.pack(fill=X)
|
||||
|
||||
self.v_speed = StringVar(self.master)
|
||||
self.v_speed.set("normal")
|
||||
self.m_speed = OptionMenu(self.botleftframe, self.v_speed,
|
||||
"single-step", "normal", "fast", "fastest")
|
||||
self.m_speed.pack(fill=X)
|
||||
|
||||
self.b_step = Button(self.botleftframe,
|
||||
text="Step", command=self.c_step)
|
||||
self.b_step.pack(fill=X)
|
||||
|
||||
self.b_randomize = Button(self.botrightframe,
|
||||
text="Randomize", command=self.c_randomize)
|
||||
self.b_randomize.pack(fill=X)
|
||||
self.b_uniform = Button(self.botrightframe,
|
||||
text="Uniform", command=self.c_uniform)
|
||||
self.b_uniform.pack(fill=X)
|
||||
self.b_distinct = Button(self.botrightframe,
|
||||
text="Distinct", command=self.c_distinct)
|
||||
self.b_distinct.pack(fill=X)
|
||||
self.b_demo = Button(self.botrightframe,
|
||||
text="Demo", command=self.c_demo)
|
||||
self.b_demo.pack(fill=X)
|
||||
self.b_cancel = Button(self.botrightframe,
|
||||
text="Cancel", command=self.c_cancel)
|
||||
self.b_cancel.pack(fill=X)
|
||||
self.b_cancel.config(state=DISABLED)
|
||||
self.b_quit = Button(self.botrightframe,
|
||||
text="Quit", command=self.c_quit)
|
||||
self.b_quit.pack(fill=X)
|
||||
|
||||
def resize(self, newsize):
|
||||
if self.busy:
|
||||
self.master.bell()
|
||||
return
|
||||
self.size = newsize
|
||||
self.array.setdata(range(1, self.size+1))
|
||||
|
||||
def c_qsort(self):
|
||||
self.run(quicksort)
|
||||
|
||||
def c_isort(self):
|
||||
self.run(insertionsort)
|
||||
|
||||
def c_ssort(self):
|
||||
self.run(selectionsort)
|
||||
|
||||
def c_bsort(self):
|
||||
self.run(bubblesort)
|
||||
|
||||
def c_demo(self):
|
||||
self.run(demosort)
|
||||
|
||||
def c_randomize(self):
|
||||
self.run(randomize)
|
||||
|
||||
def c_uniform(self):
|
||||
self.run(uniform)
|
||||
|
||||
def c_distinct(self):
|
||||
self.run(distinct)
|
||||
|
||||
def run(self, func):
|
||||
if self.busy:
|
||||
self.master.bell()
|
||||
return
|
||||
self.busy = 1
|
||||
self.array.setspeed(self.v_speed.get())
|
||||
self.b_cancel.config(state=NORMAL)
|
||||
try:
|
||||
func(self.array)
|
||||
except Array.Cancelled:
|
||||
pass
|
||||
self.b_cancel.config(state=DISABLED)
|
||||
self.busy = 0
|
||||
|
||||
def c_cancel(self):
|
||||
if not self.busy:
|
||||
self.master.bell()
|
||||
return
|
||||
self.array.cancel()
|
||||
|
||||
def c_step(self):
|
||||
if not self.busy:
|
||||
self.master.bell()
|
||||
return
|
||||
self.v_speed.set("single-step")
|
||||
self.array.setspeed("single-step")
|
||||
self.array.step()
|
||||
|
||||
def c_quit(self):
|
||||
if self.busy:
|
||||
self.array.cancel()
|
||||
self.master.after_idle(self.master.quit)
|
||||
|
||||
|
||||
# Main program -- for stand-alone operation outside Grail
|
||||
|
||||
def main():
|
||||
root = Tk()
|
||||
demo = SortDemo(root)
|
||||
root.protocol('WM_DELETE_WINDOW', demo.c_quit)
|
||||
root.mainloop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
829
third_party/python/Tools/demo/ss1.py
vendored
829
third_party/python/Tools/demo/ss1.py
vendored
|
@ -1,829 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
SS1 -- a spreadsheet-like application.
|
||||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
from xml.parsers import expat
|
||||
from xml.sax.saxutils import escape
|
||||
|
||||
LEFT, CENTER, RIGHT = "LEFT", "CENTER", "RIGHT"
|
||||
|
||||
def ljust(x, n):
|
||||
return x.ljust(n)
|
||||
def center(x, n):
|
||||
return x.center(n)
|
||||
def rjust(x, n):
|
||||
return x.rjust(n)
|
||||
align2action = {LEFT: ljust, CENTER: center, RIGHT: rjust}
|
||||
|
||||
align2xml = {LEFT: "left", CENTER: "center", RIGHT: "right"}
|
||||
xml2align = {"left": LEFT, "center": CENTER, "right": RIGHT}
|
||||
|
||||
align2anchor = {LEFT: "w", CENTER: "center", RIGHT: "e"}
|
||||
|
||||
def sum(seq):
|
||||
total = 0
|
||||
for x in seq:
|
||||
if x is not None:
|
||||
total += x
|
||||
return total
|
||||
|
||||
class Sheet:
|
||||
|
||||
def __init__(self):
|
||||
self.cells = {} # {(x, y): cell, ...}
|
||||
self.ns = dict(
|
||||
cell = self.cellvalue,
|
||||
cells = self.multicellvalue,
|
||||
sum = sum,
|
||||
)
|
||||
|
||||
def cellvalue(self, x, y):
|
||||
cell = self.getcell(x, y)
|
||||
if hasattr(cell, 'recalc'):
|
||||
return cell.recalc(self.ns)
|
||||
else:
|
||||
return cell
|
||||
|
||||
def multicellvalue(self, x1, y1, x2, y2):
|
||||
if x1 > x2:
|
||||
x1, x2 = x2, x1
|
||||
if y1 > y2:
|
||||
y1, y2 = y2, y1
|
||||
seq = []
|
||||
for y in range(y1, y2+1):
|
||||
for x in range(x1, x2+1):
|
||||
seq.append(self.cellvalue(x, y))
|
||||
return seq
|
||||
|
||||
def getcell(self, x, y):
|
||||
return self.cells.get((x, y))
|
||||
|
||||
def setcell(self, x, y, cell):
|
||||
assert x > 0 and y > 0
|
||||
assert isinstance(cell, BaseCell)
|
||||
self.cells[x, y] = cell
|
||||
|
||||
def clearcell(self, x, y):
|
||||
try:
|
||||
del self.cells[x, y]
|
||||
except KeyError:
|
||||
pass
|
||||
|
||||
def clearcells(self, x1, y1, x2, y2):
|
||||
for xy in self.selectcells(x1, y1, x2, y2):
|
||||
del self.cells[xy]
|
||||
|
||||
def clearrows(self, y1, y2):
|
||||
self.clearcells(0, y1, sys.maxsize, y2)
|
||||
|
||||
def clearcolumns(self, x1, x2):
|
||||
self.clearcells(x1, 0, x2, sys.maxsize)
|
||||
|
||||
def selectcells(self, x1, y1, x2, y2):
|
||||
if x1 > x2:
|
||||
x1, x2 = x2, x1
|
||||
if y1 > y2:
|
||||
y1, y2 = y2, y1
|
||||
return [(x, y) for x, y in self.cells
|
||||
if x1 <= x <= x2 and y1 <= y <= y2]
|
||||
|
||||
def movecells(self, x1, y1, x2, y2, dx, dy):
|
||||
if dx == 0 and dy == 0:
|
||||
return
|
||||
if x1 > x2:
|
||||
x1, x2 = x2, x1
|
||||
if y1 > y2:
|
||||
y1, y2 = y2, y1
|
||||
assert x1+dx > 0 and y1+dy > 0
|
||||
new = {}
|
||||
for x, y in self.cells:
|
||||
cell = self.cells[x, y]
|
||||
if hasattr(cell, 'renumber'):
|
||||
cell = cell.renumber(x1, y1, x2, y2, dx, dy)
|
||||
if x1 <= x <= x2 and y1 <= y <= y2:
|
||||
x += dx
|
||||
y += dy
|
||||
new[x, y] = cell
|
||||
self.cells = new
|
||||
|
||||
def insertrows(self, y, n):
|
||||
assert n > 0
|
||||
self.movecells(0, y, sys.maxsize, sys.maxsize, 0, n)
|
||||
|
||||
def deleterows(self, y1, y2):
|
||||
if y1 > y2:
|
||||
y1, y2 = y2, y1
|
||||
self.clearrows(y1, y2)
|
||||
self.movecells(0, y2+1, sys.maxsize, sys.maxsize, 0, y1-y2-1)
|
||||
|
||||
def insertcolumns(self, x, n):
|
||||
assert n > 0
|
||||
self.movecells(x, 0, sys.maxsize, sys.maxsize, n, 0)
|
||||
|
||||
def deletecolumns(self, x1, x2):
|
||||
if x1 > x2:
|
||||
x1, x2 = x2, x1
|
||||
self.clearcells(x1, x2)
|
||||
self.movecells(x2+1, 0, sys.maxsize, sys.maxsize, x1-x2-1, 0)
|
||||
|
||||
def getsize(self):
|
||||
maxx = maxy = 0
|
||||
for x, y in self.cells:
|
||||
maxx = max(maxx, x)
|
||||
maxy = max(maxy, y)
|
||||
return maxx, maxy
|
||||
|
||||
def reset(self):
|
||||
for cell in self.cells.values():
|
||||
if hasattr(cell, 'reset'):
|
||||
cell.reset()
|
||||
|
||||
def recalc(self):
|
||||
self.reset()
|
||||
for cell in self.cells.values():
|
||||
if hasattr(cell, 'recalc'):
|
||||
cell.recalc(self.ns)
|
||||
|
||||
def display(self):
|
||||
maxx, maxy = self.getsize()
|
||||
width, height = maxx+1, maxy+1
|
||||
colwidth = [1] * width
|
||||
full = {}
|
||||
# Add column heading labels in row 0
|
||||
for x in range(1, width):
|
||||
full[x, 0] = text, alignment = colnum2name(x), RIGHT
|
||||
colwidth[x] = max(colwidth[x], len(text))
|
||||
# Add row labels in column 0
|
||||
for y in range(1, height):
|
||||
full[0, y] = text, alignment = str(y), RIGHT
|
||||
colwidth[0] = max(colwidth[0], len(text))
|
||||
# Add sheet cells in columns with x>0 and y>0
|
||||
for (x, y), cell in self.cells.items():
|
||||
if x <= 0 or y <= 0:
|
||||
continue
|
||||
if hasattr(cell, 'recalc'):
|
||||
cell.recalc(self.ns)
|
||||
if hasattr(cell, 'format'):
|
||||
text, alignment = cell.format()
|
||||
assert isinstance(text, str)
|
||||
assert alignment in (LEFT, CENTER, RIGHT)
|
||||
else:
|
||||
text = str(cell)
|
||||
if isinstance(cell, str):
|
||||
alignment = LEFT
|
||||
else:
|
||||
alignment = RIGHT
|
||||
full[x, y] = (text, alignment)
|
||||
colwidth[x] = max(colwidth[x], len(text))
|
||||
# Calculate the horizontal separator line (dashes and dots)
|
||||
sep = ""
|
||||
for x in range(width):
|
||||
if sep:
|
||||
sep += "+"
|
||||
sep += "-"*colwidth[x]
|
||||
# Now print The full grid
|
||||
for y in range(height):
|
||||
line = ""
|
||||
for x in range(width):
|
||||
text, alignment = full.get((x, y)) or ("", LEFT)
|
||||
text = align2action[alignment](text, colwidth[x])
|
||||
if line:
|
||||
line += '|'
|
||||
line += text
|
||||
print(line)
|
||||
if y == 0:
|
||||
print(sep)
|
||||
|
||||
def xml(self):
|
||||
out = ['<spreadsheet>']
|
||||
for (x, y), cell in self.cells.items():
|
||||
if hasattr(cell, 'xml'):
|
||||
cellxml = cell.xml()
|
||||
else:
|
||||
cellxml = '<value>%s</value>' % escape(cell)
|
||||
out.append('<cell row="%s" col="%s">\n %s\n</cell>' %
|
||||
(y, x, cellxml))
|
||||
out.append('</spreadsheet>')
|
||||
return '\n'.join(out)
|
||||
|
||||
def save(self, filename):
|
||||
text = self.xml()
|
||||
with open(filename, "w", encoding='utf-8') as f:
|
||||
f.write(text)
|
||||
if text and not text.endswith('\n'):
|
||||
f.write('\n')
|
||||
|
||||
def load(self, filename):
|
||||
with open(filename, 'rb') as f:
|
||||
SheetParser(self).parsefile(f)
|
||||
|
||||
class SheetParser:
|
||||
|
||||
def __init__(self, sheet):
|
||||
self.sheet = sheet
|
||||
|
||||
def parsefile(self, f):
|
||||
parser = expat.ParserCreate()
|
||||
parser.StartElementHandler = self.startelement
|
||||
parser.EndElementHandler = self.endelement
|
||||
parser.CharacterDataHandler = self.data
|
||||
parser.ParseFile(f)
|
||||
|
||||
def startelement(self, tag, attrs):
|
||||
method = getattr(self, 'start_'+tag, None)
|
||||
if method:
|
||||
method(attrs)
|
||||
self.texts = []
|
||||
|
||||
def data(self, text):
|
||||
self.texts.append(text)
|
||||
|
||||
def endelement(self, tag):
|
||||
method = getattr(self, 'end_'+tag, None)
|
||||
if method:
|
||||
method("".join(self.texts))
|
||||
|
||||
def start_cell(self, attrs):
|
||||
self.y = int(attrs.get("row"))
|
||||
self.x = int(attrs.get("col"))
|
||||
|
||||
def start_value(self, attrs):
|
||||
self.fmt = attrs.get('format')
|
||||
self.alignment = xml2align.get(attrs.get('align'))
|
||||
|
||||
start_formula = start_value
|
||||
|
||||
def end_int(self, text):
|
||||
try:
|
||||
self.value = int(text)
|
||||
except (TypeError, ValueError):
|
||||
self.value = None
|
||||
|
||||
end_long = end_int
|
||||
|
||||
def end_double(self, text):
|
||||
try:
|
||||
self.value = float(text)
|
||||
except (TypeError, ValueError):
|
||||
self.value = None
|
||||
|
||||
def end_complex(self, text):
|
||||
try:
|
||||
self.value = complex(text)
|
||||
except (TypeError, ValueError):
|
||||
self.value = None
|
||||
|
||||
def end_string(self, text):
|
||||
self.value = text
|
||||
|
||||
def end_value(self, text):
|
||||
if isinstance(self.value, BaseCell):
|
||||
self.cell = self.value
|
||||
elif isinstance(self.value, str):
|
||||
self.cell = StringCell(self.value,
|
||||
self.fmt or "%s",
|
||||
self.alignment or LEFT)
|
||||
else:
|
||||
self.cell = NumericCell(self.value,
|
||||
self.fmt or "%s",
|
||||
self.alignment or RIGHT)
|
||||
|
||||
def end_formula(self, text):
|
||||
self.cell = FormulaCell(text,
|
||||
self.fmt or "%s",
|
||||
self.alignment or RIGHT)
|
||||
|
||||
def end_cell(self, text):
|
||||
self.sheet.setcell(self.x, self.y, self.cell)
|
||||
|
||||
class BaseCell:
|
||||
__init__ = None # Must provide
|
||||
"""Abstract base class for sheet cells.
|
||||
|
||||
Subclasses may but needn't provide the following APIs:
|
||||
|
||||
cell.reset() -- prepare for recalculation
|
||||
cell.recalc(ns) -> value -- recalculate formula
|
||||
cell.format() -> (value, alignment) -- return formatted value
|
||||
cell.xml() -> string -- return XML
|
||||
"""
|
||||
|
||||
class NumericCell(BaseCell):
|
||||
|
||||
def __init__(self, value, fmt="%s", alignment=RIGHT):
|
||||
assert isinstance(value, (int, float, complex))
|
||||
assert alignment in (LEFT, CENTER, RIGHT)
|
||||
self.value = value
|
||||
self.fmt = fmt
|
||||
self.alignment = alignment
|
||||
|
||||
def recalc(self, ns):
|
||||
return self.value
|
||||
|
||||
def format(self):
|
||||
try:
|
||||
text = self.fmt % self.value
|
||||
except:
|
||||
text = str(self.value)
|
||||
return text, self.alignment
|
||||
|
||||
def xml(self):
|
||||
method = getattr(self, '_xml_' + type(self.value).__name__)
|
||||
return '<value align="%s" format="%s">%s</value>' % (
|
||||
align2xml[self.alignment],
|
||||
self.fmt,
|
||||
method())
|
||||
|
||||
def _xml_int(self):
|
||||
if -2**31 <= self.value < 2**31:
|
||||
return '<int>%s</int>' % self.value
|
||||
else:
|
||||
return '<long>%s</long>' % self.value
|
||||
|
||||
def _xml_float(self):
|
||||
return '<double>%r</double>' % self.value
|
||||
|
||||
def _xml_complex(self):
|
||||
return '<complex>%r</complex>' % self.value
|
||||
|
||||
class StringCell(BaseCell):
|
||||
|
||||
def __init__(self, text, fmt="%s", alignment=LEFT):
|
||||
assert isinstance(text, str)
|
||||
assert alignment in (LEFT, CENTER, RIGHT)
|
||||
self.text = text
|
||||
self.fmt = fmt
|
||||
self.alignment = alignment
|
||||
|
||||
def recalc(self, ns):
|
||||
return self.text
|
||||
|
||||
def format(self):
|
||||
return self.text, self.alignment
|
||||
|
||||
def xml(self):
|
||||
s = '<value align="%s" format="%s"><string>%s</string></value>'
|
||||
return s % (
|
||||
align2xml[self.alignment],
|
||||
self.fmt,
|
||||
escape(self.text))
|
||||
|
||||
class FormulaCell(BaseCell):
|
||||
|
||||
def __init__(self, formula, fmt="%s", alignment=RIGHT):
|
||||
assert alignment in (LEFT, CENTER, RIGHT)
|
||||
self.formula = formula
|
||||
self.translated = translate(self.formula)
|
||||
self.fmt = fmt
|
||||
self.alignment = alignment
|
||||
self.reset()
|
||||
|
||||
def reset(self):
|
||||
self.value = None
|
||||
|
||||
def recalc(self, ns):
|
||||
if self.value is None:
|
||||
try:
|
||||
self.value = eval(self.translated, ns)
|
||||
except:
|
||||
exc = sys.exc_info()[0]
|
||||
if hasattr(exc, "__name__"):
|
||||
self.value = exc.__name__
|
||||
else:
|
||||
self.value = str(exc)
|
||||
return self.value
|
||||
|
||||
def format(self):
|
||||
try:
|
||||
text = self.fmt % self.value
|
||||
except:
|
||||
text = str(self.value)
|
||||
return text, self.alignment
|
||||
|
||||
def xml(self):
|
||||
return '<formula align="%s" format="%s">%s</formula>' % (
|
||||
align2xml[self.alignment],
|
||||
self.fmt,
|
||||
escape(self.formula))
|
||||
|
||||
def renumber(self, x1, y1, x2, y2, dx, dy):
|
||||
out = []
|
||||
for part in re.split(r'(\w+)', self.formula):
|
||||
m = re.match('^([A-Z]+)([1-9][0-9]*)$', part)
|
||||
if m is not None:
|
||||
sx, sy = m.groups()
|
||||
x = colname2num(sx)
|
||||
y = int(sy)
|
||||
if x1 <= x <= x2 and y1 <= y <= y2:
|
||||
part = cellname(x+dx, y+dy)
|
||||
out.append(part)
|
||||
return FormulaCell("".join(out), self.fmt, self.alignment)
|
||||
|
||||
def translate(formula):
|
||||
"""Translate a formula containing fancy cell names to valid Python code.
|
||||
|
||||
Examples:
|
||||
B4 -> cell(2, 4)
|
||||
B4:Z100 -> cells(2, 4, 26, 100)
|
||||
"""
|
||||
out = []
|
||||
for part in re.split(r"(\w+(?::\w+)?)", formula):
|
||||
m = re.match(r"^([A-Z]+)([1-9][0-9]*)(?::([A-Z]+)([1-9][0-9]*))?$", part)
|
||||
if m is None:
|
||||
out.append(part)
|
||||
else:
|
||||
x1, y1, x2, y2 = m.groups()
|
||||
x1 = colname2num(x1)
|
||||
if x2 is None:
|
||||
s = "cell(%s, %s)" % (x1, y1)
|
||||
else:
|
||||
x2 = colname2num(x2)
|
||||
s = "cells(%s, %s, %s, %s)" % (x1, y1, x2, y2)
|
||||
out.append(s)
|
||||
return "".join(out)
|
||||
|
||||
def cellname(x, y):
|
||||
"Translate a cell coordinate to a fancy cell name (e.g. (1, 1)->'A1')."
|
||||
assert x > 0 # Column 0 has an empty name, so can't use that
|
||||
return colnum2name(x) + str(y)
|
||||
|
||||
def colname2num(s):
|
||||
"Translate a column name to number (e.g. 'A'->1, 'Z'->26, 'AA'->27)."
|
||||
s = s.upper()
|
||||
n = 0
|
||||
for c in s:
|
||||
assert 'A' <= c <= 'Z'
|
||||
n = n*26 + ord(c) - ord('A') + 1
|
||||
return n
|
||||
|
||||
def colnum2name(n):
|
||||
"Translate a column number to name (e.g. 1->'A', etc.)."
|
||||
assert n > 0
|
||||
s = ""
|
||||
while n:
|
||||
n, m = divmod(n-1, 26)
|
||||
s = chr(m+ord('A')) + s
|
||||
return s
|
||||
|
||||
import tkinter as Tk
|
||||
|
||||
class SheetGUI:
|
||||
|
||||
"""Beginnings of a GUI for a spreadsheet.
|
||||
|
||||
TO DO:
|
||||
- clear multiple cells
|
||||
- Insert, clear, remove rows or columns
|
||||
- Show new contents while typing
|
||||
- Scroll bars
|
||||
- Grow grid when window is grown
|
||||
- Proper menus
|
||||
- Undo, redo
|
||||
- Cut, copy and paste
|
||||
- Formatting and alignment
|
||||
"""
|
||||
|
||||
def __init__(self, filename="sheet1.xml", rows=10, columns=5):
|
||||
"""Constructor.
|
||||
|
||||
Load the sheet from the filename argument.
|
||||
Set up the Tk widget tree.
|
||||
"""
|
||||
# Create and load the sheet
|
||||
self.filename = filename
|
||||
self.sheet = Sheet()
|
||||
if os.path.isfile(filename):
|
||||
self.sheet.load(filename)
|
||||
# Calculate the needed grid size
|
||||
maxx, maxy = self.sheet.getsize()
|
||||
rows = max(rows, maxy)
|
||||
columns = max(columns, maxx)
|
||||
# Create the widgets
|
||||
self.root = Tk.Tk()
|
||||
self.root.wm_title("Spreadsheet: %s" % self.filename)
|
||||
self.beacon = Tk.Label(self.root, text="A1",
|
||||
font=('helvetica', 16, 'bold'))
|
||||
self.entry = Tk.Entry(self.root)
|
||||
self.savebutton = Tk.Button(self.root, text="Save",
|
||||
command=self.save)
|
||||
self.cellgrid = Tk.Frame(self.root)
|
||||
# Configure the widget lay-out
|
||||
self.cellgrid.pack(side="bottom", expand=1, fill="both")
|
||||
self.beacon.pack(side="left")
|
||||
self.savebutton.pack(side="right")
|
||||
self.entry.pack(side="left", expand=1, fill="x")
|
||||
# Bind some events
|
||||
self.entry.bind("<Return>", self.return_event)
|
||||
self.entry.bind("<Shift-Return>", self.shift_return_event)
|
||||
self.entry.bind("<Tab>", self.tab_event)
|
||||
self.entry.bind("<Shift-Tab>", self.shift_tab_event)
|
||||
self.entry.bind("<Delete>", self.delete_event)
|
||||
self.entry.bind("<Escape>", self.escape_event)
|
||||
# Now create the cell grid
|
||||
self.makegrid(rows, columns)
|
||||
# Select the top-left cell
|
||||
self.currentxy = None
|
||||
self.cornerxy = None
|
||||
self.setcurrent(1, 1)
|
||||
# Copy the sheet cells to the GUI cells
|
||||
self.sync()
|
||||
|
||||
def delete_event(self, event):
|
||||
if self.cornerxy != self.currentxy and self.cornerxy is not None:
|
||||
self.sheet.clearcells(*(self.currentxy + self.cornerxy))
|
||||
else:
|
||||
self.sheet.clearcell(*self.currentxy)
|
||||
self.sync()
|
||||
self.entry.delete(0, 'end')
|
||||
return "break"
|
||||
|
||||
def escape_event(self, event):
|
||||
x, y = self.currentxy
|
||||
self.load_entry(x, y)
|
||||
|
||||
def load_entry(self, x, y):
|
||||
cell = self.sheet.getcell(x, y)
|
||||
if cell is None:
|
||||
text = ""
|
||||
elif isinstance(cell, FormulaCell):
|
||||
text = '=' + cell.formula
|
||||
else:
|
||||
text, alignment = cell.format()
|
||||
self.entry.delete(0, 'end')
|
||||
self.entry.insert(0, text)
|
||||
self.entry.selection_range(0, 'end')
|
||||
|
||||
def makegrid(self, rows, columns):
|
||||
"""Helper to create the grid of GUI cells.
|
||||
|
||||
The edge (x==0 or y==0) is filled with labels; the rest is real cells.
|
||||
"""
|
||||
self.rows = rows
|
||||
self.columns = columns
|
||||
self.gridcells = {}
|
||||
# Create the top left corner cell (which selects all)
|
||||
cell = Tk.Label(self.cellgrid, relief='raised')
|
||||
cell.grid_configure(column=0, row=0, sticky='NSWE')
|
||||
cell.bind("<ButtonPress-1>", self.selectall)
|
||||
# Create the top row of labels, and configure the grid columns
|
||||
for x in range(1, columns+1):
|
||||
self.cellgrid.grid_columnconfigure(x, minsize=64)
|
||||
cell = Tk.Label(self.cellgrid, text=colnum2name(x), relief='raised')
|
||||
cell.grid_configure(column=x, row=0, sticky='WE')
|
||||
self.gridcells[x, 0] = cell
|
||||
cell.__x = x
|
||||
cell.__y = 0
|
||||
cell.bind("<ButtonPress-1>", self.selectcolumn)
|
||||
cell.bind("<B1-Motion>", self.extendcolumn)
|
||||
cell.bind("<ButtonRelease-1>", self.extendcolumn)
|
||||
cell.bind("<Shift-Button-1>", self.extendcolumn)
|
||||
# Create the leftmost column of labels
|
||||
for y in range(1, rows+1):
|
||||
cell = Tk.Label(self.cellgrid, text=str(y), relief='raised')
|
||||
cell.grid_configure(column=0, row=y, sticky='WE')
|
||||
self.gridcells[0, y] = cell
|
||||
cell.__x = 0
|
||||
cell.__y = y
|
||||
cell.bind("<ButtonPress-1>", self.selectrow)
|
||||
cell.bind("<B1-Motion>", self.extendrow)
|
||||
cell.bind("<ButtonRelease-1>", self.extendrow)
|
||||
cell.bind("<Shift-Button-1>", self.extendrow)
|
||||
# Create the real cells
|
||||
for x in range(1, columns+1):
|
||||
for y in range(1, rows+1):
|
||||
cell = Tk.Label(self.cellgrid, relief='sunken',
|
||||
bg='white', fg='black')
|
||||
cell.grid_configure(column=x, row=y, sticky='NSWE')
|
||||
self.gridcells[x, y] = cell
|
||||
cell.__x = x
|
||||
cell.__y = y
|
||||
# Bind mouse events
|
||||
cell.bind("<ButtonPress-1>", self.press)
|
||||
cell.bind("<B1-Motion>", self.motion)
|
||||
cell.bind("<ButtonRelease-1>", self.release)
|
||||
cell.bind("<Shift-Button-1>", self.release)
|
||||
|
||||
def selectall(self, event):
|
||||
self.setcurrent(1, 1)
|
||||
self.setcorner(sys.maxsize, sys.maxsize)
|
||||
|
||||
def selectcolumn(self, event):
|
||||
x, y = self.whichxy(event)
|
||||
self.setcurrent(x, 1)
|
||||
self.setcorner(x, sys.maxsize)
|
||||
|
||||
def extendcolumn(self, event):
|
||||
x, y = self.whichxy(event)
|
||||
if x > 0:
|
||||
self.setcurrent(self.currentxy[0], 1)
|
||||
self.setcorner(x, sys.maxsize)
|
||||
|
||||
def selectrow(self, event):
|
||||
x, y = self.whichxy(event)
|
||||
self.setcurrent(1, y)
|
||||
self.setcorner(sys.maxsize, y)
|
||||
|
||||
def extendrow(self, event):
|
||||
x, y = self.whichxy(event)
|
||||
if y > 0:
|
||||
self.setcurrent(1, self.currentxy[1])
|
||||
self.setcorner(sys.maxsize, y)
|
||||
|
||||
def press(self, event):
|
||||
x, y = self.whichxy(event)
|
||||
if x > 0 and y > 0:
|
||||
self.setcurrent(x, y)
|
||||
|
||||
def motion(self, event):
|
||||
x, y = self.whichxy(event)
|
||||
if x > 0 and y > 0:
|
||||
self.setcorner(x, y)
|
||||
|
||||
release = motion
|
||||
|
||||
def whichxy(self, event):
|
||||
w = self.cellgrid.winfo_containing(event.x_root, event.y_root)
|
||||
if w is not None and isinstance(w, Tk.Label):
|
||||
try:
|
||||
return w.__x, w.__y
|
||||
except AttributeError:
|
||||
pass
|
||||
return 0, 0
|
||||
|
||||
def save(self):
|
||||
self.sheet.save(self.filename)
|
||||
|
||||
def setcurrent(self, x, y):
|
||||
"Make (x, y) the current cell."
|
||||
if self.currentxy is not None:
|
||||
self.change_cell()
|
||||
self.clearfocus()
|
||||
self.beacon['text'] = cellname(x, y)
|
||||
self.load_entry(x, y)
|
||||
self.entry.focus_set()
|
||||
self.currentxy = x, y
|
||||
self.cornerxy = None
|
||||
gridcell = self.gridcells.get(self.currentxy)
|
||||
if gridcell is not None:
|
||||
gridcell['bg'] = 'yellow'
|
||||
|
||||
def setcorner(self, x, y):
|
||||
if self.currentxy is None or self.currentxy == (x, y):
|
||||
self.setcurrent(x, y)
|
||||
return
|
||||
self.clearfocus()
|
||||
self.cornerxy = x, y
|
||||
x1, y1 = self.currentxy
|
||||
x2, y2 = self.cornerxy or self.currentxy
|
||||
if x1 > x2:
|
||||
x1, x2 = x2, x1
|
||||
if y1 > y2:
|
||||
y1, y2 = y2, y1
|
||||
for (x, y), cell in self.gridcells.items():
|
||||
if x1 <= x <= x2 and y1 <= y <= y2:
|
||||
cell['bg'] = 'lightBlue'
|
||||
gridcell = self.gridcells.get(self.currentxy)
|
||||
if gridcell is not None:
|
||||
gridcell['bg'] = 'yellow'
|
||||
self.setbeacon(x1, y1, x2, y2)
|
||||
|
||||
def setbeacon(self, x1, y1, x2, y2):
|
||||
if x1 == y1 == 1 and x2 == y2 == sys.maxsize:
|
||||
name = ":"
|
||||
elif (x1, x2) == (1, sys.maxsize):
|
||||
if y1 == y2:
|
||||
name = "%d" % y1
|
||||
else:
|
||||
name = "%d:%d" % (y1, y2)
|
||||
elif (y1, y2) == (1, sys.maxsize):
|
||||
if x1 == x2:
|
||||
name = "%s" % colnum2name(x1)
|
||||
else:
|
||||
name = "%s:%s" % (colnum2name(x1), colnum2name(x2))
|
||||
else:
|
||||
name1 = cellname(*self.currentxy)
|
||||
name2 = cellname(*self.cornerxy)
|
||||
name = "%s:%s" % (name1, name2)
|
||||
self.beacon['text'] = name
|
||||
|
||||
|
||||
def clearfocus(self):
|
||||
if self.currentxy is not None:
|
||||
x1, y1 = self.currentxy
|
||||
x2, y2 = self.cornerxy or self.currentxy
|
||||
if x1 > x2:
|
||||
x1, x2 = x2, x1
|
||||
if y1 > y2:
|
||||
y1, y2 = y2, y1
|
||||
for (x, y), cell in self.gridcells.items():
|
||||
if x1 <= x <= x2 and y1 <= y <= y2:
|
||||
cell['bg'] = 'white'
|
||||
|
||||
def return_event(self, event):
|
||||
"Callback for the Return key."
|
||||
self.change_cell()
|
||||
x, y = self.currentxy
|
||||
self.setcurrent(x, y+1)
|
||||
return "break"
|
||||
|
||||
def shift_return_event(self, event):
|
||||
"Callback for the Return key with Shift modifier."
|
||||
self.change_cell()
|
||||
x, y = self.currentxy
|
||||
self.setcurrent(x, max(1, y-1))
|
||||
return "break"
|
||||
|
||||
def tab_event(self, event):
|
||||
"Callback for the Tab key."
|
||||
self.change_cell()
|
||||
x, y = self.currentxy
|
||||
self.setcurrent(x+1, y)
|
||||
return "break"
|
||||
|
||||
def shift_tab_event(self, event):
|
||||
"Callback for the Tab key with Shift modifier."
|
||||
self.change_cell()
|
||||
x, y = self.currentxy
|
||||
self.setcurrent(max(1, x-1), y)
|
||||
return "break"
|
||||
|
||||
def change_cell(self):
|
||||
"Set the current cell from the entry widget."
|
||||
x, y = self.currentxy
|
||||
text = self.entry.get()
|
||||
cell = None
|
||||
if text.startswith('='):
|
||||
cell = FormulaCell(text[1:])
|
||||
else:
|
||||
for cls in int, float, complex:
|
||||
try:
|
||||
value = cls(text)
|
||||
except (TypeError, ValueError):
|
||||
continue
|
||||
else:
|
||||
cell = NumericCell(value)
|
||||
break
|
||||
if cell is None and text:
|
||||
cell = StringCell(text)
|
||||
if cell is None:
|
||||
self.sheet.clearcell(x, y)
|
||||
else:
|
||||
self.sheet.setcell(x, y, cell)
|
||||
self.sync()
|
||||
|
||||
def sync(self):
|
||||
"Fill the GUI cells from the sheet cells."
|
||||
self.sheet.recalc()
|
||||
for (x, y), gridcell in self.gridcells.items():
|
||||
if x == 0 or y == 0:
|
||||
continue
|
||||
cell = self.sheet.getcell(x, y)
|
||||
if cell is None:
|
||||
gridcell['text'] = ""
|
||||
else:
|
||||
if hasattr(cell, 'format'):
|
||||
text, alignment = cell.format()
|
||||
else:
|
||||
text, alignment = str(cell), LEFT
|
||||
gridcell['text'] = text
|
||||
gridcell['anchor'] = align2anchor[alignment]
|
||||
|
||||
|
||||
def test_basic():
|
||||
"Basic non-gui self-test."
|
||||
a = Sheet()
|
||||
for x in range(1, 11):
|
||||
for y in range(1, 11):
|
||||
if x == 1:
|
||||
cell = NumericCell(y)
|
||||
elif y == 1:
|
||||
cell = NumericCell(x)
|
||||
else:
|
||||
c1 = cellname(x, 1)
|
||||
c2 = cellname(1, y)
|
||||
formula = "%s*%s" % (c1, c2)
|
||||
cell = FormulaCell(formula)
|
||||
a.setcell(x, y, cell)
|
||||
## if os.path.isfile("sheet1.xml"):
|
||||
## print "Loading from sheet1.xml"
|
||||
## a.load("sheet1.xml")
|
||||
a.display()
|
||||
a.save("sheet1.xml")
|
||||
|
||||
def test_gui():
|
||||
"GUI test."
|
||||
if sys.argv[1:]:
|
||||
filename = sys.argv[1]
|
||||
else:
|
||||
filename = "sheet1.xml"
|
||||
g = SheetGUI(filename)
|
||||
g.root.mainloop()
|
||||
|
||||
if __name__ == '__main__':
|
||||
#test_basic()
|
||||
test_gui()
|
|
@ -163,7 +163,7 @@ def write_extension_table(fname, modules):
|
|||
|
||||
|
||||
ext_src_header = """\
|
||||
#include "Python.h"
|
||||
#include "third_party/python/Include/Python.h"
|
||||
"""
|
||||
|
||||
ext_tab_header = """\
|
||||
|
|
|
@ -5,7 +5,7 @@ import bkfile
|
|||
# Write a file containing frozen code for the modules in the dictionary.
|
||||
|
||||
header = """
|
||||
#include "Python.h"
|
||||
#include "third_party/python/Include/Python.h"
|
||||
|
||||
static struct _frozen _PyImport_FrozenModules[] = {
|
||||
"""
|
||||
|
|
543
third_party/python/Tools/msi/README.txt
vendored
543
third_party/python/Tools/msi/README.txt
vendored
|
@ -1,543 +0,0 @@
|
|||
Quick Build Info
|
||||
================
|
||||
|
||||
For testing, the installer should be built with the Tools/msi/build.bat
|
||||
script:
|
||||
|
||||
build.bat [-x86] [-x64] [--doc]
|
||||
|
||||
For an official release, the installer should be built with the
|
||||
Tools/msi/buildrelease.bat script and environment variables:
|
||||
|
||||
set PYTHON=<path to Python 2.7 or 3.4>
|
||||
set SPHINXBUILD=<path to sphinx-build.exe>
|
||||
set PATH=<path to Mercurial (hg.exe)>;
|
||||
<path to HTML Help Compiler (hhc.exe)>;%PATH%
|
||||
|
||||
buildrelease.bat [-x86] [-x64] [-D] [-B]
|
||||
[-o <output directory>] [-c <certificate name>]
|
||||
|
||||
See the Building the Installer section for more information.
|
||||
|
||||
Overview
|
||||
========
|
||||
|
||||
Python is distributed on Windows as an installer that will configure the
|
||||
user's system. This allows users to have a functioning copy of Python
|
||||
without having to build it themselves.
|
||||
|
||||
The main tasks of the installer are:
|
||||
|
||||
* copy required files into the expected layout
|
||||
* configure system settings so the installation can be located by
|
||||
other programs
|
||||
* add entry points for modifying, repairing and uninstalling Python
|
||||
* make it easy to launch Python, its documentation, and IDLE
|
||||
|
||||
Each of these is discussed in a later section of this document.
|
||||
|
||||
Structure of the Installer
|
||||
==========================
|
||||
|
||||
The installer is structured as a 'layout', which consists of a number of
|
||||
CAB and MSI files and a single EXE.
|
||||
|
||||
The EXE is the main entry point into the installer. It contains the UI
|
||||
and command-line logic, as well as the ability to locate and optionally
|
||||
download other parts of the layout.
|
||||
|
||||
Each MSI contains the logic required to install a component or feature
|
||||
of Python. These MSIs should not be launched directly by users. MSIs can
|
||||
be embedded into the EXE or automatically downloaded as needed.
|
||||
|
||||
Each CAB contains the files making up a Python installation. CABs are
|
||||
embedded into their associated MSI and are never seen by users.
|
||||
|
||||
MSIs are only required when the related feature or component is being
|
||||
installed. When components are not selected for installation, the
|
||||
associated MSI is not downloaded. This allows the installer to offer
|
||||
options to install debugging symbols and binaries without increasing
|
||||
the initial download size by separating them into their own MSIs.
|
||||
|
||||
Building the Installer
|
||||
======================
|
||||
|
||||
Before building the installer, download extra build dependencies using
|
||||
Tools\msi\get_externals.bat. (Note that this is in addition to the
|
||||
similarly named file in PCBuild.)
|
||||
|
||||
One of the dependencies used in builds is WiX, a toolset that lets developers
|
||||
create installers for Windows Installer, the Windows installation engine. WiX
|
||||
has a dependency on the Microsoft .NET Framework Version 3.5 (which may not be
|
||||
configured on recent versions of Windows, such as Windows 10). If you are
|
||||
building on a recent Windows version, use the Control Panel (Programs | Programs
|
||||
and Features | Turn Windows Features on or off) and ensure that the entry
|
||||
".NET Framework 3.5 (includes .NET 2.0 and 3.0)" is enabled.
|
||||
|
||||
For testing, the installer should be built with the Tools/msi/build.bat
|
||||
script:
|
||||
|
||||
build.bat [-x86] [-x64] [--doc] [--test-marker] [--pack]
|
||||
|
||||
This script will build the required configurations of Python and
|
||||
generate an installer layout in PCBuild/(win32|amd64)/en-us.
|
||||
|
||||
Specify -x86 and/or -x64 to build for each platform. If neither is
|
||||
specified, both platforms will be built. Currently, both the debug and
|
||||
release versions of Python are required for the installer.
|
||||
|
||||
Specify --doc to build the documentation (.chm) file. If the file is not
|
||||
available, it will simply be excluded from the installer. Ensure
|
||||
%PYTHON% and %SPHINXBUILD% are set when passing this option. You may
|
||||
also set %HTMLHELP% to the Html Help Compiler (hhc.exe), or put HHC on
|
||||
your PATH or in externals/.
|
||||
|
||||
Specify --test-marker to build an installer that works side-by-side with
|
||||
an official Python release. All registry keys and install locations will
|
||||
include an extra marker to avoid overwriting files. This marker is
|
||||
currently an 'x' prefix, but may change at any time.
|
||||
|
||||
Specify --pack to build an installer that does not require all MSIs to
|
||||
be available alongside. This takes longer, but is easier to share.
|
||||
|
||||
|
||||
For an official release, the installer should be built with the
|
||||
Tools/msi/buildrelease.bat script:
|
||||
|
||||
set PYTHON=<path to Python 2.7 or 3.4>
|
||||
set SPHINXBUILD=<path to sphinx-build.exe>
|
||||
set PATH=<path to Mercurial (hg.exe)>;
|
||||
<path to HTML Help Compiler (hhc.exe)>;%PATH%
|
||||
|
||||
buildrelease.bat [-x86] [-x64] [-D] [-B]
|
||||
[-o <output directory>] [-c <certificate name>]
|
||||
|
||||
Specify -x86 and/or -x64 to build for each platform. If neither is
|
||||
specified, both platforms will be built. Currently, both the debug and
|
||||
release versions of Python are required for the installer.
|
||||
|
||||
Specify -D to skip rebuilding the documentation. The documentation is
|
||||
required for a release and the build will fail if it is not available.
|
||||
|
||||
Specify -B to skip rebuilding Python. This is useful to only rebuild the
|
||||
installer layout after a previous call to buildrelease.bat.
|
||||
|
||||
Specify -o to set an output directory. The installer layouts will be
|
||||
copied to platform-specific subdirectories of this path.
|
||||
|
||||
Specify -c to choose a code-signing certificate to be used for all the
|
||||
signable binaries in Python as well as each file making up the
|
||||
installer. Official releases of Python must be signed.
|
||||
|
||||
Ensure %PYTHON% and %SPHINXBUILD% are set when passing this option. You
|
||||
may also set %HTMLHELP% to the Html Help Compiler (hhc.exe), or put HHC
|
||||
on your PATH or in externals/. You will also need Mercurial (hg.exe) on
|
||||
your PATH.
|
||||
|
||||
If WiX is not found on your system, it will be automatically downloaded
|
||||
and extracted to the externals/ directory.
|
||||
|
||||
To manually build layouts of the installer, build one of the projects in
|
||||
the bundle folder.
|
||||
|
||||
msbuild bundle\snapshot.wixproj
|
||||
msbuild bundle\releaseweb.wixproj
|
||||
msbuild bundle\releaselocal.wixproj
|
||||
msbuild bundle\full.wixproj
|
||||
|
||||
snapshot.wixproj produces a test installer versioned based on the date.
|
||||
|
||||
releaseweb.wixproj produces a release installer that does not embed any
|
||||
of the layout.
|
||||
|
||||
releaselocal.wixproj produces a release installer that embeds the files
|
||||
required for a default installation.
|
||||
|
||||
full.wixproj produces a test installer that embeds the entire layout.
|
||||
|
||||
The following properties may be passed when building these projects.
|
||||
|
||||
/p:BuildForRelease=(true|false)
|
||||
When true, adds extra verification to ensure a complete installer is
|
||||
produced. For example, binutils is required when building for a release
|
||||
to generate MinGW-compatible libraries, and the build will be aborted if
|
||||
this fails. Defaults to false.
|
||||
|
||||
/p:ReleaseUri=(any URI)
|
||||
Used to generate unique IDs for the installers to allow side-by-side
|
||||
installation. Forks of Python can use the same installer infrastructure
|
||||
by providing a unique URI for this property. It does not need to be an
|
||||
active internet address. Defaults to $(ComputerName).
|
||||
|
||||
Official releases use http://www.python.org/(architecture name)
|
||||
|
||||
/p:DownloadUrlBase=(any URI)
|
||||
Specifies the base of a URL where missing parts of the installer layout
|
||||
can be downloaded from. The build version and architecture will be
|
||||
appended to create the full address. If omitted, missing components will
|
||||
not be automatically downloaded.
|
||||
|
||||
/p:DownloadUrl=(any URI)
|
||||
Specifies the full URL where missing parts of the installer layout can
|
||||
be downloaded from. Should normally include '{2}', which will be
|
||||
substituted for the filename. If omitted, missing components will not be
|
||||
automatically downloaded. If specified, this value overrides
|
||||
DownloadUrlBase.
|
||||
|
||||
/p:SigningCertificate=(certificate name)
|
||||
Specifies the certificate to sign the installer layout with. If omitted,
|
||||
the layout will not be signed.
|
||||
|
||||
/p:RebuildAll=(true|false)
|
||||
When true, rebuilds all of the MSIs making up the layout. Defaults to
|
||||
true.
|
||||
|
||||
Uploading the Installer
|
||||
=======================
|
||||
|
||||
For official releases, the uploadrelease.bat script should be used.
|
||||
|
||||
You will require PuTTY so that plink.exe and pscp.exe can be used, and your
|
||||
SSH key can be activated in pageant.exe. PuTTY should be either on your path
|
||||
or in %ProgramFiles(x86)%\PuTTY.
|
||||
|
||||
To include signatures for each uploaded file, you will need gpg2.exe on your
|
||||
path or have run get_externals.bat. You may also need to "gpg2.exe --import"
|
||||
your key before running the upload script.
|
||||
|
||||
uploadrelease.bat --host <host> --user <username> [--dry-run] [--no-gpg]
|
||||
|
||||
The host is the URL to the server. This can be provided by the Release
|
||||
Manager. You should be able to SSH to this address.
|
||||
|
||||
The username is your own username, which you have permission to SSH into
|
||||
the server containing downloads.
|
||||
|
||||
Use --dry-run to display the generated upload commands without executing
|
||||
them. Signatures for each file will be generated but not uploaded unless
|
||||
--no-gpg is also passed.
|
||||
|
||||
Use --no-gpg to suppress signature generation and upload.
|
||||
|
||||
The default target directory (which appears in uploadrelease.proj) is
|
||||
correct for official Python releases, but may be overridden with
|
||||
--target <path> for other purposes. This path should generally not include
|
||||
any version specifier, as that will be added automatically.
|
||||
|
||||
Modifying the Installer
|
||||
=======================
|
||||
|
||||
The code for the installer is divided into three main groups: packages,
|
||||
the bundle and the bootstrap application.
|
||||
|
||||
Packages
|
||||
--------
|
||||
|
||||
Packages appear as subdirectories of Tools/msi (other than the bundle/
|
||||
directory). The project file is a .wixproj and the build output is a
|
||||
single MSI. Packages are built with the WiX Toolset. Some project files
|
||||
share source files and use preprocessor directives to enable particular
|
||||
features. These are typically used to keep the sources close when the
|
||||
files are related, but produce multiple independent packages.
|
||||
|
||||
A package is the smallest element that may be independently installed or
|
||||
uninstalled (as used in this installer). For example, the test suite has
|
||||
its own package, as users can choose to add or remove it after the
|
||||
initial installation.
|
||||
|
||||
All the files installed by a single package should be related, though
|
||||
some packages may not install any files. For example, the pip package
|
||||
executes the ensurepip package, but does not add or remove any of its
|
||||
own files. (It is represented as a package because of its
|
||||
installed/uninstalled nature, as opposed to the "precompile standard
|
||||
library" option, for example.) Dependencies between packages are handled
|
||||
by the bundle, but packages should detect when dependencies are missing
|
||||
and raise an error.
|
||||
|
||||
Packages that include a lot of files may use an InstallFiles element in
|
||||
the .wixproj file to generate sources. See lib/lib.wixproj for an
|
||||
example, and msi.targets and csv_to_wxs.py for the implementation. This
|
||||
element is also responsible for generating the code for cleaning up and
|
||||
removing __pycache__ folders in any directory containing .py files.
|
||||
|
||||
All packages are built with the Tools/msi/common.wxs file, and so any
|
||||
directory or property in this file may be referenced. Of particular
|
||||
interest:
|
||||
|
||||
REGISTRYKEY (property)
|
||||
The registry key for the current installation.
|
||||
|
||||
InstallDirectory (directory)
|
||||
The root install directory for the current installation. Subdirectories
|
||||
are also specified in this file (DLLs, Lib, etc.)
|
||||
|
||||
MenuDir (directory)
|
||||
The Start Menu folder for the current installation.
|
||||
|
||||
UpgradeTable (property)
|
||||
Every package should reference this property to include upgrade
|
||||
information.
|
||||
|
||||
OptionalFeature (Component)
|
||||
Packages that may be enabled or disabled should reference this component
|
||||
and have an OPTIONAL_FEATURES entry in the bootstrap application to
|
||||
properly handle Modify and Upgrade.
|
||||
|
||||
The .wxl_template file is specially handled by the build system for this
|
||||
project to perform {{substitutions}} as defined in msi.targets. They
|
||||
should be included in projects as <WxlTemplate> items, where .wxl files
|
||||
are normally included as <EmbeddedResource> items.
|
||||
|
||||
Bundle
|
||||
------
|
||||
|
||||
The bundle is compiled to the main EXE entry point that for most users
|
||||
will represent the Python installer. It is built from Tools/msi/bundle
|
||||
with packages references in Tools/msi/bundle/packagegroups.
|
||||
|
||||
Build logic for the bundle is in bundle.targets, but should be invoked
|
||||
through one of the .wixproj files as described in Building the
|
||||
Installer.
|
||||
|
||||
The UI is separated between Default.thm (UI layout), Default.wxl
|
||||
(strings), bundle.wxs (properties) and the bootstrap application.
|
||||
Bundle.wxs also contains the chain, which is the list of packages to
|
||||
install and the order they should be installed in. These refer to named
|
||||
package groups in bundle/packagegroups.
|
||||
|
||||
Each package group specifies one or more packages to install. Most
|
||||
packages require two separate entries to support both per-user and
|
||||
all-users installations. Because these reuse the same package, it does
|
||||
not increase the overall size of the package.
|
||||
|
||||
Package groups refer to payload groups, which allow better control over
|
||||
embedding and downloading files than the default settings. Whether files
|
||||
are embedded and where they are downloaded from depends on settings
|
||||
created by the project files.
|
||||
|
||||
Package references can include install conditions that determine when to
|
||||
install the package. When a package is a dependency for others, the
|
||||
condition should be crafted to ensure it is installed.
|
||||
|
||||
MSI packages are installed or uninstalled based on their current state
|
||||
and the install condition. This makes them most suitable for features
|
||||
that are clearly present or absent from the user's machine.
|
||||
|
||||
EXE packages are executed based on a customisable condition that can be
|
||||
omitted. This makes them suitable for pre- or post-install tasks that
|
||||
need to run regardless of whether features have been added or removed.
|
||||
|
||||
Bootstrap Application
|
||||
---------------------
|
||||
|
||||
The bootstrap application is a C++ application that controls the UI and
|
||||
installation. While it does not directly compile into the main EXE of
|
||||
the installer, it forms the main active component. Most of the
|
||||
installation functionality is provided by WiX, and so the bootstrap
|
||||
application is predominantly responsible for the code behind the UI that
|
||||
is defined in the Default.thm file. The bootstrap application code is in
|
||||
bundle/bootstrap and is built automatically when building the bundle.
|
||||
|
||||
Installation Layout
|
||||
===================
|
||||
|
||||
There are two installation layouts for Python on Windows, with the only
|
||||
differences being supporting files. A layout is selected implicitly
|
||||
based on whether the install is for all users of the machine or just for
|
||||
the user performing the installation.
|
||||
|
||||
The default installation location when installing for all users is
|
||||
"%ProgramFiles%\Python3X" for the 64-bit interpreter and
|
||||
"%ProgramFiles(x86)%\Python3X-32" for the 32-bit interpreter. (Note that
|
||||
the latter path is equivalent to "%ProgramFiles%\Python3X-32" when
|
||||
running a 32-bit version of Windows.) This location requires
|
||||
administrative privileges to install or later modify the installation.
|
||||
|
||||
The default installation location when installing for the current user
|
||||
is "%LocalAppData%\Programs\Python\Python3X" for the 64-bit interpreter
|
||||
and "%LocalAppData%\Programs\Python\Python3X-32" for the 32-bit
|
||||
interpreter. Only the current user can access this location. This
|
||||
provides a suitable level of protection against malicious modification
|
||||
of Python's files.
|
||||
|
||||
(Default installation locations are set in Tools\msi\bundle\bundle.wxs.)
|
||||
|
||||
Within this install directory is the following approximate layout:
|
||||
|
||||
.\python[w].exe The core executable files
|
||||
.\DLLs Stdlib extensions (*.pyd) and dependencies
|
||||
.\Doc Documentation (*.chm)
|
||||
.\include Development headers (*.h)
|
||||
.\Lib Standard library
|
||||
.\Lib\test Test suite
|
||||
.\libs Development libraries (*.lib)
|
||||
.\Scripts Launcher scripts (*.exe, *.py)
|
||||
.\tcl Tcl dependencies (*.dll, *.tcl and others)
|
||||
.\Tools Tool scripts (*.py)
|
||||
|
||||
When installed for all users, the following files are installed to
|
||||
either "%SystemRoot%\System32" or "%SystemRoot%\SysWOW64" as
|
||||
appropriate. For the current user, they are installed in the Python
|
||||
install directory.
|
||||
|
||||
.\python3x.dll The core interpreter
|
||||
.\python3.dll The stable ABI reference
|
||||
|
||||
When installed for all users, the following files are installed to
|
||||
"%SystemRoot%" (typically "C:\Windows") to ensure they are always
|
||||
available on PATH. (See Launching Python below.) For the current user,
|
||||
they are installed in "%LocalAppData%\Programs\Python\PyLauncher".
|
||||
|
||||
.\py[w].exe PEP 397 launcher
|
||||
|
||||
System Settings
|
||||
===============
|
||||
|
||||
On installation, registry keys are created so that other applications
|
||||
can locate and identify installations of Python. The locations of these
|
||||
keys vary based on the install type.
|
||||
|
||||
For 64-bit interpreters installed for all users, the root key is:
|
||||
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.X
|
||||
|
||||
For 32-bit interpreters installed for all users on a 64-bit operating
|
||||
system, the root key is:
|
||||
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\PythonCore\3.X-32
|
||||
|
||||
For 32-bit interpreters installed for all users on a 32-bit operating
|
||||
system, the root key is:
|
||||
HKEY_LOCAL_MACHINE\Software\Python\PythonCore\3.X-32
|
||||
|
||||
For 64-bit interpreters installed for the current user:
|
||||
HKEY_CURRENT_USER\Software\Python\PythonCore\3.X
|
||||
|
||||
For 32-bit interpreters installed for the current user:
|
||||
HKEY_CURRENT_USER\Software\Python\PythonCore\3.X-32
|
||||
|
||||
When the core Python executables are installed, a key "InstallPath" is
|
||||
created within the root key with its default value set to the
|
||||
executable's install directory. A value named "ExecutablePath" is added
|
||||
with the full path to the main Python interpreter, and a key
|
||||
"InstallGroup" is created with its default value set to the product
|
||||
name "Python 3.X".
|
||||
|
||||
When the Python standard library is installed, a key "PythonPath" is
|
||||
created within the root key with its default value set to the full path
|
||||
to the Lib folder followed by the path to the DLLs folder, separated by
|
||||
a semicolon.
|
||||
|
||||
When the documentation is installed, a key "Help" is created within the
|
||||
root key, with a subkey "Main Python Documentation" with its default
|
||||
value set to the full path to the installed CHM file.
|
||||
|
||||
|
||||
The py.exe launcher is installed as part of a regular Python install,
|
||||
but using a separate mechanism that allows it to more easily span
|
||||
versions of Python. As a result, it has different root keys for its
|
||||
registry entries:
|
||||
|
||||
When installed for all users on a 64-bit operating system, the
|
||||
launcher's root key is:
|
||||
HKEY_LOCAL_MACHINE\Software\Wow6432Node\Python\Launcher
|
||||
|
||||
When installed for all users on a 32-bit operating system, the
|
||||
launcher's root key is:
|
||||
HKEY_LOCAL_MACHINE\Software\Python\Launcher
|
||||
|
||||
When installed for the current user:
|
||||
HKEY_CURRENT_USER\Software\Python\Launcher
|
||||
|
||||
When the launcher is installed, a key "InstallPath" is created within
|
||||
its root key with its default value set to the launcher's install
|
||||
directory. File associations are also created for .py, .pyw, .pyc and
|
||||
.pyo files.
|
||||
|
||||
Launching Python
|
||||
================
|
||||
|
||||
When a feature offering user entry points in the Start Menu is
|
||||
installed, a folder "Python 3.X" is created. Every shortcut should be
|
||||
created within this folder, and each shortcut should include the version
|
||||
and platform to allow users to identify the shortcut in a search results
|
||||
page.
|
||||
|
||||
The core Python executables creates a shortcut "Python 3.X (32-bit)" or
|
||||
"Python 3.X (64-bit)" depending on the interpreter.
|
||||
|
||||
The documentation creates a shortcut "Python 3.X 32-bit Manuals" or
|
||||
"Python 3.X 64-bit Manuals". The documentation is identical for all
|
||||
platforms, but the shortcuts need to be separate to avoid uninstallation
|
||||
conflicts.
|
||||
|
||||
Installing IDLE creates a shortcut "IDLE (Python 3.X 32-bit)" or "IDLE
|
||||
(Python 3.X 64-bit)" depending on the interpreter.
|
||||
|
||||
|
||||
For users who often launch Python from a Command Prompt, an option is
|
||||
provided to add the directory containing python.exe to the user or
|
||||
system PATH variable. If the option is selected, the install directory
|
||||
and the Scripts directory will be added at the start of the system PATH
|
||||
for an all users install and the user PATH for a per-user install.
|
||||
|
||||
When the user only has one version of Python installed, this will behave
|
||||
as expected. However, because Windows searches the system PATH before
|
||||
the user PATH, users cannot override a system-wide installation of
|
||||
Python on their PATH. Further, because the installer can only prepend to
|
||||
the path, later installations of Python will take precedence over
|
||||
earlier installations, regardless of interpreter version.
|
||||
|
||||
Because it is not possible to automatically create a sensible PATH
|
||||
configuration, users are recommended to use the py.exe launcher and
|
||||
manually modify their PATH variable to add Scripts directories in their
|
||||
preferred order. System-wide installations of Python should consider not
|
||||
modifying PATH, or using an alternative technology to modify their
|
||||
users' PATH variables.
|
||||
|
||||
|
||||
The py.exe launcher is recommended because it uses a consistent and
|
||||
sensible search order for Python installations. User installations are
|
||||
preferred over system-wide installs, and later versions are preferred
|
||||
regardless of installation order (with the exception that py.exe
|
||||
currently prefers 2.x versions over 3.x versions without the -3 command
|
||||
line argument).
|
||||
|
||||
For both 32-bit and 64-bit interpreters, the 32-bit version of the
|
||||
launcher is installed. This ensures that the search order is always
|
||||
consistent (as the 64-bit launcher is subtly different from the 32-bit
|
||||
launcher) and also avoids the need to install it multiple times. Future
|
||||
versions of Python will upgrade the launcher in-place, using Windows
|
||||
Installer's upgrade functionality to avoid conflicts with earlier
|
||||
installed versions.
|
||||
|
||||
When installed, file associations are created for .py, .pyc and .pyo
|
||||
files to launch with py.exe and .pyw files to launch with pyw.exe. This
|
||||
makes Python files respect shebang lines by default and also avoids
|
||||
conflicts between multiple Python installations.
|
||||
|
||||
|
||||
Repair, Modify and Uninstall
|
||||
============================
|
||||
|
||||
After installation, Python may be modified, repaired or uninstalled by
|
||||
running the original EXE again or via the Programs and Features applet
|
||||
(formerly known as Add or Remove Programs).
|
||||
|
||||
Modifications allow features to be added or removed. The install
|
||||
directory and kind (all users/single user) cannot be modified. Because
|
||||
Windows Installer caches installation packages, removing features will
|
||||
not require internet access unless the package cache has been corrupted
|
||||
or deleted. Adding features that were not previously installed and are
|
||||
not embedded or otherwise available will require internet access.
|
||||
|
||||
Repairing will rerun the installation for all currently installed
|
||||
features, restoring files and registry keys that have been modified or
|
||||
removed. This operation generally will not redownload any files unless
|
||||
the cached packages have been corrupted or deleted.
|
||||
|
||||
Removing Python will clean up all the files and registry keys that were
|
||||
created by the installer, as well as __pycache__ folders that are
|
||||
explicitly handled by the installer. Python packages installed later
|
||||
using a tool like pip will not be removed. Some components may be
|
||||
installed by other installers and these will not be removed if another
|
||||
product has a dependency on them.
|
||||
|
79
third_party/python/Tools/msi/build.bat
vendored
79
third_party/python/Tools/msi/build.bat
vendored
|
@ -1,79 +0,0 @@
|
|||
@echo off
|
||||
setlocal
|
||||
set D=%~dp0
|
||||
set PCBUILD=%D%..\..\PCBuild\
|
||||
|
||||
set BUILDX86=
|
||||
set BUILDX64=
|
||||
set BUILDDOC=
|
||||
set BUILDTEST=--test-marker
|
||||
set BUILDPACK=
|
||||
set REBUILD=
|
||||
|
||||
:CheckOpts
|
||||
if "%~1" EQU "-h" goto Help
|
||||
if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
|
||||
if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
|
||||
if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
|
||||
if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
|
||||
if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
|
||||
if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
|
||||
|
||||
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
|
||||
|
||||
call "%D%get_externals.bat"
|
||||
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
|
||||
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
|
||||
|
||||
if defined BUILDX86 (
|
||||
call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
|
||||
if errorlevel 1 goto :eof
|
||||
call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
|
||||
if errorlevel 1 goto :eof
|
||||
)
|
||||
if defined BUILDX64 (
|
||||
call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
|
||||
if errorlevel 1 goto :eof
|
||||
call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
|
||||
if errorlevel 1 goto :eof
|
||||
)
|
||||
|
||||
if defined BUILDDOC (
|
||||
call "%PCBUILD%..\Doc\make.bat" htmlhelp
|
||||
if errorlevel 1 goto :eof
|
||||
)
|
||||
|
||||
rem Build the launcher MSI separately
|
||||
%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86
|
||||
|
||||
set BUILD_CMD="%D%bundle\snapshot.wixproj"
|
||||
if defined BUILDTEST (
|
||||
set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
|
||||
)
|
||||
if defined BUILDPACK (
|
||||
set BUILD_CMD=%BUILD_CMD% /p:Pack=true
|
||||
)
|
||||
if defined REBUILD (
|
||||
set BUILD_CMD=%BUILD_CMD% /t:Rebuild
|
||||
)
|
||||
|
||||
if defined BUILDX86 (
|
||||
%MSBUILD% %BUILD_CMD%
|
||||
if errorlevel 1 goto :eof
|
||||
)
|
||||
if defined BUILDX64 (
|
||||
%MSBUILD% /p:Platform=x64 %BUILD_CMD%
|
||||
if errorlevel 1 goto :eof
|
||||
)
|
||||
|
||||
exit /B 0
|
||||
|
||||
:Help
|
||||
echo build.bat [-x86] [-x64] [--doc] [-h] [--no-test-marker] [--pack] [-r]
|
||||
echo.
|
||||
echo -x86 Build x86 installers
|
||||
echo -x64 Build x64 installers
|
||||
echo --doc Build CHM documentation
|
||||
echo --no-test-marker Build without test markers
|
||||
echo --pack Embed core MSIs into installer
|
||||
echo -r Rebuild rather than incremental build
|
234
third_party/python/Tools/msi/buildrelease.bat
vendored
234
third_party/python/Tools/msi/buildrelease.bat
vendored
|
@ -1,234 +0,0 @@
|
|||
@setlocal
|
||||
@echo off
|
||||
|
||||
rem This script is intended for building official releases of Python.
|
||||
rem To use it to build alternative releases, you should clone this file
|
||||
rem and modify the following three URIs.
|
||||
|
||||
rem These two will ensure that your release can be installed
|
||||
rem alongside an official Python release, by modifying the GUIDs used
|
||||
rem for all components.
|
||||
rem
|
||||
rem The following substitutions will be applied to the release URI:
|
||||
rem Variable Description Example
|
||||
rem {arch} architecture amd64, win32
|
||||
set RELEASE_URI=http://www.python.org/{arch}
|
||||
|
||||
rem This is the URL that will be used to download installation files.
|
||||
rem The files available from the default URL *will* conflict with your
|
||||
rem installer. Trust me, you don't want them, even if it seems like a
|
||||
rem good idea.
|
||||
rem
|
||||
rem The following substitutions will be applied to the download URL:
|
||||
rem Variable Description Example
|
||||
rem {version} version number 3.5.0
|
||||
rem {arch} architecture amd64, win32
|
||||
rem {releasename} release name a1, b2, rc3 (or blank for final)
|
||||
rem {msi} MSI filename core.msi
|
||||
set DOWNLOAD_URL=https://www.python.org/ftp/python/{version}/{arch}{releasename}/{msi}
|
||||
|
||||
set D=%~dp0
|
||||
set PCBUILD=%D%..\..\PCBuild\
|
||||
if "%Py_OutDir%"=="" set Py_OutDir=%PCBUILD%
|
||||
set EXTERNALS=%D%..\..\externals\windows-installer\
|
||||
|
||||
set BUILDX86=
|
||||
set BUILDX64=
|
||||
set TARGET=Rebuild
|
||||
set TESTTARGETDIR=
|
||||
set PGO=-m test -q --pgo
|
||||
set BUILDNUGET=1
|
||||
set BUILDZIP=1
|
||||
|
||||
|
||||
:CheckOpts
|
||||
if "%1" EQU "-h" goto Help
|
||||
if "%1" EQU "-c" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "--certificate" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "-o" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "--out" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "-D" (set SKIPDOC=1) && shift && goto CheckOpts
|
||||
if "%1" EQU "--skip-doc" (set SKIPDOC=1) && shift && goto CheckOpts
|
||||
if "%1" EQU "-B" (set SKIPBUILD=1) && shift && goto CheckOpts
|
||||
if "%1" EQU "--skip-build" (set SKIPBUILD=1) && shift && goto CheckOpts
|
||||
if "%1" EQU "--download" (set DOWNLOAD_URL=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "--test" (set TESTTARGETDIR=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "-b" (set TARGET=Build) && shift && goto CheckOpts
|
||||
if "%1" EQU "--build" (set TARGET=Build) && shift && goto CheckOpts
|
||||
if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
|
||||
if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
|
||||
if "%1" EQU "--pgo" (set PGO=%~2) && shift && shift && goto CheckOpts
|
||||
if "%1" EQU "--skip-pgo" (set PGO=) && shift && goto CheckOpts
|
||||
if "%1" EQU "--skip-nuget" (set BUILDNUGET=) && shift && goto CheckOpts
|
||||
if "%1" EQU "--skip-zip" (set BUILDZIP=) && shift && goto CheckOpts
|
||||
|
||||
if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1
|
||||
|
||||
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
|
||||
|
||||
if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP%\git.loc" & del "%TEMP%\git.loc"
|
||||
if not exist "%GIT%" echo Cannot find Git on PATH && exit /B 1
|
||||
|
||||
call "%D%get_externals.bat"
|
||||
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
|
||||
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
|
||||
|
||||
:builddoc
|
||||
if "%SKIPBUILD%" EQU "1" goto skipdoc
|
||||
if "%SKIPDOC%" EQU "1" goto skipdoc
|
||||
|
||||
call "%D%..\..\doc\make.bat" htmlhelp
|
||||
if errorlevel 1 goto :eof
|
||||
:skipdoc
|
||||
|
||||
where dlltool /q && goto skipdlltoolsearch
|
||||
set _DLLTOOL_PATH=
|
||||
where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc"
|
||||
if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1
|
||||
for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf
|
||||
set _DLLTOOL_PATH=
|
||||
:skipdlltoolsearch
|
||||
|
||||
if defined BUILDX86 (
|
||||
call :build x86
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if defined BUILDX64 (
|
||||
call :build x64 "%PGO%"
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if defined TESTTARGETDIR (
|
||||
call "%D%testrelease.bat" -t "%TESTTARGETDIR%"
|
||||
)
|
||||
|
||||
exit /B 0
|
||||
|
||||
:build
|
||||
@setlocal
|
||||
@echo off
|
||||
|
||||
if "%1" EQU "x86" (
|
||||
set PGO=
|
||||
set BUILD=%Py_OutDir%win32\
|
||||
set BUILD_PLAT=Win32
|
||||
set OUTDIR_PLAT=win32
|
||||
set OBJDIR_PLAT=x86
|
||||
) else (
|
||||
set BUILD=%Py_OutDir%amd64\
|
||||
set PGO=%~2
|
||||
set BUILD_PLAT=x64
|
||||
set OUTDIR_PLAT=amd64
|
||||
set OBJDIR_PLAT=x64
|
||||
)
|
||||
|
||||
if exist "%BUILD%en-us" (
|
||||
echo Deleting %BUILD%en-us
|
||||
rmdir /q/s "%BUILD%en-us"
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if exist "%D%obj\Debug_%OBJDIR_PLAT%" (
|
||||
echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%"
|
||||
rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%"
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if exist "%D%obj\Release_%OBJDIR_PLAT%" (
|
||||
echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
|
||||
rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if not "%CERTNAME%" EQU "" (
|
||||
set CERTOPTS="/p:SigningCertificate=%CERTNAME%"
|
||||
) else (
|
||||
set CERTOPTS=
|
||||
)
|
||||
if not "%PGO%" EQU "" (
|
||||
set PGOOPTS=--pgo-job "%PGO%"
|
||||
) else (
|
||||
set PGOOPTS=
|
||||
)
|
||||
if not "%SKIPBUILD%" EQU "1" (
|
||||
@echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
|
||||
@call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
|
||||
@if errorlevel 1 exit /B
|
||||
@rem build.bat turns echo back on, so we disable it again
|
||||
@echo off
|
||||
|
||||
@echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
|
||||
@call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
|
||||
@if errorlevel 1 exit /B
|
||||
@rem build.bat turns echo back on, so we disable it again
|
||||
@echo off
|
||||
)
|
||||
|
||||
if "%OUTDIR_PLAT%" EQU "win32" (
|
||||
%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
|
||||
if errorlevel 1 exit /B
|
||||
) else if not exist "%Py_OutDir%win32\en-us\launcher.msi" (
|
||||
%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
|
||||
%MSBUILD% "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
|
||||
if errorlevel 1 exit /B
|
||||
%MSBUILD% "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
|
||||
if errorlevel 1 exit /B
|
||||
|
||||
if defined BUILDZIP (
|
||||
%MSBUILD% "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% /p:OutputPath="%BUILD%en-us"
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if defined BUILDNUGET (
|
||||
%MSBUILD% "%D%..\nuget\make_pkg.proj" /t:Build /p:Configuration=Release /p:Platform=%1 /p:OutputPath="%BUILD%en-us"
|
||||
if errorlevel 1 exit /B
|
||||
)
|
||||
|
||||
if not "%OUTDIR%" EQU "" (
|
||||
mkdir "%OUTDIR%\%OUTDIR_PLAT%"
|
||||
mkdir "%OUTDIR%\%OUTDIR_PLAT%\binaries"
|
||||
mkdir "%OUTDIR%\%OUTDIR_PLAT%\symbols"
|
||||
robocopy "%BUILD%en-us" "%OUTDIR%\%OUTDIR_PLAT%" /XF "*.wixpdb"
|
||||
robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\binaries" *.exe *.dll *.pyd /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"
|
||||
robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\symbols" *.pdb /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"
|
||||
)
|
||||
|
||||
exit /B 0
|
||||
|
||||
:Help
|
||||
echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND]
|
||||
echo [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip] [--skip-pgo]
|
||||
echo [--download DOWNLOAD URL] [--test TARGETDIR]
|
||||
echo [-h]
|
||||
echo.
|
||||
echo --out (-o) Specify an additional output directory for installers
|
||||
echo -x86 Build x86 installers
|
||||
echo -x64 Build x64 installers
|
||||
echo --build (-b) Incrementally build Python rather than rebuilding
|
||||
echo --skip-build (-B) Do not build Python (just do the installers)
|
||||
echo --skip-doc (-D) Do not build documentation
|
||||
echo --pgo Specify PGO command for x64 installers
|
||||
echo --skip-pgo Build x64 installers without using PGO
|
||||
echo --skip-nuget Do not build Nuget packages
|
||||
echo --skip-zip Do not build embeddable package
|
||||
echo --download Specify the full download URL for MSIs
|
||||
echo --test Specify the test directory to run the installer tests
|
||||
echo -h Display this help information
|
||||
echo.
|
||||
echo If no architecture is specified, all architectures will be built.
|
||||
echo If --test is not specified, the installer tests are not run.
|
||||
echo.
|
||||
echo For the --pgo option, any Python command line can be used, or 'default' to
|
||||
echo use the default task (-m test --pgo).
|
||||
echo.
|
||||
echo The following substitutions will be applied to the download URL:
|
||||
echo Variable Description Example
|
||||
echo {version} version number 3.5.0
|
||||
echo {arch} architecture amd64, win32
|
||||
echo {releasename} release name a1, b2, rc3 (or blank for final)
|
||||
echo {msi} MSI filename core.msi
|
137
third_party/python/Tools/msi/bundle/Default.thm
vendored
137
third_party/python/Tools/msi/bundle/Default.thm
vendored
|
@ -1,137 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010">
|
||||
<Window Width="670" Height="412" HexStyle="100a0000" FontId="0">#(loc.Caption)</Window>
|
||||
<Font Id="0" Height="-14" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
|
||||
<Font Id="1" Height="-26" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
|
||||
<Font Id="2" Height="-24" Weight="500" Foreground="808080" Background="ffffff">Segoe UI</Font>
|
||||
<Font Id="3" Height="-14" Weight="500" Foreground="000000" Background="ffffff">Segoe UI</Font>
|
||||
<Font Id="4" Height="-14" Weight="500" Foreground="ff0000" Background="ffffff" Underline="yes">Segoe UI</Font>
|
||||
<Font Id="5" Height="-14" Weight="500" Foreground="808080" Background="ffffff">Segoe UI</Font>
|
||||
|
||||
<Page Name="Help">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.HelpHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Hypertext X="185" Y="50" Width="-11" Height="-35" FontId="3" DisablePrefix="yes">#(loc.HelpText)</Hypertext>
|
||||
<Button Name="SuccessCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CloseButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Install">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.InstallHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Text X="185" Y="50" Width="-11" Height="50" FontId="3" TabStop="yes">#(loc.InstallMessage)</Text>
|
||||
|
||||
<Button Name="InstallButton" X="185" Y="101" Width="-11" Height="109" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallButton)</Button>
|
||||
<Button Name="InstallCustomButton" X="185" Y="221" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallCustomButton)</Button>
|
||||
|
||||
<Checkbox Name="InstallLauncherAllUsers" X="185" Y="-37" Width="-100" Height="24" TabStop="yes" FontId="3">#(loc.ShortInstallLauncherAllUsersLabel)</Checkbox>
|
||||
<Checkbox Name="PrependPath" X="185" Y="-13" Width="-100" Height="24" TabStop="yes" FontId="3">#(loc.ShortPrependPathLabel)</Checkbox>
|
||||
|
||||
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Upgrade">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.InstallUpgradeHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Text X="185" Y="50" Width="-11" Height="50" FontId="3" TabStop="yes">#(loc.InstallUpgradeMessage)</Text>
|
||||
|
||||
<Button Name="InstallUpgradeButton" X="185" Y="101" Width="-11" Height="129" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallUpgradeButton)</Button>
|
||||
<Button Name="InstallUpgradeCustomButton" X="185" Y="241" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.InstallUpgradeCustomButton)</Button>
|
||||
|
||||
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="SimpleInstall">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.InstallHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Button Name="InstallSimpleButton" X="185" Y="101" Width="-11" Height="129" TabStop="yes" FontId="3" HideWhenDisabled="yes" HexStyle="0xF">#(loc.InstallSimpleButton)</Button>
|
||||
|
||||
<Button Name="InstallCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Custom1">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.Custom1Header)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Checkbox Name="Include_doc" X="185" Y="51" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_docLabel)</Checkbox>
|
||||
<Text X="205" Y="76" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_docHelpLabel)</Text>
|
||||
|
||||
<Checkbox Name="Include_pip" X="185" Y="101" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_pipLabel)</Checkbox>
|
||||
<Text X="205" Y="126" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_pipHelpLabel)</Text>
|
||||
|
||||
<Checkbox Name="Include_tcltk" X="185" Y="151" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_tcltkLabel)</Checkbox>
|
||||
<Text X="205" Y="176" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_tcltkHelpLabel)</Text>
|
||||
|
||||
<Checkbox Name="Include_test" X="185" Y="201" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_testLabel)</Checkbox>
|
||||
<Text X="205" Y="226" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_testHelpLabel)</Text>
|
||||
|
||||
<Checkbox Name="Include_launcher" X="185" Y="251" Width="100" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_launcherLabel)</Checkbox>
|
||||
<Checkbox Name="CustomInstallLauncherAllUsers" X="285" Y="251" Width="-11" Height="24" TabStop="yes" FontId="3">#(loc.InstallLauncherAllUsersLabel)</Checkbox>
|
||||
<Text Name="Include_launcherHelp" X="205" Y="276" Width="-11" Height="24" TabStop="no" FontId="5"></Text>
|
||||
|
||||
<Button Name="Custom1BackButton" X="185" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button>
|
||||
<Button Name="CustomNextButton" X="-101" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CustomNextButton)</Button>
|
||||
<Button Name="Custom1CancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Custom2">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.Custom2Header)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Checkbox Name="InstallAllUsers" X="185" Y="51" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.InstallAllUsersLabel)</Checkbox>
|
||||
<Checkbox Name="AssociateFiles" X="185" Y="76" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.AssociateFilesLabel)</Checkbox>
|
||||
<Checkbox Name="Shortcuts" X="185" Y="101" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.ShortcutsLabel)</Checkbox>
|
||||
<Checkbox Name="PrependPath" X="185" Y="126" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrependPathLabel)</Checkbox>
|
||||
<Checkbox Name="CompileAll" X="185" Y="151" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrecompileLabel)</Checkbox>
|
||||
<Checkbox Name="Include_symbols" X="185" Y="176" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_symbolsLabel)</Checkbox>
|
||||
<Checkbox Name="Include_debug" X="185" Y="201" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_debugLabel)</Checkbox>
|
||||
|
||||
<Text X="185" Y="256" Width="-11" Height="17" FontId="3">#(loc.CustomLocationLabel)</Text>
|
||||
<Editbox Name="TargetDir" X="185" Y="277" Width="-101" Height="27" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
|
||||
<Button Name="CustomBrowseButton" X="-11" Y="276" Width="85" Height="27" TabStop="yes" FontId="3">#(loc.CustomBrowseButton)</Button>
|
||||
<Text Name="CustomBrowseButtonLabel" X="185" Y="306" Width="-91" Height="35" FontId="5" HideWhenDisabled="yes">#(loc.CustomLocationHelpLabel)</Text>
|
||||
|
||||
<Button Name="Custom2BackButton" X="185" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CustomBackButton)</Button>
|
||||
<Button Name="CustomInstallButton" X="-101" Y="-11" Width="95" Height="27" TabStop="yes" FontId="0">#(loc.CustomInstallButton)</Button>
|
||||
<Button Name="Custom2CancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Progress">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.ProgressHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Text X="185" Y="111" Width="-11" Height="20" FontId="3" DisablePrefix="yes">#(loc.ProgressLabel)</Text>
|
||||
<Text Name="OverallProgressPackageText" X="185" Y="146" Width="-11" Height="20" FontId="3" DisablePrefix="yes">#(loc.OverallProgressPackageText)</Text>
|
||||
<Progressbar Name="OverallCalculatedProgressbar" X="185" Y="171" Width="-11" Height="24" />
|
||||
<Button Name="ProgressCancelButton" X="-11" Y="-11" Width="95" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Modify">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.ModifyHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Button Name="ModifyButton" X="185" Y="101" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xF">#(loc.ModifyModifyButton)</Button>
|
||||
<Button Name="RepairButton" X="185" Y="171" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.ModifyRepairButton)</Button>
|
||||
<Button Name="UninstallButton" X="185" Y="241" Width="-11" Height="59" TabStop="yes" FontId="3" HexStyle="0xE">#(loc.ModifyUninstallButton)</Button>
|
||||
|
||||
<Button Name="ModifyCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CancelButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Success">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.SuccessHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Hypertext Name="SuccessText" X="205" Y="71" Width="-71" Height="150" FontId="3" DisablePrefix="yes"></Hypertext>
|
||||
|
||||
<Button Name="SuccessMaxPathButton" X="185" Y="-70" Width="-11" Height="81" TabStop="yes" FontId="3" HexStyle="0xE" HideWhenDisabled="yes">#(loc.SuccessMaxPathButton)</Button>
|
||||
|
||||
<Text Name="SuccessRestartText" X="205" Y="-40" Width="-11" Height="34" FontId="3" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.SuccessRestartText)</Text>
|
||||
<Button Name="SuccessRestartButton" X="-101" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.SuccessRestartButton)</Button>
|
||||
<Button Name="SuccessCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CloseButton)</Button>
|
||||
</Page>
|
||||
<Page Name="Failure">
|
||||
<Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.FailureHeader)</Text>
|
||||
<Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
|
||||
|
||||
<Hypertext Name="FailureLogFileLink" X="205" Y="71" Width="-11" Height="60" FontId="3" TabStop="yes" HideWhenDisabled="yes">#(loc.FailureHyperlinkLogText)</Hypertext>
|
||||
<Hypertext Name="FailureMessageText" X="205" Y="151" Width="-11" Height="120" FontId="3" TabStop="yes" HideWhenDisabled="yes"></Hypertext>
|
||||
<Text Name="FailureRestartText" X="205" Y="-40" Width="-11" Height="34" FontId="3" HideWhenDisabled="yes" DisablePrefix="yes">#(loc.FailureRestartText)</Text>
|
||||
<Button Name="FailureRestartButton" X="-101" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0" HideWhenDisabled="yes">#(loc.FailureRestartButton)</Button>
|
||||
<Button Name="FailureCancelButton" X="-11" Y="-11" Width="85" Height="27" TabStop="yes" FontId="0">#(loc.CloseButton)</Button>
|
||||
</Page>
|
||||
</Theme>
|
148
third_party/python/Tools/msi/bundle/Default.wxl
vendored
148
third_party/python/Tools/msi/bundle/Default.wxl
vendored
|
@ -1,148 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" Language="1033" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Caption">[WixBundleName] Setup</String>
|
||||
<String Id="Title">[WixBundleName]</String>
|
||||
<String Id="Installing">Installing</String>
|
||||
<String Id="Installation">Setup</String>
|
||||
<String Id="Modifying">Updating</String>
|
||||
<String Id="Modification">Modify</String>
|
||||
<String Id="Repairing">Repairing</String>
|
||||
<String Id="Repair">Repair</String>
|
||||
<String Id="Uninstalling">Removing</String>
|
||||
<String Id="Uninstallation">Uninstall</String>
|
||||
|
||||
<String Id="ElevateForCRTInstall">You will be prompted for Administrator privileges to install a C Runtime Library update (KB2999226).
|
||||
|
||||
|
||||
Continue?</String>
|
||||
|
||||
<String Id="CancelButton">&Cancel</String>
|
||||
<String Id="CloseButton">&Close</String>
|
||||
<String Id="InstallHeader">Install [WixBundleName]</String>
|
||||
<String Id="InstallMessage">Select Install Now to install Python with default settings, or choose Customize to enable or disable features.</String>
|
||||
<String Id="InstallVersion">Version [WixBundleVersion]</String>
|
||||
<String Id="InstallUpgradeHeader">Upgrade to [WixBundleName]</String>
|
||||
<String Id="InstallUpgradeMessage">Select Upgrade Now to keep your current settings, or choose Customize to enable or disable features.</String>
|
||||
<String Id="ConfirmCancelMessage">Are you sure you want to cancel?</String>
|
||||
<String Id="ExecuteUpgradeRelatedBundleMessage">Previous version</String>
|
||||
<String Id="HelpHeader">Setup Help</String>
|
||||
<String Id="HelpText">Visit <a href="http://docs.python.org/[ShortVersion]/using/windows.html">docs.python.org/[ShortVersion]/using/windows.html</a> for the full list of options, including the ability to enable and disable specific features.
|
||||
|
||||
"/passive" to display progress without requiring user interaction
|
||||
|
||||
"/quiet" to install/uninstall without displaying any UI
|
||||
|
||||
"/simple" to prevent user customization
|
||||
|
||||
"/uninstall" to remove Python (without confirmation)
|
||||
|
||||
"/layout [\[]directory[\]]" to pre-download all components
|
||||
|
||||
"/log [\[]filename[\]]" to specify log files location</String>
|
||||
<String Id="InstallLicenseLinkText">[WixBundleName] <a href="#">license terms</a>.</String>
|
||||
<String Id="InstallAcceptCheckbox">I &agree to the license terms and conditions</String>
|
||||
<String Id="InstallButton">&Install Now</String>
|
||||
<String Id="InstallButtonNote">[TargetDir]
|
||||
|
||||
Includes IDLE, pip and documentation
|
||||
Creates shortcuts and file associations</String>
|
||||
<String Id="InstallCustomButton">C&ustomize installation</String>
|
||||
<String Id="InstallCustomButtonNote">Choose location and features</String>
|
||||
<String Id="InstallSimpleButton">&Install</String>
|
||||
<String Id="InstallSimpleButtonNote">Use settings preselected by your administrator
|
||||
|
||||
[SimpleInstallDescription]</String>
|
||||
<String Id="InstallUpgradeButton">Up&grade Now</String>
|
||||
<String Id="InstallUpgradeButtonNote">[TargetDir]
|
||||
|
||||
Replaces your existing installation without changing settings.
|
||||
Select Customize to review current options.</String>
|
||||
<String Id="InstallUpgradeCustomButton">C&ustomize installation</String>
|
||||
<String Id="InstallUpgradeCustomButtonNote">Choose location and features</String>
|
||||
<String Id="Custom1Header">Optional Features</String>
|
||||
<String Id="Custom2Header">Advanced Options</String>
|
||||
<String Id="CustomLocationLabel">Customize install location</String>
|
||||
<String Id="CustomLocationHelpLabel">You will require write permissions for the selected location.</String>
|
||||
<String Id="CustomInstallButton">&Install</String>
|
||||
<String Id="CustomNextButton">&Next</String>
|
||||
<String Id="CustomBackButton">&Back</String>
|
||||
<String Id="CustomBrowseButton">B&rowse</String>
|
||||
<String Id="Include_docLabel">&Documentation</String>
|
||||
<String Id="Include_docHelpLabel">Installs the Python documentation file.</String>
|
||||
<String Id="Include_pipLabel">&pip</String>
|
||||
<String Id="Include_pipHelpLabel">Installs pip, which can download and install other Python packages.</String>
|
||||
<String Id="Include_tcltkLabel">tcl/tk and &IDLE</String>
|
||||
<String Id="Include_tcltkHelpLabel">Installs tkinter and the IDLE development environment.</String>
|
||||
<String Id="Include_testLabel">Python &test suite</String>
|
||||
<String Id="Include_testHelpLabel">Installs the standard library test suite.</String>
|
||||
<String Id="Include_launcherLabel">py &launcher</String>
|
||||
<String Id="Include_launcherHelp">Installs the global 'py' launcher to make it easier to start Python.</String>
|
||||
<String Id="Include_launcherRemove">Use Programs and Features to remove the 'py' launcher.</String>
|
||||
<String Id="Include_launcherUpgrade">Upgrades the global 'py' launcher from the previous version.</String>
|
||||
|
||||
<String Id="AssociateFilesLabel">Associate &files with Python (requires the py launcher)</String>
|
||||
<String Id="ShortcutsLabel">Create shortcuts for installed applications</String>
|
||||
<String Id="PrependPathLabel">Add Python to &environment variables</String>
|
||||
<String Id="ShortPrependPathLabel">Add &Python [ShortVersion] to PATH</String>
|
||||
<String Id="InstallAllUsersLabel">Install for &all users</String>
|
||||
<String Id="InstallLauncherAllUsersLabel">for &all users (requires elevation)</String>
|
||||
<String Id="ShortInstallLauncherAllUsersLabel">Install &launcher for all users (recommended)</String>
|
||||
<String Id="PrecompileLabel">&Precompile standard library</String>
|
||||
<String Id="Include_symbolsLabel">Download debugging &symbols</String>
|
||||
<String Id="Include_debugLabel">Download debu&g binaries (requires VS 2015 or later)</String>
|
||||
|
||||
<String Id="ProgressHeader">[ActionLikeInstallation] Progress</String>
|
||||
<String Id="ProgressLabel">[ActionLikeInstalling]:</String>
|
||||
<String Id="OverallProgressPackageText">Initializing...</String>
|
||||
<String Id="ModifyHeader">Modify Setup</String>
|
||||
<String Id="ModifyModifyButton">&Modify</String>
|
||||
<String Id="ModifyButtonNote">Add or remove individual features.</String>
|
||||
<String Id="ModifyRepairButton">&Repair</String>
|
||||
<String Id="RepairButtonNote">Ensure all current features are correctly installed.</String>
|
||||
<String Id="ModifyUninstallButton">&Uninstall</String>
|
||||
<String Id="UninstallButtonNote">Remove the entire [WixBundleName] installation.</String>
|
||||
<String Id="SuccessHeader">[ActionLikeInstallation] was successful</String>
|
||||
<String Id="SuccessLaunchButton">&Launch</String>
|
||||
<String Id="SuccessRestartText">You may need to restart your computer to finish updating files.</String>
|
||||
<String Id="SuccessRestartButton">&Restart</String>
|
||||
<String Id="SuccessInstallMessage">Special thanks to Mark Hammond, without whose years of freely shared Windows expertise, Python for Windows would still be Python for DOS.
|
||||
|
||||
New to Python? Start with the <a href="https://docs.python.org/[ShortVersion]/tutorial/index.html">online tutorial</a> and <a href="https://docs.python.org/[ShortVersion]/index.html">documentation</a>.
|
||||
|
||||
See <a href="https://docs.python.org/[ShortVersion]/whatsnew/[ShortVersion].html">what's new</a> in this release.</String>
|
||||
<String Id="SuccessModifyMessage">Thank you for using [WixBundleName].</String>
|
||||
<String Id="SuccessRepairMessage">Thank you for using [WixBundleName].
|
||||
|
||||
Feel free to email <a href="mailto:python-list@python.org">python-list@python.org</a> if you continue to encounter issues.</String>
|
||||
<String Id="SuccessRemoveMessage">Thank you for using [WixBundleName].
|
||||
|
||||
Feel free to email <a href="mailto:python-list@python.org">python-list@python.org</a> if you encountered problems.</String>
|
||||
<String Id="FailureHeader">Setup failed</String>
|
||||
<String Id="FailureHyperlinkLogText">One or more issues caused the setup to fail. Please fix the issues and then retry setup. For more information see the <a href="#">log file</a>.</String>
|
||||
<String Id="FailureRestartText">You must restart your computer to complete the rollback of the software.</String>
|
||||
<String Id="FailureRestartButton">&Restart</String>
|
||||
<String Id="FailureExistingInstall">Unable to install [WixBundleName] due to an existing install. Use Programs and Features to modify, repair or remove [WixBundleName].</String>
|
||||
|
||||
<String Id="FailureWin7MissingSP1">Windows 7 Service Pack 1 and all applicable updates are required to install [WixBundleName].
|
||||
|
||||
Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%207%20service%20pack%201">update your machine</a> and then restart the installation.</String>
|
||||
<String Id="FailureVistaMissingSP2">Windows Vista Service Pack 2 and all applicable updates are required to install [WixBundleName].
|
||||
|
||||
Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20vista%20service%20pack%202">update your machine</a> and then restart the installation.</String>
|
||||
<String Id="FailureXPOrEarlier">Windows Vista or later is required to install and use [WixBundleName].
|
||||
|
||||
Visit <a href="https://www.python.org/">python.org</a> to download Python 3.4.</String>
|
||||
|
||||
<String Id="FailureWS2K8R2MissingSP1">Windows Server 2008 R2 Service Pack 1 and all applicable updates are required to install [WixBundleName].
|
||||
|
||||
Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20r2%20service%20pack%201">update your machine</a> and then restart the installation.</String>
|
||||
<String Id="FailureWS2K8MissingSP2">Windows Server 2008 Service Pack 2 and all applicable updates are required to install [WixBundleName].
|
||||
|
||||
Please <a href="https://www.bing.com/search?q=how%20to%20install%20windows%20server%202008%20service%20pack%202">update your machine</a> and then restart the installation.</String>
|
||||
<String Id="FailureWS2K3OrEarlier">Windows Server 2008 SP2 or later is required to install and use [WixBundleName].
|
||||
|
||||
Visit <a href="https://www.python.org/">python.org</a> to download Python 3.4.</String>
|
||||
|
||||
<String Id="SuccessMaxPathButton">Disable path length limit</String>
|
||||
<String Id="SuccessMaxPathButtonNote">Changes your machine configuration to allow programs, including Python, to bypass the 260 character "MAX_PATH" limitation.</String>
|
||||
</WixLocalization>
|
BIN
third_party/python/Tools/msi/bundle/SideBar.png
vendored
BIN
third_party/python/Tools/msi/bundle/SideBar.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 56 KiB |
|
@ -1,25 +0,0 @@
|
|||
This license applies to the bootstrapper application that is embedded within the installer. It has no impact on the licensing for the rest of the installer or Python itself, as no code covered by this license exists in any other part of the product.
|
||||
|
||||
---
|
||||
|
||||
Microsoft Reciprocal License (MS-RL)
|
||||
|
||||
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
|
||||
|
||||
1. Definitions
|
||||
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.
|
||||
A "contribution" is the original software, or any additions or changes to the software.
|
||||
A "contributor" is any person that distributes its contribution under this license.
|
||||
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
|
||||
|
||||
2. Grant of Rights
|
||||
(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.
|
||||
(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.
|
||||
|
||||
3. Conditions and Limitations
|
||||
(A) Reciprocal Grants- For any file you distribute that contains code from the software (in source code or binary format), you must provide recipients the source code to that file along with a copy of this license, which license will govern that file. You may license other files that are entirely your own work and do not contain code from the software under any terms you choose.
|
||||
(B) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.
|
||||
(C) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.
|
||||
(D) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.
|
||||
(E) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.
|
||||
(F) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
|
File diff suppressed because it is too large
Load diff
|
@ -1 +0,0 @@
|
|||
#include "pch.h"
|
|
@ -1,60 +0,0 @@
|
|||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="precomp.h" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// Precompiled header for standard bootstrapper application.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <gdiplus.h>
|
||||
#include <Uxtheme.h>
|
||||
#include <msiquery.h>
|
||||
#include <objbase.h>
|
||||
#include <shlobj.h>
|
||||
#include <shlwapi.h>
|
||||
#include <stdlib.h>
|
||||
#include <strsafe.h>
|
||||
#include <stddef.h>
|
||||
#include <versionhelpers.h>
|
||||
|
||||
#include "dutil.h"
|
||||
#include "memutil.h"
|
||||
#include "dictutil.h"
|
||||
#include "dirutil.h"
|
||||
#include "fileutil.h"
|
||||
#include "locutil.h"
|
||||
#include "logutil.h"
|
||||
#include "pathutil.h"
|
||||
#include "resrutil.h"
|
||||
#include "shelutil.h"
|
||||
#include "strutil.h"
|
||||
#include "thmutil.h"
|
||||
#include "uriutil.h"
|
||||
#include "xmlutil.h"
|
||||
|
||||
#include "IBootstrapperEngine.h"
|
||||
#include "IBootstrapperApplication.h"
|
||||
|
||||
#include "BalBaseBootstrapperApplication.h"
|
||||
#include "balinfo.h"
|
||||
#include "balcondition.h"
|
||||
|
||||
HRESULT CreateBootstrapperApplication(
|
||||
__in HMODULE hModule,
|
||||
__in BOOL fPrereq,
|
||||
__in HRESULT hrHostInitialization,
|
||||
__in IBootstrapperEngine* pEngine,
|
||||
__in const BOOTSTRAPPER_COMMAND* pCommand,
|
||||
__out IBootstrapperApplication** ppApplication
|
||||
);
|
||||
|
||||
#include "IBootstrapperBAFunction.h"
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="wixstdba.cpp" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//
|
||||
// <summary>
|
||||
// Setup chainer/bootstrapper standard UI for WiX toolset.
|
||||
// </summary>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
#include "pch.h"
|
||||
|
||||
static HINSTANCE vhInstance = NULL;
|
||||
|
||||
extern "C" BOOL WINAPI DllMain(
|
||||
IN HINSTANCE hInstance,
|
||||
IN DWORD dwReason,
|
||||
IN LPVOID /* pvReserved */
|
||||
)
|
||||
{
|
||||
switch(dwReason)
|
||||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
::DisableThreadLibraryCalls(hInstance);
|
||||
vhInstance = hInstance;
|
||||
break;
|
||||
|
||||
case DLL_PROCESS_DETACH:
|
||||
vhInstance = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
|
||||
__in IBootstrapperEngine* pEngine,
|
||||
__in const BOOTSTRAPPER_COMMAND* pCommand,
|
||||
__out IBootstrapperApplication** ppApplication
|
||||
)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
|
||||
BalInitialize(pEngine);
|
||||
|
||||
hr = CreateBootstrapperApplication(vhInstance, FALSE, S_OK, pEngine, pCommand, ppApplication);
|
||||
BalExitOnFailure(hr, "Failed to create bootstrapper application interface.");
|
||||
|
||||
LExit:
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
extern "C" void WINAPI BootstrapperApplicationDestroy()
|
||||
{
|
||||
BalUninitialize();
|
||||
}
|
||||
|
||||
|
||||
extern "C" HRESULT WINAPI MbaPrereqBootstrapperApplicationCreate(
|
||||
__in HRESULT hrHostInitialization,
|
||||
__in IBootstrapperEngine* pEngine,
|
||||
__in const BOOTSTRAPPER_COMMAND* pCommand,
|
||||
__out IBootstrapperApplication** ppApplication
|
||||
)
|
||||
{
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
|
||||
extern "C" void WINAPI MbaPrereqBootstrapperApplicationDestroy()
|
||||
{ }
|
|
@ -1,18 +0,0 @@
|
|||
;-------------------------------------------------------------------------------------------------
|
||||
; <copyright file="wixstdba.def" company="Outercurve Foundation">
|
||||
; Copyright (c) 2004, Outercurve Foundation.
|
||||
; This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
; The license and further copyright text can be found in the file
|
||||
; LICENSE.TXT at the root directory of the distribution.
|
||||
; </copyright>
|
||||
;
|
||||
; <summary>
|
||||
; WiX Standard Bootstrapper Application DLL entry points.
|
||||
; </summary>
|
||||
;-------------------------------------------------------------------------------------------------
|
||||
|
||||
EXPORTS
|
||||
BootstrapperApplicationCreate
|
||||
BootstrapperApplicationDestroy
|
||||
MbaPrereqBootstrapperApplicationCreate
|
||||
MbaPrereqBootstrapperApplicationDestroy
|
|
@ -1,22 +0,0 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.30501.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonba", "pythonba.vcxproj", "{7A09B132-B3EE-499B-A700-A4B2157FEA3D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{7A09B132-B3EE-499B-A700-A4B2157FEA3D}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -1,71 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
<copyright file="wixstdba.vcxproj" company="Outercurve Foundation">
|
||||
Copyright (c) 2004, Outercurve Foundation.
|
||||
This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
The license and further copyright text can be found in the file
|
||||
LICENSE.TXT at the root directory of the distribution.
|
||||
</copyright>
|
||||
-->
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
|
||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</PlatformToolset>
|
||||
<PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</PlatformToolset>
|
||||
<ProjectGuid>{7A09B132-B3EE-499B-A700-A4B2157FEA3D}</ProjectGuid>
|
||||
<TargetName>PythonBA</TargetName>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\wix.props" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<Py_IntDir Condition="'$(Py_IntDir)' == ''">$(PySourcePath)PCbuild\obj\</Py_IntDir>
|
||||
<IntDir>$(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\msi_$(ProjectName)\</IntDir>
|
||||
<IntDir>$(IntDir.Replace(`\\`, `\`))</IntDir>
|
||||
<OutDir>$(IntDir)</OutDir>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ItemDefinitionGroup>
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_CRT_STDIO_LEGACY_WIDE_SPECIFIERS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(WixInstallPath)sdk\inc</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v140'">$(WixInstallPath)sdk\vs2015\lib\x86</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v120'">$(WixInstallPath)sdk\vs2013\lib\x86</AdditionalLibraryDirectories>
|
||||
<ModuleDefinitionFile>pythonba.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation Condition="'$(Configuration)'=='Debug'">true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="PythonBootstrapperApplication.cpp" />
|
||||
<ClCompile Include="pythonba.cpp" />
|
||||
<ClCompile Include="pch.cpp">
|
||||
<PrecompiledHeader>Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="pch.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="pythonba.def" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
</Project>
|
|
@ -1,25 +0,0 @@
|
|||
//-------------------------------------------------------------------------------------------------
|
||||
// <copyright file="resource.h" company="Outercurve Foundation">
|
||||
// Copyright (c) 2004, Outercurve Foundation.
|
||||
// This software is released under Microsoft Reciprocal License (MS-RL).
|
||||
// The license and further copyright text can be found in the file
|
||||
// LICENSE.TXT at the root directory of the distribution.
|
||||
// </copyright>
|
||||
//-------------------------------------------------------------------------------------------------
|
||||
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
//
|
||||
#define IDC_STATIC -1
|
||||
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 102
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1003
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
106
third_party/python/Tools/msi/bundle/bundle.targets
vendored
106
third_party/python/Tools/msi/bundle/bundle.targets
vendored
|
@ -1,106 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="DownloadUrl">
|
||||
<PropertyGroup>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputType>Bundle</OutputType>
|
||||
|
||||
<BootstrapConfiguration Condition="'$(BootstrapConfiguration)' == ''">Release</BootstrapConfiguration>
|
||||
<LinkerSuppressSpecificWarnings>1132;1135;1140</LinkerSuppressSpecificWarnings>
|
||||
<OutputName Condition="$(BuildForRelease)">$(OutputName)-$(PythonVersion)</OutputName>
|
||||
<OutputName Condition="!$(BuildForRelease)">$(OutputName)-$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber).$(RevisionNumber)</OutputName>
|
||||
<OutputName Condition="$(Platform) == 'x64'">$(OutputName)-amd64</OutputName>
|
||||
<OutputName Condition="'$(OutputSuffix)' != ''">$(OutputName)-$(OutputSuffix)</OutputName>
|
||||
<OutputName Condition="'$(Configuration)' == 'Debug'">$(OutputName)-d</OutputName>
|
||||
<TargetName>$(OutputName)</TargetName>
|
||||
|
||||
<OutputPath>$(OutputPath)en-us\</OutputPath>
|
||||
<OutDir>$(OutputPath)</OutDir>
|
||||
|
||||
<!-- See Tools/msi/buildrelease.bat for help on configuring the download URL -->
|
||||
<DownloadUrl Condition="'$(DownloadUrl)' == '' and '$(DownloadUrlBase)' != ''">$(DownloadUrlBase.TrimEnd(`/`))/{version}/{arch}{releasename}/{msi}</DownloadUrl>
|
||||
<DefineConstants Condition="'$(DownloadUrl)' != ''">$(DefineConstants);DownloadUrl=$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseLevelName)`).Replace(`{msi}`, `{2}`))</DefineConstants>
|
||||
<DefineConstants Condition="'$(DownloadUrl)' == ''">$(DefineConstants);DownloadUrl={2}</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
<HintPath>WixUtilExtension</HintPath>
|
||||
<Name>WixUtilExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixDependencyExtension">
|
||||
<HintPath>WixDependencyExtension</HintPath>
|
||||
<Name>WixDependencyExtension</Name>
|
||||
</WixExtension>
|
||||
<WixExtension Include="WixBalExtension">
|
||||
<HintPath>WixBalExtension</HintPath>
|
||||
<Name>WixBalExtension</Name>
|
||||
</WixExtension>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="bundle.wxs" />
|
||||
<Compile Include="packagegroups\*.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Default.thm" />
|
||||
<Content Include="Default.wxl" />
|
||||
<Content Include="SideBar.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="bundle.wxl" />
|
||||
<WxlTemplate Include="*_en-US.wxl_template" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<LinkerBindInputPaths Include="$(OutputPath)">
|
||||
<BindName></BindName>
|
||||
</LinkerBindInputPaths>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<Package>
|
||||
<Properties>BuildForRelease=$(BuildForRelease)</Properties>
|
||||
</Package>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Package Include="..\core\core*.wixproj" />
|
||||
<Package Include="..\dev\dev*.wixproj" />
|
||||
<Package Include="..\doc\doc*.wixproj" />
|
||||
<Package Include="..\exe\exe*.wixproj" />
|
||||
<Package Include="..\lib\lib*.wixproj" />
|
||||
<Package Include="..\path\path*.wixproj" />
|
||||
<Package Include="..\pip\pip*.wixproj" />
|
||||
<Package Include="..\tcltk\tcltk*.wixproj" />
|
||||
<Package Include="..\test\test*.wixproj" />
|
||||
<Package Include="..\tools\tools*.wixproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<BuildPackagesTargets>Build</BuildPackagesTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="_SetRebuildTarget" BeforeTargets="BeforeRebuild">
|
||||
<PropertyGroup>
|
||||
<BuildPackagesTargets>Rebuild</BuildPackagesTargets>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildPackages" BeforeTargets="BeforeBuild" Condition="'$(RebuildAll)' != 'false'">
|
||||
<MSBuild Projects="@(Package)" Targets="$(BuildPackagesTargets)" BuildInParallel="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildBootstrapApplication" BeforeTargets="BeforeBuild">
|
||||
<Message Text="Building bootstrap app" Importance="high" />
|
||||
|
||||
<MSBuild Projects="bootstrap\pythonba.vcxproj"
|
||||
Targets="Build;GetNativeTargetPath"
|
||||
UseResultsCache="true"
|
||||
Properties="Configuration=$(BootstrapConfiguration);Platform=Win32">
|
||||
<Output TaskParameter="TargetOutputs" PropertyName="BootstrapAppPath" />
|
||||
</MSBuild>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);BootstrapApp=$(BootstrapAppPath)</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="CRTDescription">C Runtime Update (KB2999226)</String>
|
||||
<String Id="CompileAllDescription">Precompiling standard library</String>
|
||||
<String Id="CompileAllODescription">Precompiling standard library (-O)</String>
|
||||
<String Id="CompileAllOODescription">Precompiling standard library (-OO)</String>
|
||||
</WixLocalization>
|
112
third_party/python/Tools/msi/bundle/bundle.wxs
vendored
112
third_party/python/Tools/msi/bundle/bundle.wxs
vendored
|
@ -1,112 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
|
||||
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
|
||||
xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
|
||||
<Bundle Name="!(loc.FullProductName)"
|
||||
UpgradeCode="$(var.CoreUpgradeCode)"
|
||||
Version="$(var.Version)"
|
||||
IconSourceFile="..\..\..\PC\icons\setup.ico"
|
||||
Manufacturer="!(loc.Manufacturer)"
|
||||
AboutUrl="http://www.python.org/"
|
||||
Compressed="no"
|
||||
dep:ProviderKey="CPython-$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)">
|
||||
<BootstrapperApplication Id="PythonBA" SourceFile="$(var.BootstrapApp)">
|
||||
<Payload Compressed='yes' SourceFile='Default.thm' />
|
||||
<Payload Compressed='yes' SourceFile='Default.wxl' />
|
||||
<Payload Compressed='yes' SourceFile='SideBar.png' />
|
||||
</BootstrapperApplication>
|
||||
|
||||
<!-- May be set to "Removing" or "Repairing" -->
|
||||
<Variable Name="ActionLikeInstalling" Value="Installing" />
|
||||
<!-- May be set to "Uninstallation" or "Repair" -->
|
||||
<Variable Name="ActionLikeInstallation" Value="Setup" />
|
||||
|
||||
<Variable Name="ShortVersion" Value="$(var.MajorVersionNumber).$(var.MinorVersionNumber)" />
|
||||
<Variable Name="ShortVersionNoDot" Value="$(var.MajorVersionNumber)$(var.MinorVersionNumber)" />
|
||||
<Variable Name="WinVer" Value="$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)" />
|
||||
<Variable Name="WinVerNoDot" Value="$(var.MajorVersionNumber)$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)" />
|
||||
|
||||
<Variable Name="InstallAllUsers" Value="0" bal:Overridable="yes" />
|
||||
<?if "$(var.PyTestExt)"="" ?>
|
||||
<Variable Name="InstallLauncherAllUsers" Value="1" bal:Overridable="yes" />
|
||||
<?else ?>
|
||||
<Variable Name="InstallLauncherAllUsers" Value="0" />
|
||||
<?endif ?>
|
||||
<Variable Name="TargetDir" Value="" bal:Overridable="yes" />
|
||||
<?if $(var.Platform)~="x64" ?>
|
||||
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFiles64Folder]Python[WinVerNoDot]" bal:Overridable="yes" />
|
||||
<Variable Name="TargetPlatform" Value="x64" />
|
||||
<?else ?>
|
||||
<Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFilesFolder]Python[WinVerNoDot]" bal:Overridable="yes" />
|
||||
<Variable Name="TargetPlatform" Value="x86" />
|
||||
<?endif ?>
|
||||
<Variable Name="DefaultJustForMeTargetDir" Value="[LocalAppDataFolder]Programs\Python\Python[WinVerNoDot]" bal:Overridable="yes" />
|
||||
<Variable Name="OptionalFeaturesRegistryKey" Value="Software\Python\PythonCore\[WinVer]\InstalledFeatures" />
|
||||
<Variable Name="TargetDirRegistryKey" Value="Software\Python\PythonCore\[WinVer]\InstallPath" />
|
||||
|
||||
<!--
|
||||
An empty string will use the other defaults based on InstallAllUsers
|
||||
(and switch dynamically in the UI). To get the old default, pass
|
||||
this property on the command line:
|
||||
DefaultCustomTargetDir=[WindowsVolume]Python[ShortVersionNoDot]
|
||||
-->
|
||||
<Variable Name="DefaultCustomTargetDir" Value="" bal:Overridable="yes" />
|
||||
|
||||
<Variable Name="InstallAllUsersState" Value="enabled" bal:Overridable="yes" />
|
||||
<?if "$(var.PyTestExt)"="" ?>
|
||||
<Variable Name="InstallLauncherAllUsersState" Value="enabled" bal:Overridable="yes" />
|
||||
<?else ?>
|
||||
<Variable Name="InstallLauncherAllUsersState" Value="disable" bal:Overridable="yes" />
|
||||
<?endif ?>
|
||||
<Variable Name="CustomInstallLauncherAllUsersState" Value="[InstallLauncherAllUsersState]" />
|
||||
<Variable Name="TargetDirState" Value="enabled" />
|
||||
<Variable Name="CustomBrowseButtonState" Value="enabled" />
|
||||
|
||||
<Variable Name="Include_core" Value="1" />
|
||||
<Variable Name="Include_exe" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_dev" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_lib" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_test" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_doc" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_tools" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_tcltk" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_pip" Value="1" bal:Overridable="yes" />
|
||||
<?if "$(var.PyTestExt)"="" ?>
|
||||
<Variable Name="Include_launcher" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Include_launcherState" Value="enabled" bal:Overridable="yes" />
|
||||
<?else ?>
|
||||
<Variable Name="Include_launcher" Value="0" />
|
||||
<Variable Name="Include_launcherState" Value="disable" />
|
||||
<?endif ?>
|
||||
<Variable Name="Include_symbols" Value="0" bal:Overridable="yes" />
|
||||
<Variable Name="Include_debug" Value="0" bal:Overridable="yes" />
|
||||
|
||||
<Variable Name="LauncherOnly" Value="0" bal:Overridable="yes" />
|
||||
<Variable Name="DetectedLauncher" Value="0" />
|
||||
<Variable Name="DetectedOldLauncher" Value="0" />
|
||||
|
||||
<Variable Name="AssociateFiles" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="Shortcuts" Value="1" bal:Overridable="yes" />
|
||||
<Variable Name="PrependPath" Value="0" bal:Overridable="yes" />
|
||||
<Variable Name="CompileAll" Value="0" bal:Overridable="yes" />
|
||||
|
||||
<Variable Name="SimpleInstall" Value="0" bal:Overridable="yes" />
|
||||
<Variable Name="SimpleInstallDescription" Value="" bal:Overridable="yes" />
|
||||
|
||||
<Chain ParallelCache="yes">
|
||||
<PackageGroupRef Id="crt" />
|
||||
<PackageGroupRef Id="core" />
|
||||
<PackageGroupRef Id="dev" />
|
||||
<PackageGroupRef Id="exe" />
|
||||
<PackageGroupRef Id="lib" />
|
||||
<PackageGroupRef Id="test" />
|
||||
<PackageGroupRef Id="doc" />
|
||||
<PackageGroupRef Id="tools" />
|
||||
<PackageGroupRef Id="tcltk" />
|
||||
<PackageGroupRef Id="launcher" />
|
||||
<PackageGroupRef Id="pip" />
|
||||
<PackageGroupRef Id="packageinstall" />
|
||||
<PackageGroupRef Id="postinstall" />
|
||||
</Chain>
|
||||
</Bundle>
|
||||
</Wix>
|
21
third_party/python/Tools/msi/bundle/full.wixproj
vendored
21
third_party/python/Tools/msi/bundle/full.wixproj
vendored
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{3E204ADD-238D-4D10-852C-4F859325C839}</ProjectGuid>
|
||||
<OutputName>python</OutputName>
|
||||
<OutputSuffix>full</OutputSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\msi.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>
|
||||
$(DefineConstants);
|
||||
CompressMSI=yes;
|
||||
CompressPDB=yes;
|
||||
CompressMSI_D=yes;
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="bundle.targets" />
|
||||
</Project>
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="core">
|
||||
<MsiPackage Id="core_AllUsers"
|
||||
SourceFile="core.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="core_AllUsers_pdb"
|
||||
SourceFile="core_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="core_AllUsers_d"
|
||||
SourceFile="core_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="core_JustForMe"
|
||||
SourceFile="core.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="core_JustForMe_pdb"
|
||||
SourceFile="core_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="core_JustForMe_d"
|
||||
SourceFile="core_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and (Include_core or Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="crt">
|
||||
<PackageGroupRef Id="crt_14.0_v6.0" />
|
||||
<PackageGroupRef Id="crt_14.0_v6.1" />
|
||||
<PackageGroupRef Id="crt_14.0_v6.2" />
|
||||
<PackageGroupRef Id="crt_14.0_v6.3" />
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
|
||||
<?foreach ver in v6.0;v6.1;v6.2;v6.3 ?>
|
||||
<?if "$(var.ver)" = "v6.0" ?>
|
||||
<?define msuver=6.0 ?>
|
||||
<?elseif "$(var.ver)" = "v6.1" ?>
|
||||
<?define msuver=6.1 ?>
|
||||
<?elseif "$(var.ver)" = "v6.2" ?>
|
||||
<?define msuver=8-RT ?>
|
||||
<?elseif "$(var.ver)" = "v6.3" ?>
|
||||
<?define msuver=8.1 ?>
|
||||
<?else ?>
|
||||
<?error unknown version $(var.ver) ?>
|
||||
<?endif ?>
|
||||
|
||||
<Fragment>
|
||||
<PackageGroup Id="crt_14.0_$(var.ver)">
|
||||
<MsuPackage Id="crt_14.0_$(var.ver)_x86"
|
||||
KB="2999226"
|
||||
SourceFile="!(bindpath.redist)\Windows$(var.msuver)-KB2999226-x86.msu"
|
||||
DisplayName="!(loc.CRTDescription)"
|
||||
Description="!(loc.CRTDescription)"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
InstallCondition="not CRTInstalled and VersionNT = $(var.ver) and not VersionNT64 and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly" />
|
||||
|
||||
<MsuPackage Id="crt_14.0_$(var.ver)_x64"
|
||||
KB="2999226"
|
||||
SourceFile="!(bindpath.redist)\Windows$(var.msuver)-KB2999226-x64.msu"
|
||||
DisplayName="!(loc.CRTDescription)"
|
||||
Description="!(loc.CRTDescription)"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
InstallCondition="not CRTInstalled and VersionNT64 = $(var.ver) and (Include_core or Include_exe or Include_launcher or Include_pip) and not LauncherOnly" />
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
|
||||
<?undef msuver ?>
|
||||
<?endforeach ?>
|
||||
</Wix>
|
|
@ -1,44 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="dev">
|
||||
<MsiPackage Id="dev_AllUsers"
|
||||
SourceFile="dev.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_dev and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="dev_AllUsers_d"
|
||||
SourceFile="dev_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_dev and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="dev_JustForMe"
|
||||
SourceFile="dev.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_dev and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="dev_JustForMe_d"
|
||||
SourceFile="dev_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_dev and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="doc">
|
||||
<MsiPackage Id="doc_AllUsers"
|
||||
SourceFile="doc.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
EnableFeatureSelection="yes"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_doc and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="doc_JustForMe"
|
||||
SourceFile="doc.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
EnableFeatureSelection="yes"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_doc and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,64 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="exe">
|
||||
<MsiPackage Id="exe_AllUsers"
|
||||
SourceFile="exe.msi"
|
||||
ForcePerMachine="yes"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="exe_AllUsers_pdb"
|
||||
SourceFile="exe_pdb.msi"
|
||||
ForcePerMachine="yes"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="exe_AllUsers_d"
|
||||
SourceFile="exe_d.msi"
|
||||
ForcePerMachine="yes"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
InstallCondition="InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="exe_JustForMe"
|
||||
SourceFile="exe.msi"
|
||||
ForcePerMachine="no"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="exe_JustForMe_pdb"
|
||||
SourceFile="exe_pdb.msi"
|
||||
ForcePerMachine="no"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="exe_JustForMe_d"
|
||||
SourceFile="exe_d.msi"
|
||||
ForcePerMachine="no"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
InstallCondition="not InstallAllUsers and (Include_exe or Include_launcher or Include_pip) and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="launcher">
|
||||
<!-- The All Users launcher is always the 32-bit version -->
|
||||
<MsiPackage Id="launcher_AllUsers"
|
||||
SourceFile="!(bindpath.build32)en-us\launcher.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
EnableFeatureSelection="yes"
|
||||
Permanent="yes"
|
||||
Visible="yes"
|
||||
InstallCondition="(InstallAllUsers or InstallLauncherAllUsers) and Include_launcher and not DetectedLauncher" />
|
||||
|
||||
<MsiPackage Id="launcher_JustForMe"
|
||||
SourceFile="!(bindpath.build32)en-us\launcher.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
EnableFeatureSelection="yes"
|
||||
Permanent="yes"
|
||||
Visible="yes"
|
||||
InstallCondition="not (InstallAllUsers or InstallLauncherAllUsers) and Include_launcher and not DetectedLauncher" />
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="lib">
|
||||
<MsiPackage Id="lib_AllUsers"
|
||||
SourceFile="lib.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_lib and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="lib_AllUsers_pdb"
|
||||
SourceFile="lib_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_lib and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="lib_AllUsers_d"
|
||||
SourceFile="lib_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_lib and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="lib_JustForMe"
|
||||
SourceFile="lib.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_lib and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="lib_JustForMe_pdb"
|
||||
SourceFile="lib_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_lib and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="lib_JustForMe_d"
|
||||
SourceFile="lib_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_lib and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="packageinstall">
|
||||
<!--
|
||||
This is an example of installing a package using pip as part of main install.
|
||||
|
||||
For a network-only install, remove the Payload element and change the install
|
||||
command to specify the package and (optionally) version specifier.
|
||||
|
||||
<ExePackage Id="requests"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllDescription)"
|
||||
InstallCommand='-[WinVer] -m pip install requests-2.7.0-py2.py3-none-any.whl'
|
||||
UninstallCommand='-[WinVer] -m pip uninstall -y requests'
|
||||
Vital="no"
|
||||
InstallCondition="Include_pip and not LauncherOnly">
|
||||
<Payload SourceFile="requests-2.7.0-py2.py3-none-any.whl"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)" />
|
||||
</ExePackage>
|
||||
-->
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="pip">
|
||||
<MsiPackage Id="pip_AllUsers"
|
||||
SourceFile="pip.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_pip and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="pip_JustForMe"
|
||||
SourceFile="pip.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_pip and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,88 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="postinstall">
|
||||
<MsiPackage Id="path_AllUsers"
|
||||
SourceFile="path.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and PrependPath and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="path_JustForMe"
|
||||
SourceFile="path.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and PrependPath and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<?define CompileAllCommand=-E -s -Wi "[TargetDir]\Lib\compileall.py" -f -x "bad_coding|badsyntax|site-packages|py2_|lib2to3\\tests|venv\\scripts" "[TargetDir]\Lib"?>
|
||||
<ExePackage Id="compileall_AllUsers"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllDescription)"
|
||||
InstallCommand='-[WinVer] $(var.CompileAllCommand)'
|
||||
RepairCommand='-[WinVer] $(var.CompileAllCommand)'
|
||||
Permanent="yes"
|
||||
PerMachine="yes"
|
||||
Vital="no"
|
||||
InstallCondition="InstallAllUsers and CompileAll and not LauncherOnly" />
|
||||
<ExePackage Id="compileallO_AllUsers"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllODescription)"
|
||||
InstallCommand='-[WinVer] -O $(var.CompileAllCommand)'
|
||||
RepairCommand='-[WinVer] -O $(var.CompileAllCommand)'
|
||||
Permanent="yes"
|
||||
PerMachine="yes"
|
||||
Vital="no"
|
||||
InstallCondition="InstallAllUsers and CompileAll and not LauncherOnly" />
|
||||
<ExePackage Id="compileallOO_AllUsers"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllOODescription)"
|
||||
InstallCommand='-[WinVer] -OO $(var.CompileAllCommand)'
|
||||
RepairCommand='-[WinVer] -OO $(var.CompileAllCommand)'
|
||||
Permanent="yes"
|
||||
PerMachine="yes"
|
||||
Vital="no"
|
||||
InstallCondition="InstallAllUsers and CompileAll and not LauncherOnly" />
|
||||
|
||||
<ExePackage Id="compileall_JustForMe"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllDescription)"
|
||||
InstallCommand='-[WinVer] $(var.CompileAllCommand)'
|
||||
RepairCommand='-[WinVer] $(var.CompileAllCommand)'
|
||||
Permanent="yes"
|
||||
PerMachine="no"
|
||||
Vital="no"
|
||||
InstallCondition="not InstallAllUsers and CompileAll and not LauncherOnly" />
|
||||
<ExePackage Id="compileallO_JustForMe"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllODescription)"
|
||||
InstallCommand='-[WinVer] -O $(var.CompileAllCommand)'
|
||||
RepairCommand='-[WinVer] -O $(var.CompileAllCommand)'
|
||||
Permanent="yes"
|
||||
PerMachine="no"
|
||||
Vital="no"
|
||||
InstallCondition="not InstallAllUsers and CompileAll and not LauncherOnly" />
|
||||
<ExePackage Id="compileallOO_JustForMe"
|
||||
SourceFile="py.exe"
|
||||
Compressed="yes"
|
||||
DisplayName="!(loc.CompileAllOODescription)"
|
||||
InstallCommand='-[WinVer] -OO $(var.CompileAllCommand)'
|
||||
RepairCommand='-[WinVer] -OO $(var.CompileAllCommand)'
|
||||
Permanent="yes"
|
||||
PerMachine="no"
|
||||
Vital="no"
|
||||
InstallCondition="not InstallAllUsers and CompileAll and not LauncherOnly" />
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,68 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="tcltk">
|
||||
<MsiPackage Id="tcltk_AllUsers"
|
||||
SourceFile="tcltk.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="InstallAllUsers and Include_tcltk and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="tcltk_AllUsers_pdb"
|
||||
SourceFile="tcltk_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="InstallAllUsers and Include_tcltk and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="tcltk_AllUsers_d"
|
||||
SourceFile="tcltk_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="InstallAllUsers and Include_tcltk and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="tcltk_JustForMe"
|
||||
SourceFile="tcltk.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="not InstallAllUsers and Include_tcltk and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="tcltk_JustForMe_pdb"
|
||||
SourceFile="tcltk_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="not InstallAllUsers and Include_tcltk and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="tcltk_JustForMe_d"
|
||||
SourceFile="tcltk_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
EnableFeatureSelection="yes"
|
||||
InstallCondition="not InstallAllUsers and Include_tcltk and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,62 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="test">
|
||||
<MsiPackage Id="test_AllUsers"
|
||||
SourceFile="test.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_test and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="test_AllUsers_pdb"
|
||||
SourceFile="test_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_test and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="test_AllUsers_d"
|
||||
SourceFile="test_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_test and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="test_JustForMe"
|
||||
SourceFile="test.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_test and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="test_JustForMe_pdb"
|
||||
SourceFile="test_pdb.msi"
|
||||
Compressed="$(var.CompressPDB)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_test and Include_symbols and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
<MsiPackage Id="test_JustForMe_d"
|
||||
SourceFile="test_d.msi"
|
||||
Compressed="$(var.CompressMSI_D)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_test and Include_debug and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PackageGroup Id="tools">
|
||||
<MsiPackage Id="tools_AllUsers"
|
||||
SourceFile="tools.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="yes"
|
||||
InstallCondition="InstallAllUsers and Include_tools and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
|
||||
<MsiPackage Id="tools_JustForMe"
|
||||
SourceFile="tools.msi"
|
||||
Compressed="$(var.CompressMSI)"
|
||||
DownloadUrl="$(var.DownloadUrl)"
|
||||
ForcePerMachine="no"
|
||||
InstallCondition="not InstallAllUsers and Include_tools and not LauncherOnly">
|
||||
<MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
|
||||
<MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
|
||||
</MsiPackage>
|
||||
</PackageGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{FCD43AC9-969F-49A1-8AC5-EDC27599D1EB}</ProjectGuid>
|
||||
<OutputName>python</OutputName>
|
||||
<OutputSuffix></OutputSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\msi.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>
|
||||
$(DefineConstants);
|
||||
CompressMSI=yes;
|
||||
CompressPDB=no;
|
||||
CompressMSI_D=no
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="bundle.targets" />
|
||||
</Project>
|
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{71CDE213-CB39-4BD9-B89D-BBB878689144}</ProjectGuid>
|
||||
<OutputName>python</OutputName>
|
||||
<OutputSuffix>webinstall</OutputSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\msi.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>
|
||||
$(DefineConstants);
|
||||
CompressMSI=no;
|
||||
CompressPDB=no;
|
||||
CompressMSI_D=no
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="bundle.targets" />
|
||||
</Project>
|
|
@ -1,26 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{8A4A1162-4BF9-4FF6-9A98-315F01E44932}</ProjectGuid>
|
||||
<OutputName>python</OutputName>
|
||||
<OutputSuffix></OutputSuffix>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="..\msi.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants Condition="'$(Pack)' != 'true'">
|
||||
$(DefineConstants);CompressMSI=no;
|
||||
</DefineConstants>
|
||||
<DefineConstants Condition="'$(Pack)' == 'true'">
|
||||
$(DefineConstants);CompressMSI=yes;
|
||||
</DefineConstants>
|
||||
<DefineConstants>
|
||||
$(DefineConstants);
|
||||
CompressPDB=no;
|
||||
CompressMSI_D=no;
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="bundle.targets" />
|
||||
</Project>
|
122
third_party/python/Tools/msi/common.wxs
vendored
122
third_party/python/Tools/msi/common.wxs
vendored
|
@ -1,122 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<Property Id="ROOTREGISTRYKEY" Value="Software\Python\PythonCore" />
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<Property Id="REGISTRYKEY" Value="Software\Python\PythonCore\$(var.ShortVersion)$(var.PyArchExt)$(var.PyTestExt)" />
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<Component Id="OptionalFeature" Guid="*" Directory="InstallDirectory">
|
||||
<Condition>OPTIONALFEATURESREGISTRYKEY</Condition>
|
||||
<RegistryKey Root="HKMU" Key="[OPTIONALFEATURESREGISTRYKEY]">
|
||||
<RegistryValue Type="string" Name="$(var.OptionalFeatureName)" Value="$(var.Version)" KeyPath="yes" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<Property Id="UpgradeTable" Value="1" />
|
||||
|
||||
<?ifndef SuppressUpgradeTable ?>
|
||||
<Upgrade Id="$(var.UpgradeCode)">
|
||||
<UpgradeVersion Property="DOWNGRADE" Minimum="$(var.Version)" IncludeMinimum="no" OnlyDetect="yes" />
|
||||
<UpgradeVersion Property="UPGRADE" Minimum="$(var.UpgradeMinimumVersion)" IncludeMinimum="yes" Maximum="$(var.Version)" IncludeMaximum="no" />
|
||||
</Upgrade>
|
||||
<?endif ?>
|
||||
|
||||
<?ifdef CoreUpgradeCode ?>
|
||||
<?if $(var.UpgradeCode)!=$(var.CoreUpgradeCode) ?>
|
||||
<Upgrade Id="$(var.CoreUpgradeCode)">
|
||||
<UpgradeVersion Property="MISSING_CORE" Minimum="$(var.Version)" IncludeMinimum="yes" Maximum="$(var.Version)" IncludeMaximum="yes" OnlyDetect="yes" />
|
||||
</Upgrade>
|
||||
<Condition Message="!(loc.IncorrectCore)">Installed OR NOT MISSING_CORE</Condition>
|
||||
<?endif ?>
|
||||
<?endif ?>
|
||||
|
||||
<Condition Message="!(loc.NoDowngrade)">Installed OR NOT DOWNGRADE</Condition>
|
||||
<Condition Message="!(loc.NoTargetDir)">Installed OR TARGETDIR OR Suppress_TARGETDIR_Check</Condition>
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<RemoveExistingProducts After="InstallInitialize" Overridable="yes">UPGRADE</RemoveExistingProducts>
|
||||
</InstallExecuteSequence>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<!-- Include an icon for the Programs and Features dialog -->
|
||||
<Icon Id="ARPIcon" SourceFile="!(bindpath.src)PC\icons\python.ico" />
|
||||
<Property Id="ARPPRODUCTICON" Value="ARPIcon" />
|
||||
<Property Id="ARPNOMODIFY" Value="1" />
|
||||
<Property Id="DISABLEADVTSHORTCUTS" Value="1" />
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<?ifdef InstallDirectoryGuidSeed ?>
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="InstallDirectory" ComponentGuidGenerationSeed="$(var.InstallDirectoryGuidSeed)" />
|
||||
</Directory>
|
||||
<?endif ?>
|
||||
</Fragment>
|
||||
|
||||
<!-- Top-level directories -->
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="DLLs" Name="DLLs">
|
||||
<Directory Id="Catalogs" />
|
||||
</Directory>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="Doc" Name="Doc" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="include" Name="include" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="Lib" Name="Lib" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="libs" Name="libs" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="Scripts" Name="Scripts" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="tcl" Name="tcl" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<DirectoryRef Id="InstallDirectory">
|
||||
<Directory Id="Tools" Name="Tools" />
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
|
||||
<!-- Start Menu folder -->
|
||||
<Fragment>
|
||||
<DirectoryRef Id="TARGETDIR">
|
||||
<Directory Id="ProgramMenuFolder">
|
||||
<Directory Id="MenuDir" Name="!(loc.ProductName)" />
|
||||
</Directory>
|
||||
</DirectoryRef>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="LCID">1033</String>
|
||||
<String Id="Culture">en-us</String>
|
||||
<String Id="ProductName">Python {{ShortVersion}}</String>
|
||||
<String Id="FullProductName">Python {{LongVersion}} ({{Bitness}})</String>
|
||||
<String Id="Title">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}})</String>
|
||||
<String Id="Description">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}})</String>
|
||||
<String Id="TitlePdb">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} symbols)</String>
|
||||
<String Id="DescriptionPdb">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} symbols)</String>
|
||||
<String Id="Title_d">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} debug)</String>
|
||||
<String Id="Description_d">Python {{LongVersion}} !(loc.Descriptor) ({{Bitness}} debug)</String>
|
||||
<String Id="Manufacturer">Python Software Foundation</String>
|
||||
<String Id="NoDowngrade">A newer version of !(loc.ProductName) is already installed.</String>
|
||||
<String Id="IncorrectCore">An incorrect version of a prerequisite package is installed. Please uninstall any other versions of !(loc.ProductName) and try installing this again.</String>
|
||||
<String Id="NoTargetDir">The TARGETDIR variable must be provided when invoking this installer.</String>
|
||||
<String Id="ManufacturerSupportUrl">http://www.python.org/</String>
|
||||
</WixLocalization>
|
127
third_party/python/Tools/msi/csv_to_wxs.py
vendored
127
third_party/python/Tools/msi/csv_to_wxs.py
vendored
|
@ -1,127 +0,0 @@
|
|||
'''
|
||||
Processes a CSV file containing a list of files into a WXS file with
|
||||
components for each listed file.
|
||||
|
||||
The CSV columns are:
|
||||
source of file, target for file, group name
|
||||
|
||||
Usage::
|
||||
py txt_to_wxs.py [path to file list .csv] [path to destination .wxs]
|
||||
|
||||
This is necessary to handle structures where some directories only
|
||||
contain other directories. MSBuild is not able to generate the
|
||||
Directory entries in the WXS file correctly, as it operates on files.
|
||||
Python, however, can easily fill in the gap.
|
||||
'''
|
||||
|
||||
__author__ = "Steve Dower <steve.dower@microsoft.com>"
|
||||
|
||||
import csv
|
||||
import re
|
||||
import sys
|
||||
|
||||
from collections import defaultdict
|
||||
from itertools import chain, zip_longest
|
||||
from pathlib import PureWindowsPath
|
||||
from uuid import uuid1
|
||||
|
||||
ID_CHAR_SUBS = {
|
||||
'-': '_',
|
||||
'+': '_P',
|
||||
}
|
||||
|
||||
def make_id(path):
|
||||
return re.sub(
|
||||
r'[^A-Za-z0-9_.]',
|
||||
lambda m: ID_CHAR_SUBS.get(m.group(0), '_'),
|
||||
str(path).rstrip('/\\'),
|
||||
flags=re.I
|
||||
)
|
||||
|
||||
DIRECTORIES = set()
|
||||
|
||||
def main(file_source, install_target):
|
||||
with open(file_source, 'r', newline='') as f:
|
||||
files = list(csv.reader(f))
|
||||
|
||||
assert len(files) == len(set(make_id(f[1]) for f in files)), "Duplicate file IDs exist"
|
||||
|
||||
directories = defaultdict(set)
|
||||
cache_directories = defaultdict(set)
|
||||
groups = defaultdict(list)
|
||||
for source, target, group, disk_id, condition in files:
|
||||
target = PureWindowsPath(target)
|
||||
groups[group].append((source, target, disk_id, condition))
|
||||
|
||||
if target.suffix.lower() in {".py", ".pyw"}:
|
||||
cache_directories[group].add(target.parent)
|
||||
|
||||
for dirname in target.parents:
|
||||
parent = make_id(dirname.parent)
|
||||
if parent and parent != '.':
|
||||
directories[parent].add(dirname.name)
|
||||
|
||||
lines = [
|
||||
'<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">',
|
||||
' <Fragment>',
|
||||
]
|
||||
for dir_parent in sorted(directories):
|
||||
lines.append(' <DirectoryRef Id="{}">'.format(dir_parent))
|
||||
for dir_name in sorted(directories[dir_parent]):
|
||||
lines.append(' <Directory Id="{}_{}" Name="{}" />'.format(dir_parent, make_id(dir_name), dir_name))
|
||||
lines.append(' </DirectoryRef>')
|
||||
for dir_parent in (make_id(d) for group in cache_directories.values() for d in group):
|
||||
lines.append(' <DirectoryRef Id="{}">'.format(dir_parent))
|
||||
lines.append(' <Directory Id="{}___pycache__" Name="__pycache__" />'.format(dir_parent))
|
||||
lines.append(' </DirectoryRef>')
|
||||
lines.append(' </Fragment>')
|
||||
|
||||
for group in sorted(groups):
|
||||
lines.extend([
|
||||
' <Fragment>',
|
||||
' <ComponentGroup Id="{}">'.format(group),
|
||||
])
|
||||
for source, target, disk_id, condition in groups[group]:
|
||||
lines.append(' <Component Id="{}" Directory="{}" Guid="*">'.format(make_id(target), make_id(target.parent)))
|
||||
if condition:
|
||||
lines.append(' <Condition>{}</Condition>'.format(condition))
|
||||
|
||||
if disk_id:
|
||||
lines.append(' <File Id="{}" Name="{}" Source="{}" DiskId="{}" />'.format(make_id(target), target.name, source, disk_id))
|
||||
else:
|
||||
lines.append(' <File Id="{}" Name="{}" Source="{}" />'.format(make_id(target), target.name, source))
|
||||
lines.append(' </Component>')
|
||||
|
||||
create_folders = {make_id(p) + "___pycache__" for p in cache_directories[group]}
|
||||
remove_folders = {make_id(p2) for p1 in cache_directories[group] for p2 in chain((p1,), p1.parents)}
|
||||
create_folders.discard(".")
|
||||
remove_folders.discard(".")
|
||||
if create_folders or remove_folders:
|
||||
lines.append(' <Component Id="{}__pycache__folders" Directory="TARGETDIR" Guid="{}">'.format(group, uuid1()))
|
||||
lines.extend(' <CreateFolder Directory="{}" />'.format(p) for p in create_folders)
|
||||
lines.extend(' <RemoveFile Id="Remove_{0}_files" Name="*" On="uninstall" Directory="{0}" />'.format(p) for p in create_folders)
|
||||
lines.extend(' <RemoveFolder Id="Remove_{0}_folder" On="uninstall" Directory="{0}" />'.format(p) for p in create_folders | remove_folders)
|
||||
lines.append(' </Component>')
|
||||
|
||||
lines.extend([
|
||||
' </ComponentGroup>',
|
||||
' </Fragment>',
|
||||
])
|
||||
lines.append('</Wix>')
|
||||
|
||||
# Check if the file matches. If so, we don't want to touch it so
|
||||
# that we can skip rebuilding.
|
||||
try:
|
||||
with open(install_target, 'r') as f:
|
||||
if all(x.rstrip('\r\n') == y for x, y in zip_longest(f, lines)):
|
||||
print('File is up to date')
|
||||
return
|
||||
except IOError:
|
||||
pass
|
||||
|
||||
with open(install_target, 'w') as f:
|
||||
f.writelines(line + '\n' for line in lines)
|
||||
print('Wrote {} lines to {}'.format(len(lines), install_target))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main(sys.argv[1], sys.argv[2])
|
49
third_party/python/Tools/msi/dev/dev.wixproj
vendored
49
third_party/python/Tools/msi/dev/dev.wixproj
vendored
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{5F23F608-D74B-4259-A0CE-8DC65CC7FE53}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName Condition="'$(OutputName)' == ''">dev</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<PropertyGroup>
|
||||
<DefineConstants Condition="$(BuildForRelease)">
|
||||
$(DefineConstants);
|
||||
IncludeMinGWLib=1;
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="dev.wxs" />
|
||||
<Compile Include="dev_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InstallFiles Include="$(PySourcePath)include\*.h">
|
||||
<SourceBase>$(PySourcePath)</SourceBase>
|
||||
<Source>!(bindpath.src)</Source>
|
||||
<TargetBase>$(PySourcePath)</TargetBase>
|
||||
<Target_></Target_>
|
||||
<Group>dev_include</Group>
|
||||
</InstallFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="BuildMinGWLib"
|
||||
Inputs="$(BuildPath)$(PyDllName).dll"
|
||||
Outputs="$(BuildPath)lib$(PyDllName).a"
|
||||
AfterTargets="PrepareForBuild"
|
||||
Condition="$(BuildForRelease)">
|
||||
<!-- Build libpython##.a as part of this project. This requires gendef and dlltool on the path. -->
|
||||
<PropertyGroup>
|
||||
<_DllToolOpts>-m i386 --as-flags=--32</_DllToolOpts>
|
||||
<_DllToolOpts Condition="$(Platform) == 'x64'">-m i386:x86-64</_DllToolOpts>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command='gendef - "$(BuildPath)$(PyDllName).dll" > "$(IntermediateOutputPath)mingwlib.def"' ContinueOnError="false" />
|
||||
<Exec Command='dlltool --dllname $(PyDllName).dll --def "$(IntermediateOutputPath)mingwlib.def" --output-lib "$(BuildPath)lib$(PyDllName).a" $(_DllToolOpts)' />
|
||||
</Target>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
19
third_party/python/Tools/msi/dev/dev.wxs
vendored
19
third_party/python/Tools/msi/dev/dev.wxs
vendored
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="dev_include" />
|
||||
<ComponentGroupRef Id="dev_pyconfig" />
|
||||
<ComponentGroupRef Id="dev_libs" />
|
||||
<?ifdef IncludeMinGWLib ?>
|
||||
<ComponentGroupRef Id="dev_mingw" />
|
||||
<?endif ?>
|
||||
<ComponentRef Id="OptionalFeature" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
19
third_party/python/Tools/msi/dev/dev_d.wixproj
vendored
19
third_party/python/Tools/msi/dev/dev_d.wixproj
vendored
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{C11B4945-76BD-4137-B2E3-649460117A77}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>dev_d</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="dev_d.wxs" />
|
||||
<Compile Include="dev_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
13
third_party/python/Tools/msi/dev/dev_d.wxs
vendored
13
third_party/python/Tools/msi/dev/dev_d.wxs
vendored
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title_d)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
|
||||
<ComponentGroupRef Id="dev_libs_d" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Descriptor">Development Libraries</String>
|
||||
<String Id="ShortDescriptor">dev</String>
|
||||
</WixLocalization>
|
42
third_party/python/Tools/msi/dev/dev_files.wxs
vendored
42
third_party/python/Tools/msi/dev/dev_files.wxs
vendored
|
@ -1,42 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="dev_pyconfig">
|
||||
<Component Id="include_pyconfig.h" Directory="include" Guid="*">
|
||||
<File Id="include_pyconfig.h" Name="pyconfig.h" Source="!(bindpath.src)PC\pyconfig.h" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="dev_libs">
|
||||
<Component Id="libs_python3.lib" Directory="libs" Guid="*">
|
||||
<File Id="libs_python_stable.lib" Name="python$(var.MajorVersionNumber).lib" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="libs_python.lib" Directory="libs" Guid="*">
|
||||
<File Id="libs_python.lib" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber).lib" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="dev_libs_d">
|
||||
<Component Id="libs_python3_d.lib" Directory="libs" Guid="*">
|
||||
<File Id="libs_python_stable_d.lib" Name="python$(var.MajorVersionNumber)_d.lib" />
|
||||
</Component>
|
||||
<Component Id="libs_python_d.lib" Directory="libs" Guid="*">
|
||||
<File Id="libs_python_d.lib" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)_d.lib" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<?ifdef IncludeMinGWLib ?>
|
||||
<Fragment>
|
||||
<ComponentGroup Id="dev_mingw">
|
||||
<Component Id="libs_libpython.a" Directory="libs" Guid="*">
|
||||
<File Id="libs_libpython.a" Name="libpython$(var.MajorVersionNumber)$(var.MinorVersionNumber).a" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
<?endif ?>
|
||||
</Wix>
|
|
@ -1,23 +0,0 @@
|
|||
"""distutils.command.bdist_wininst
|
||||
|
||||
Suppresses the 'bdist_wininst' command, while still allowing
|
||||
setuptools to import it without breaking."""
|
||||
|
||||
from distutils.core import Command
|
||||
from distutils.errors import DistutilsPlatformError
|
||||
|
||||
class bdist_wininst(Command):
|
||||
description = "create an executable installer for MS Windows"
|
||||
|
||||
# Marker for tests that we have the unsupported bdist_wininst
|
||||
_unsupported = True
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
raise DistutilsPlatformError("bdist_wininst is not supported "
|
||||
"in this Python distribution")
|
30
third_party/python/Tools/msi/doc/doc.wixproj
vendored
30
third_party/python/Tools/msi/doc/doc.wixproj
vendored
|
@ -1,30 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{0D62A2BB-5F71-4447-8C8C-9708407B3674}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>doc</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<!-- Shortcut validation is not necessary -->
|
||||
<SuppressICEs>ICE43</SuppressICEs>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<PropertyGroup>
|
||||
<DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
|
||||
<IncludeDocFile>false</IncludeDocFile>
|
||||
<IncludeDocFile Condition="$(BuildForRelease) or Exists('$(PySourcePath)Doc\build\htmlhelp\$(DocFilename)')">true</IncludeDocFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="$(IncludeDocFile)">
|
||||
<DefineConstants>$(DefineConstants);DocFilename=$(DocFilename);</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="doc.wxs" />
|
||||
<Compile Include="doc_files.wxs" Condition="$(IncludeDocFile)" />
|
||||
<Compile Include="doc_no_files.wxs" Condition="!$(IncludeDocFile)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
41
third_party/python/Tools/msi/doc/doc.wxs
vendored
41
third_party/python/Tools/msi/doc/doc.wxs
vendored
|
@ -1,41 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<Property Id="HHExe" Value="C:\Windows\hh.exe" />
|
||||
<CustomAction Id="SetHHExe" Property="HHCExe" Value='[WindowsFolder]\hh.exe' Execute="immediate" />
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="SetHHExe" Before="CostFinalize">1</Custom>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="doc" Primary="yes" />
|
||||
<ComponentRef Id="OptionalFeature" />
|
||||
</Feature>
|
||||
<Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="doc" />
|
||||
|
||||
<?ifdef DocFilename ?>
|
||||
<Component Id="doc_shortcut" Directory="MenuDir" Guid="*">
|
||||
<RegistryKey Root="HKMU" Key="[OPTIONALFEATURESREGISTRYKEY]">
|
||||
<RegistryValue Name="$(var.OptionalFeatureName)_shortcut" Type="string" Value="$(var.Version)" KeyPath="yes" />
|
||||
</RegistryKey>
|
||||
<Shortcut Id="python.chm"
|
||||
Target="[HHExe]"
|
||||
Arguments="[#python.chm]"
|
||||
Name="!(loc.ShortcutName)"
|
||||
Description="!(loc.ShortcutDescription)"
|
||||
WorkingDirectory="InstallDirectory"
|
||||
Show="maximized" />
|
||||
<RemoveFolder Id="Remove_MenuDir" On="uninstall" />
|
||||
</Component>
|
||||
<?endif ?>
|
||||
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,7 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="ShortDescriptor">doc</String>
|
||||
<String Id="Descriptor">Documentation</String>
|
||||
<String Id="ShortcutName">Python {{ShortVersion}} Manuals ({{Bitness}})</String>
|
||||
<String Id="ShortcutDescription">View the !(loc.ProductName) documentation.</String>
|
||||
</WixLocalization>
|
15
third_party/python/Tools/msi/doc/doc_files.wxs
vendored
15
third_party/python/Tools/msi/doc/doc_files.wxs
vendored
|
@ -1,15 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<ComponentGroup Id="doc">
|
||||
<Component Id="python.chm" Directory="Doc" Guid="*">
|
||||
<File Id="python.chm" Name="$(var.DocFilename)" KeyPath="yes" />
|
||||
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue Key="Help\Main Python Documentation" Type="string" Value="[#python.chm]" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="doc">
|
||||
<!--
|
||||
This file is included when the CHM is not available.
|
||||
|
||||
This way, snapshot builds can succeed without having to
|
||||
build the docs.
|
||||
-->
|
||||
<Component Id="EmptyDocFolder" Directory="Doc" Guid="{22FD42DB-EC66-4B1C-B1FC-44E0CF7B2462}">
|
||||
<CreateFolder />
|
||||
<RemoveFolder Id="Remove_EmptyDocFolder" On="uninstall" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
41
third_party/python/Tools/msi/exe/crtlicense.txt
vendored
41
third_party/python/Tools/msi/exe/crtlicense.txt
vendored
|
@ -1,41 +0,0 @@
|
|||
|
||||
|
||||
Additional Conditions for this Windows binary build
|
||||
---------------------------------------------------
|
||||
|
||||
This program is linked with and uses Microsoft Distributable Code,
|
||||
copyrighted by Microsoft Corporation. The Microsoft Distributable Code
|
||||
is embedded in each .exe, .dll and .pyd file as a result of running
|
||||
the code through a linker.
|
||||
|
||||
If you further distribute programs that include the Microsoft
|
||||
Distributable Code, you must comply with the restrictions on
|
||||
distribution specified by Microsoft. In particular, you must require
|
||||
distributors and external end users to agree to terms that protect the
|
||||
Microsoft Distributable Code at least as much as Microsoft's own
|
||||
requirements for the Distributable Code. See Microsoft's documentation
|
||||
(included in its developer tools and on its website at microsoft.com)
|
||||
for specific details.
|
||||
|
||||
Redistribution of the Windows binary build of the Python interpreter
|
||||
complies with this agreement, provided that you do not:
|
||||
|
||||
- alter any copyright, trademark or patent notice in Microsoft's
|
||||
Distributable Code;
|
||||
|
||||
- use Microsoft's trademarks in your programs' names or in a way that
|
||||
suggests your programs come from or are endorsed by Microsoft;
|
||||
|
||||
- distribute Microsoft's Distributable Code to run on a platform other
|
||||
than Microsoft operating systems, run-time technologies or application
|
||||
platforms; or
|
||||
|
||||
- include Microsoft Distributable Code in malicious, deceptive or
|
||||
unlawful programs.
|
||||
|
||||
These restrictions apply only to the Microsoft Distributable Code as
|
||||
defined above, not to Python itself or any programs running on the
|
||||
Python interpreter. The redistribution of the Python interpreter and
|
||||
libraries is governed by the Python Software License included with this
|
||||
file, or by other licenses as marked.
|
||||
|
66
third_party/python/Tools/msi/exe/exe.wixproj
vendored
66
third_party/python/Tools/msi/exe/exe.wixproj
vendored
|
@ -1,66 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{6BD53305-B03E-49DC-85FB-5551B8CCC843}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>exe</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Shortcut validation is not necessary -->
|
||||
<SuppressICEs>ICE43</SuppressICEs>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="exe.wxs" />
|
||||
<Compile Include="exe_files.wxs" />
|
||||
<Compile Include="exe_reg.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_GenerateLicense" AfterTargets="PrepareForBuild">
|
||||
<ItemGroup>
|
||||
<LicenseFiles Include="$(PySourcePath)LICENSE;
|
||||
crtlicense.txt;
|
||||
$(bz2Dir)LICENSE;
|
||||
$(opensslDir)LICENSE;
|
||||
$(tclDir)license.terms;
|
||||
$(tkDir)license.terms;
|
||||
$(tixDir)license.terms" />
|
||||
<_LicenseFiles Include="@(LicenseFiles)">
|
||||
<Content>$([System.IO.File]::ReadAllText(%(FullPath)))</Content>
|
||||
</_LicenseFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<WriteLinesToFile File="$(BuildPath)LICENSE"
|
||||
Overwrite="true"
|
||||
Lines="@(_LicenseFiles->'%(Content)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_CopyMiscNews" AfterTargets="PrepareForBuild" Condition="Exists('$(PySourcePath)Misc\NEWS')">
|
||||
<Copy SourceFiles="$(PySourcePath)Misc\NEWS" DestinationFiles="$(BuildPath)NEWS.txt" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_MergeMiscNewsWithBlurb" AfterTargets="PrepareForBuild" Condition="$(Blurb) != '' and !Exists('$(PySourcePath)Misc\NEWS')">
|
||||
<Exec Command="$(Blurb) merge -f "$(BuildPath)NEWS.txt"" WorkingDirectory="$(PCBuild)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_MergeMiscNewsWithPython" AfterTargets="PrepareForBuild" Condition="$(Blurb) == '' and !Exists('$(PySourcePath)Misc\NEWS')">
|
||||
<ItemGroup>
|
||||
<HostPython Include="$(ExternalsDir)python*\tools\python.exe" />
|
||||
<HostPython Include="@(HostPython)" Condition="Exists(%(FullPath))" />
|
||||
<HostPython Include="py" Condition="@(HostPython) == ''" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<HostPython>@(HostPython)</HostPython>
|
||||
<HostPython Condition="$(HostPython.Contains(';'))">$(HostPython.Remove($(HostPython.IndexOf(';'))))</HostPython>
|
||||
</PropertyGroup>
|
||||
<Exec Command=""$(HostPython)" -m pip install -U blurb" WorkingDirectory="$(PCBuild)" />
|
||||
<Exec Command=""$(HostPython)" -m blurb merge -f "$(BuildPath)NEWS.txt"" WorkingDirectory="$(PCBuild)" />
|
||||
</Target>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
33
third_party/python/Tools/msi/exe/exe.wxs
vendored
33
third_party/python/Tools/msi/exe/exe.wxs
vendored
|
@ -1,33 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="exe_python" Primary="yes" />
|
||||
<ComponentGroupRef Id="exe_reg" Primary="yes" />
|
||||
<ComponentGroupRef Id="exe_txt" />
|
||||
<ComponentGroupRef Id="exe_icons" />
|
||||
<ComponentRef Id="OptionalFeature" />
|
||||
</Feature>
|
||||
|
||||
<Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="exe_python" />
|
||||
<Component Id="exe_shortcut" Directory="MenuDir" Guid="*">
|
||||
<Shortcut Id="python.exe"
|
||||
Target="[#python.exe]"
|
||||
Name="!(loc.ShortcutName)"
|
||||
Description="!(loc.ShortcutDescription)"
|
||||
WorkingDirectory="InstallDirectory" />
|
||||
<RemoveFolder Id="Remove_MenuDir" Directory="MenuDir" On="uninstall" />
|
||||
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue Key="InstalledFeatures" Name="Shortcuts" Type="string" Value="$(var.Version)" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
21
third_party/python/Tools/msi/exe/exe_d.wixproj
vendored
21
third_party/python/Tools/msi/exe/exe_d.wixproj
vendored
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{B1CA739C-8DB0-403B-9010-D79507507CE9}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>exe_d</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="exe_d.wxs" />
|
||||
<Compile Include="exe_files.wxs" />
|
||||
<Compile Include="exe_reg.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
13
third_party/python/Tools/msi/exe/exe_d.wxs
vendored
13
third_party/python/Tools/msi/exe/exe_d.wxs
vendored
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title_d)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
|
||||
<ComponentGroupRef Id="exe_python_d" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,8 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Descriptor">Executables</String>
|
||||
<String Id="ShortDescriptor">executable</String>
|
||||
<String Id="ShortcutName">Python {{ShortVersion}} ({{Bitness}})</String>
|
||||
<String Id="ShortcutDescription">Launches the !(loc.ProductName) interpreter.</String>
|
||||
<String Id="SupportUrl">http://www.python.org/</String>
|
||||
</WixLocalization>
|
79
third_party/python/Tools/msi/exe/exe_files.wxs
vendored
79
third_party/python/Tools/msi/exe/exe_files.wxs
vendored
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="exe_txt">
|
||||
<Component Id="LICENSE.txt" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="LICENSE.txt" Source="LICENSE" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="NEWS.txt" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="NEWS.txt" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<ComponentGroup Id="exe_python">
|
||||
<Component Id="python.exe" Directory="InstallDirectory" Guid="$(var.PythonExeComponentGuid)">
|
||||
<File Name="python.exe" KeyPath="yes" />
|
||||
|
||||
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue Key="InstallPath" Type="string" Value="[InstallDirectory]" KeyPath="no" />
|
||||
<RegistryValue Key="InstallPath" Name="ExecutablePath" Type="string" Value="[#python.exe]" KeyPath="no" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
<Component Id="pythonw.exe" Directory="InstallDirectory" Guid="$(var.PythonwExeComponentGuid)">
|
||||
<File Name="pythonw.exe" KeyPath="yes" />
|
||||
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue Key="InstallPath" Name="WindowedExecutablePath" Type="string" Value="[#pythonw.exe]" KeyPath="no" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
<Component Id="vcruntime140.dll" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="vcruntime140.dll" Source="!(bindpath.redist)vcruntime140.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="exe_python_symbols">
|
||||
<Component Id="python.pdb" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="python.pdb" />
|
||||
</Component>
|
||||
<Component Id="pythonw.pdb" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="pythonw.pdb" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="exe_python_d">
|
||||
<Component Id="python_d.exe" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="python_d.exe" />
|
||||
</Component>
|
||||
<Component Id="python_d.pdb" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="python_d.pdb" />
|
||||
</Component>
|
||||
<Component Id="pythonw_d.exe" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="pythonw_d.exe" />
|
||||
</Component>
|
||||
<Component Id="pythonw_d.pdb" Directory="InstallDirectory" Guid="*">
|
||||
<File Name="pythonw_d.pdb" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="exe_icons">
|
||||
<Component Id="py.ico" Directory="DLLs" Guid="*">
|
||||
<File Name="py.ico" Source="!(bindpath.src)PC\icons\py.ico" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="pyc.ico" Directory="DLLs" Guid="*">
|
||||
<File Name="pyc.ico" Source="!(bindpath.src)PC\icons\pyc.ico" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="pyd.ico" Directory="DLLs" Guid="*">
|
||||
<File Name="pyd.ico" Source="!(bindpath.src)PC\icons\pyd.ico" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
21
third_party/python/Tools/msi/exe/exe_pdb.wixproj
vendored
21
third_party/python/Tools/msi/exe/exe_pdb.wixproj
vendored
|
@ -1,21 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{4A1F7045-8EE2-4276-ABB8-5E0C40E5F38B}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>exe_pdb</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="exe_pdb.wxs" />
|
||||
<Compile Include="exe_files.wxs" />
|
||||
<Compile Include="exe_reg.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
13
third_party/python/Tools/msi/exe/exe_pdb.wxs
vendored
13
third_party/python/Tools/msi/exe/exe_pdb.wxs
vendored
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.TitlePdb)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
|
||||
<ComponentGroupRef Id="exe_python_symbols" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
25
third_party/python/Tools/msi/exe/exe_reg.wxs
vendored
25
third_party/python/Tools/msi/exe/exe_reg.wxs
vendored
|
@ -1,25 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<PropertyRef Id="ROOTREGISTRYKEY" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<ComponentGroup Id="exe_reg">
|
||||
<Component Id="CommonPythonRegistration" Directory="InstallDirectory" Guid="$(var.CommonPythonRegComponentGuid)">
|
||||
<RegistryKey Root="HKMU" Key="[ROOTREGISTRYKEY]">
|
||||
<RegistryValue Name="DisplayName" Type="string" Value="!(loc.Manufacturer)" KeyPath="yes" />
|
||||
<RegistryValue Name="SupportUrl" Type="string" Value="!(loc.ManufacturerSupportUrl)" KeyPath="no" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
<Component Id="PythonRegistration" Directory="InstallDirectory" Guid="$(var.PythonRegComponentGuid)">
|
||||
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue Name="DisplayName" Type="string" Value="!(loc.ShortcutName)" KeyPath="yes" />
|
||||
<RegistryValue Name="SupportUrl" Type="string" Value="!(loc.SupportUrl)" KeyPath="no" />
|
||||
<RegistryValue Name="Version" Type="string" Value="$(var.LongVersion)" KeyPath="no" />
|
||||
<RegistryValue Name="SysVersion" Type="string" Value="$(var.ShortVersion)" KeyPath="no" />
|
||||
<RegistryValue Name="SysArchitecture" Type="string" Value="$(var.PlatformArchitecture)" KeyPath="no" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
27
third_party/python/Tools/msi/generate_md5.py
vendored
27
third_party/python/Tools/msi/generate_md5.py
vendored
|
@ -1,27 +0,0 @@
|
|||
import hashlib
|
||||
import os
|
||||
import sys
|
||||
|
||||
def main():
|
||||
filenames, hashes, sizes = [], [], []
|
||||
|
||||
for file in sys.argv[1:]:
|
||||
if not os.path.isfile(file):
|
||||
continue
|
||||
|
||||
with open(file, 'rb') as f:
|
||||
data = f.read()
|
||||
md5 = hashlib.md5()
|
||||
md5.update(data)
|
||||
filenames.append(os.path.split(file)[1])
|
||||
hashes.append(md5.hexdigest())
|
||||
sizes.append(str(len(data)))
|
||||
|
||||
print('{:40s} {:<32s} {:<9s}'.format('File', 'MD5', 'Size'))
|
||||
for f, h, s in zip(filenames, hashes, sizes):
|
||||
print('{:40s} {:>32s} {:>9s}'.format(f, h, s))
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(int(main() or 0))
|
91
third_party/python/Tools/msi/get_externals.bat
vendored
91
third_party/python/Tools/msi/get_externals.bat
vendored
|
@ -1,91 +0,0 @@
|
|||
@echo off
|
||||
setlocal
|
||||
rem Simple script to fetch source for external libraries
|
||||
|
||||
set HERE=%~dp0
|
||||
if "%PCBUILD%"=="" (set PCBUILD=%HERE%..\..\PCbuild\)
|
||||
if "%EXTERNALS_DIR%"=="" (set EXTERNALS_DIR=%HERE%..\..\externals\windows-installer)
|
||||
if "%NUGET%"=="" (set NUGET=%EXTERNALS_DIR%\..\nuget.exe)
|
||||
if "%NUGET_URL%"=="" (set NUGET_URL=https://aka.ms/nugetclidl)
|
||||
|
||||
set DO_FETCH=true
|
||||
set DO_CLEAN=false
|
||||
|
||||
:CheckOpts
|
||||
if "%~1"=="--python" (set PYTHON=%2) & shift & shift & goto CheckOpts
|
||||
if "%~1"=="--organization" (set ORG=%2) & shift & shift & goto CheckOpts
|
||||
if "%~1"=="-c" (set DO_CLEAN=true) & shift & goto CheckOpts
|
||||
if "%~1"=="--clean" (set DO_CLEAN=true) & shift & goto CheckOpts
|
||||
if "%~1"=="--clean-only" (set DO_FETCH=false) & goto clean
|
||||
if "x%~1" NEQ "x" goto usage
|
||||
|
||||
if "%DO_CLEAN%"=="false" goto fetch
|
||||
:clean
|
||||
echo.Cleaning up external libraries.
|
||||
if exist "%EXTERNALS_DIR%" (
|
||||
rem Sometimes this fails the first time; try it twice
|
||||
rmdir /s /q "%EXTERNALS_DIR%" || rmdir /s /q "%EXTERNALS_DIR%"
|
||||
)
|
||||
|
||||
if "%DO_FETCH%"=="false" goto end
|
||||
:fetch
|
||||
|
||||
if "%ORG%"=="" (set ORG=python)
|
||||
|
||||
call "%PCBUILD%\find_python.bat" "%PYTHON%"
|
||||
|
||||
echo.Fetching external libraries...
|
||||
|
||||
set libraries=
|
||||
|
||||
for %%e in (%libraries%) do (
|
||||
if exist "%EXTERNALS_DIR%\%%e" (
|
||||
echo.%%e already exists, skipping.
|
||||
) else (
|
||||
echo.Fetching %%e...
|
||||
%PYTHON% "%PCBUILD%get_external.py" -e "%EXTERNALS_DIR%" -O %ORG% %%e
|
||||
)
|
||||
)
|
||||
|
||||
echo.Fetching external tools...
|
||||
|
||||
set binaries=
|
||||
rem We always use whatever's latest in the repo for these
|
||||
set binaries=%binaries% binutils
|
||||
set binaries=%binaries% gpg
|
||||
set binaries=%binaries% htmlhelp
|
||||
set binaries=%binaries% nuget
|
||||
set binaries=%binaries% redist
|
||||
set binaries=%binaries% wix
|
||||
|
||||
for %%b in (%binaries%) do (
|
||||
if exist "%EXTERNALS_DIR%\%%b" (
|
||||
echo.%%b already exists, skipping.
|
||||
) else (
|
||||
echo.Fetching %%b...
|
||||
%PYTHON% "%PCBUILD%get_external.py" -e "%EXTERNALS_DIR%" -b -O %ORG% %%b
|
||||
)
|
||||
)
|
||||
|
||||
echo Finished.
|
||||
goto end
|
||||
|
||||
:usage
|
||||
echo.Valid options: -c, --clean, --clean-only, --organization, --python,
|
||||
echo.--no-tkinter, --no-openssl
|
||||
echo.
|
||||
echo.Pull all sources and binaries necessary for compiling optional extension
|
||||
echo.modules that rely on external libraries.
|
||||
echo.
|
||||
echo.The --organization option determines which github organization to download
|
||||
echo.from, the --python option determines which Python 3.6+ interpreter to use
|
||||
echo.with PCbuild\get_external.py.
|
||||
echo.
|
||||
echo.Use the -c or --clean option to remove the entire externals directory.
|
||||
echo.
|
||||
echo.Use the --clean-only option to do the same cleaning, without pulling in
|
||||
echo.anything new.
|
||||
echo.
|
||||
exit /b -1
|
||||
|
||||
:end
|
|
@ -1,36 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{921CF0E6-AEBC-4376-BA1D-CD46EBFE6DA5}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>launcher</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<DefineConstants>UpgradeCode=1B68A0EC-4DD3-5134-840E-73854B0863F1;SuppressUpgradeTable=1;$(DefineConstants)</DefineConstants>
|
||||
<IgnoreCommonWxlTemplates>true</IgnoreCommonWxlTemplates>
|
||||
<SuppressICEs>ICE80</SuppressICEs>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="launcher.wxs" />
|
||||
<Compile Include="launcher_files.wxs" />
|
||||
<Compile Include="launcher_reg.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_EnsurePyEx86" Condition="!Exists('$(BuildPath32)py.exe')" BeforeTargets="PrepareForBuild">
|
||||
<MSBuild Projects="$(PySourcePath)PCBuild\pylauncher.vcxproj" Properties="Platform=Win32" />
|
||||
</Target>
|
||||
<Target Name="_EnsurePywEx86" Condition="!Exists('$(BuildPath32)pyw.exe')" BeforeTargets="PrepareForBuild">
|
||||
<MSBuild Projects="$(PySourcePath)PCBuild\pywlauncher.vcxproj" Properties="Platform=Win32" />
|
||||
</Target>
|
||||
<Target Name="_EnsurePyShellExt86" Condition="!Exists('$(BuildPath32)pyshellext.dll')" BeforeTargets="PrepareForBuild">
|
||||
<MSBuild Projects="$(PySourcePath)PCBuild\pyshellext.vcxproj" Properties="Platform=Win32" />
|
||||
</Target>
|
||||
<Target Name="_EnsurePyShellExt64" Condition="!Exists('$(BuildPath64)pyshellext.dll')" BeforeTargets="PrepareForBuild">
|
||||
<MSBuild Projects="$(PySourcePath)PCBuild\pyshellext.vcxproj" Properties="Platform=x64" />
|
||||
</Target>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
|
@ -1,49 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<Property Id="Suppress_TARGETDIR_Check" Value="1" />
|
||||
<Icon Id="ARPIcon" SourceFile="!(bindpath.src)PC\icons\launcher.ico" />
|
||||
<Property Id="ARPPRODUCTICON" Value="ARPIcon" />
|
||||
<Property Id="ARPNOMODIFY" Value="1" />
|
||||
<Property Id="DISABLEADVTSHORTCUTS" Value="1" />
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="launcher_exe" Primary="yes" />
|
||||
</Feature>
|
||||
<Feature Id="AssociateFiles" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="launcher_exe" />
|
||||
<ComponentGroupRef Id="launcher_reg" />
|
||||
</Feature>
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="LauncherInstallDirectory" />
|
||||
</Directory>
|
||||
|
||||
<CustomAction Id="SetLauncherInstallDirectoryLM" Property="LauncherInstallDirectory" Value="[WindowsFolder]" />
|
||||
<CustomAction Id="SetLauncherInstallDirectoryCU" Property="LauncherInstallDirectory" Value="[LocalAppDataFolder]Programs\Python\Launcher" />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Before="SetLauncherInstallDirectoryLM" Action="SetLauncherInstallDirectoryCU">NOT Installed AND NOT ALLUSERS=1</Custom>
|
||||
<Custom Before="CostFinalize" Action="SetLauncherInstallDirectoryLM">NOT Installed AND ALLUSERS=1</Custom>
|
||||
|
||||
<RemoveExistingProducts After="InstallValidate">UPGRADE or REMOVE_350_LAUNCHER or REMOVE_360A1_LAUNCHER</RemoveExistingProducts>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<!-- Upgrade all versions of the launcher -->
|
||||
<Upgrade Id="$(var.UpgradeCode)">
|
||||
<UpgradeVersion Property="DOWNGRADE" Minimum="$(var.Version)" IncludeMinimum="no" OnlyDetect="yes" />
|
||||
<UpgradeVersion Property="UPGRADE" Minimum="0.0.0.0" IncludeMinimum="yes" Maximum="$(var.Version)" IncludeMaximum="no" />
|
||||
</Upgrade>
|
||||
<!-- Python 3.5.0 shipped with a different UpgradeCode -->
|
||||
<Upgrade Id="A71530B9-E89D-53DB-9C2D-C6D7551876D8">
|
||||
<UpgradeVersion Minimum="0.0.0.0" Property="REMOVE_350_LAUNCHER" />
|
||||
</Upgrade>
|
||||
<!-- Python 3.6.0a1 shipped with a different UpgradeCode -->
|
||||
<Upgrade Id="394750C0-7880-5A8F-999F-933965FBCFB4">
|
||||
<UpgradeVersion Minimum="0.0.0.0" Property="REMOVE_360A1_LAUNCHER" />
|
||||
</Upgrade>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="LCID">1033</String>
|
||||
<String Id="Culture">en-us</String>
|
||||
<String Id="ProductName">Python Launcher</String>
|
||||
<String Id="Title">Python Launcher</String>
|
||||
<String Id="Description">Python Launcher</String>
|
||||
<String Id="Manufacturer">Python Software Foundation</String>
|
||||
<String Id="NoDowngrade">A newer version of the Python launcher is already installed.</String>
|
||||
<String Id="NoTargetDir">The TARGETDIR variable must be provided when invoking this installer.</String>
|
||||
<String Id="PythonFileDescription">Python File</String>
|
||||
<String Id="PythonNoConFileDescription">Python File (no console)</String>
|
||||
<String Id="PythonCompiledFileDescription">Compiled Python File</String>
|
||||
<String Id="PythonExtensionDescription">Python Extension Module</String>
|
||||
<String Id="PythonArchiveFileDescription">Python Zip Application File</String>
|
||||
<String Id="PythonNoConArchiveFileDescription">Python Zip Application File (no console)</String>
|
||||
</WixLocalization>
|
|
@ -1,38 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="launcher_exe">
|
||||
<Component Id="py.exe" Directory="LauncherInstallDirectory" Guid="{B5107402-6958-461B-8B0A-4037D3327160}">
|
||||
<File Id="py.exe" Name="py.exe" Source="py.exe" KeyPath="yes" />
|
||||
<RegistryValue Root="HKMU" Key="Software\Python\PyLauncher" Value="[#py.exe]" Type="string" />
|
||||
</Component>
|
||||
<Component Id="pyw.exe" Directory="LauncherInstallDirectory" Guid="{8E52B8CD-48BB-4D74-84CD-6238BCD11F20}">
|
||||
<File Id="pyw.exe" Name="pyw.exe" Source="pyw.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<Component Id="launcher_path_cu" Directory="LauncherInstallDirectory" Guid="{95AEB930-367C-475C-A17E-A89BFCD4C670}">
|
||||
<Condition>NOT ALLUSERS=1</Condition>
|
||||
|
||||
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher" Name="InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
|
||||
<Environment Id="PATH_CU" Action="set" Name="PATH" Part="first" Value="[LauncherInstallDirectory]" />
|
||||
</Component>
|
||||
<Component Id="launcher_path_lm" Directory="LauncherInstallDirectory" Guid="{4A41C365-4E27-4D38-A6D1-4A01B4A6500C}">
|
||||
<Condition>ALLUSERS=1</Condition>
|
||||
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher" Name="InstallDir" Value="[LauncherInstallDirectory]" Type="string" />
|
||||
</Component>
|
||||
|
||||
<Component Id="pyshellext_amd64.dll" Directory="LauncherInstallDirectory" Guid="{E7411EFD-F1DD-40EB-B0C7-4BA02BF3E75F}" Win64="yes">
|
||||
<Condition>VersionNT64</Condition>
|
||||
<File Id="pyshellext_amd64.dll" Name="pyshellext.amd64.dll" Source="!(bindpath.Build64)\pyshellext.dll">
|
||||
<Class Id="{BEA218D2-6950-497B-9434-61683EC065FE}" Advertise="no" Context="InprocServer32" ThreadingModel="apartment" />
|
||||
</File>
|
||||
</Component>
|
||||
<Component Id="pyshellext_win32.dll" Directory="LauncherInstallDirectory" Guid="{C5936696-9A5A-45A0-A830-D172C3329282}">
|
||||
<Condition>NOT VersionNT64</Condition>
|
||||
<File Id="pyshellext_win32.dll" Name="pyshellext.win32.dll" Source="!(bindpath.Build32)\pyshellext.dll">
|
||||
<Class Id="{BEA218D2-6950-497B-9434-61683EC065FE}" Advertise="no" Context="InprocServer32" ThreadingModel="apartment" />
|
||||
</File>
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="launcher_reg">
|
||||
<Component Id="file_association" Directory="LauncherInstallDirectory" Guid="{5AF84D9A-D820-456B-B230-6E0105A50276}">
|
||||
<RegistryValue KeyPath="yes" Root="HKMU" Key="Software\Python\PyLauncher" Name="AssociateFiles" Value="1" Type="integer" />
|
||||
|
||||
<ProgId Id="Python.File" Description="!(loc.PythonFileDescription)" Advertise="no" Icon="py.exe" IconIndex="1">
|
||||
<Extension Id="py" ContentType="text/plain">
|
||||
<Verb Id="open" TargetFile="py.exe" Argument=""%L" %*" />
|
||||
</Extension>
|
||||
</ProgId>
|
||||
<RegistryValue Root="HKCR" Key="Python.File\shellex\DropHandler" Value="{BEA218D2-6950-497B-9434-61683EC065FE}" Type="string" />
|
||||
|
||||
<ProgId Id="Python.NoConFile" Description="!(loc.PythonNoConFileDescription)" Advertise="no" Icon="py.exe" IconIndex="1">
|
||||
<Extension Id="pyw" ContentType="text/plain">
|
||||
<Verb Id="open" TargetFile="pyw.exe" Argument=""%L" %*" />
|
||||
</Extension>
|
||||
</ProgId>
|
||||
<RegistryValue Root="HKCR" Key="Python.NoConFile\shellex\DropHandler" Value="{BEA218D2-6950-497B-9434-61683EC065FE}" Type="string" />
|
||||
|
||||
<ProgId Id="Python.CompiledFile" Description="!(loc.PythonCompiledFileDescription)" Advertise="no" Icon="py.exe" IconIndex="2">
|
||||
<Extension Id="pyc">
|
||||
<Verb Id="open" TargetFile="py.exe" Argument=""%L" %*" />
|
||||
</Extension>
|
||||
<Extension Id="pyo" />
|
||||
</ProgId>
|
||||
<RegistryValue Root="HKCR" Key="Python.CompiledFile\shellex\DropHandler" Value="{BEA218D2-6950-497B-9434-61683EC065FE}" Type="string" />
|
||||
|
||||
<ProgId Id="Python.Extension" Description="!(loc.PythonExtensionDescription)" Advertise="no" Icon="py.exe" IconIndex="3">
|
||||
<Extension Id="pyd" />
|
||||
</ProgId>
|
||||
|
||||
<ProgId Id="Python.ArchiveFile" Description="!(loc.PythonArchiveFileDescription)" Advertise="no" Icon="py.exe" IconIndex="5">
|
||||
<Extension Id="pyz" ContentType="application/x-zip-compressed">
|
||||
<Verb Id="open" TargetFile="py.exe" Argument=""%L" %*" />
|
||||
</Extension>
|
||||
</ProgId>
|
||||
<RegistryValue Root="HKCR" Key="Python.ArchiveFile\shellex\DropHandler" Value="{BEA218D2-6950-497B-9434-61683EC065FE}" Type="string" />
|
||||
|
||||
<ProgId Id="Python.NoConArchiveFile" Description="!(loc.PythonNoConArchiveFileDescription)" Advertise="no" Icon="py.exe" IconIndex="5">
|
||||
<Extension Id="pyzw" ContentType="application/x-zip-compressed">
|
||||
<Verb Id="open" TargetFile="pyw.exe" Argument=""%L" %*" />
|
||||
</Extension>
|
||||
</ProgId>
|
||||
<RegistryValue Root="HKCR" Key="Python.NoConArchiveFile\shellex\DropHandler" Value="{BEA218D2-6950-497B-9434-61683EC065FE}" Type="string" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
35
third_party/python/Tools/msi/lib/lib.wixproj
vendored
35
third_party/python/Tools/msi/lib/lib.wixproj
vendored
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{11367E76-3337-4602-8F1E-77DB4F370D7E}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>lib</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="lib.wxs" />
|
||||
<Compile Include="lib_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ExcludeFolders Include="Lib\test;Lib\tests;Lib\tkinter;Lib\idlelib;Lib\turtledemo" />
|
||||
<InstallFiles Include="$(PySourcePath)Lib\**\*"
|
||||
Exclude="$(PySourcePath)Lib\**\*.pyc;
|
||||
$(PySourcePath)Lib\**\*.pyo;
|
||||
$(PySourcePath)Lib\site-packages\README;
|
||||
@(ExcludeFolders->'$(PySourcePath)%(Identity)\*');
|
||||
@(ExcludeFolders->'$(PySourcePath)%(Identity)\**\*')">
|
||||
<SourceBase>$(PySourcePath)Lib</SourceBase>
|
||||
<Source>!(bindpath.src)Lib\</Source>
|
||||
<TargetBase>$(PySourcePath)Lib</TargetBase>
|
||||
<Target_>Lib\</Target_>
|
||||
<Group>lib_py</Group>
|
||||
<IncludeInCat>true</IncludeInCat>
|
||||
</InstallFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
18
third_party/python/Tools/msi/lib/lib.wxs
vendored
18
third_party/python/Tools/msi/lib/lib.wxs
vendored
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="lib_py" />
|
||||
<ComponentGroupRef Id="lib_files" />
|
||||
<ComponentGroupRef Id="lib_extensions" />
|
||||
<ComponentGroupRef Id="lib_cat" />
|
||||
<ComponentRef Id="OptionalFeature" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
19
third_party/python/Tools/msi/lib/lib_d.wixproj
vendored
19
third_party/python/Tools/msi/lib/lib_d.wixproj
vendored
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{6C443CD3-8258-4335-BA03-49DA9C34CE4D}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>lib_d</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="lib_d.wxs" />
|
||||
<Compile Include="lib_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
13
third_party/python/Tools/msi/lib/lib_d.wxs
vendored
13
third_party/python/Tools/msi/lib/lib_d.wxs
vendored
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title_d)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
|
||||
<ComponentGroupRef Id="lib_extensions_d" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Descriptor">Standard Library</String>
|
||||
<String Id="ShortDescriptor">lib</String>
|
||||
</WixLocalization>
|
79
third_party/python/Tools/msi/lib/lib_files.wxs
vendored
79
third_party/python/Tools/msi/lib/lib_files.wxs
vendored
|
@ -1,79 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_msi;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3;_asyncio;_distutils_findvs ?>
|
||||
<Fragment>
|
||||
<ComponentGroup Id="lib_extensions">
|
||||
<?foreach ext in $(var.exts)?>
|
||||
|
||||
<Component Id="$(var.ext).pyd" Directory="DLLs" Guid="*">
|
||||
<File Name="$(var.ext).pyd" KeyPath="yes" />
|
||||
</Component>
|
||||
|
||||
<?endforeach ?>
|
||||
|
||||
<Component Id="sqlite3.dll" Directory="DLLs" Guid="*">
|
||||
<File Name="sqlite3.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="lib_extensions_symbols">
|
||||
<?foreach ext in $(var.exts)?>
|
||||
|
||||
<Component Id="$(var.ext).pdb" Directory="DLLs" Guid="*">
|
||||
<File Name="$(var.ext).pdb" />
|
||||
</Component>
|
||||
|
||||
<?endforeach ?>
|
||||
|
||||
<Component Id="sqlite3.pdb" Directory="DLLs" Guid="*">
|
||||
<File Name="sqlite3.pdb" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="lib_extensions_d">
|
||||
<?foreach ext in $(var.exts)?>
|
||||
|
||||
<Component Id="$(var.ext)_d.pyd" Directory="DLLs" Guid="*">
|
||||
<File Name="$(var.ext)_d.pyd" />
|
||||
</Component>
|
||||
<Component Id="$(var.ext)_d.pdb" Directory="DLLs" Guid="*">
|
||||
<File Name="$(var.ext)_d.pdb" />
|
||||
</Component>
|
||||
|
||||
<?endforeach ?>
|
||||
|
||||
<Component Id="sqlite3_d.dll" Directory="DLLs" Guid="*">
|
||||
<File Name="sqlite3_d.dll" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="sqlite3_d.pdb" Directory="DLLs" Guid="*">
|
||||
<File Name="sqlite3_d.pdb" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
<Fragment>
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<ComponentGroup Id="lib_files">
|
||||
<Component Id="PythonPathRegistry" Directory="Lib" Guid="*">
|
||||
<RegistryKey Root="HKMU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue Key="PythonPath" Type="string" Value="[Lib];[DLLs]" />
|
||||
</RegistryKey>
|
||||
</Component>
|
||||
<Component Id="Lib2to3_pickle_remove" Directory="Lib_lib2to3" Guid="$(var.RemoveLib2to3PickleComponentGuid)">
|
||||
<RemoveFile Id="Lib2to3_pickle_remove_files" Name="*.pickle" On="uninstall" />
|
||||
<RemoveFolder Id="Lib2to3_pickle_remove_folder" On="uninstall" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
<Fragment>
|
||||
<ComponentGroup Id="lib_cat">
|
||||
<Component Id="lib_cat" Directory="Catalogs" Guid="*">
|
||||
<File Name="python_lib.cat" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
19
third_party/python/Tools/msi/lib/lib_pdb.wixproj
vendored
19
third_party/python/Tools/msi/lib/lib_pdb.wixproj
vendored
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{5E0BCE93-D1AC-4591-BBCB-3A2BE5A4B3D1}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>lib_pdb</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="lib_pdb.wxs" />
|
||||
<Compile Include="lib_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
13
third_party/python/Tools/msi/lib/lib_pdb.wxs
vendored
13
third_party/python/Tools/msi/lib/lib_pdb.wxs
vendored
|
@ -1,13 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.TitlePdb)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
|
||||
<ComponentGroupRef Id="lib_extensions_symbols" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
39
third_party/python/Tools/msi/make_zip.proj
vendored
39
third_party/python/Tools/msi/make_zip.proj
vendored
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{10487945-15D1-4092-A214-338395C4116B}</ProjectGuid>
|
||||
<OutputName>python</OutputName>
|
||||
<OutputSuffix></OutputSuffix>
|
||||
<SupportSigning>false</SupportSigning>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="msi.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<SignOutput>false</SignOutput>
|
||||
<TargetName>python-$(PythonVersion)-embed-$(ArchName)</TargetName>
|
||||
<TargetExt>.zip</TargetExt>
|
||||
<TargetPath>$(OutputPath)\$(TargetName)$(TargetExt)</TargetPath>
|
||||
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)"</CleanCommand>
|
||||
<Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
|
||||
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(BuildPath.TrimEnd(`\`))"</Arguments>
|
||||
<Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment>
|
||||
<Environment>$(Environment)%0D%0Aset PYTHONPATH=$(PySourcePath)Lib</Environment>
|
||||
<Environment Condition="Exists($(CRTRedist))">$(Environment)%0D%0Aset VCREDIST_PATH=$(CRTRedist)\$(Platform)</Environment>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="_Build">
|
||||
<Exec Command="setlocal%0D%0A$(Environment)%0D%0A$(CleanCommand)%0D%0A$(Arguments)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="AfterBuild" />
|
||||
<Target Name="Build" DependsOnTargets="_Build;AfterBuild" />
|
||||
|
||||
<Target Name="ShowHashes">
|
||||
<ItemGroup>
|
||||
<UserFiles Include="@(File)" Condition="'%(File.CopyTo)' == '$(EXETarget)'" />
|
||||
</ItemGroup>
|
||||
|
||||
<Exec Command=""$(PythonExe)" generate_md5.py @(UserFiles->'"%(FullPath)"',' ')" />
|
||||
</Target>
|
||||
</Project>
|
252
third_party/python/Tools/msi/make_zip.py
vendored
252
third_party/python/Tools/msi/make_zip.py
vendored
|
@ -1,252 +0,0 @@
|
|||
import argparse
|
||||
import py_compile
|
||||
import re
|
||||
import sys
|
||||
import shutil
|
||||
import stat
|
||||
import os
|
||||
import tempfile
|
||||
|
||||
from itertools import chain
|
||||
from pathlib import Path
|
||||
from zipfile import ZipFile, ZIP_DEFLATED
|
||||
import subprocess
|
||||
|
||||
TKTCL_RE = re.compile(r'^(_?tk|tcl).+\.(pyd|dll)', re.IGNORECASE)
|
||||
DEBUG_RE = re.compile(r'_d\.(pyd|dll|exe|pdb|lib)$', re.IGNORECASE)
|
||||
PYTHON_DLL_RE = re.compile(r'python\d\d?\.dll$', re.IGNORECASE)
|
||||
|
||||
DEBUG_FILES = {
|
||||
'_ctypes_test',
|
||||
'_testbuffer',
|
||||
'_testcapi',
|
||||
'_testconsole',
|
||||
'_testimportmultiple',
|
||||
'_testmultiphase',
|
||||
'xxlimited',
|
||||
'python3_dstub',
|
||||
}
|
||||
|
||||
EXCLUDE_FROM_LIBRARY = {
|
||||
'__pycache__',
|
||||
'idlelib',
|
||||
'pydoc_data',
|
||||
'site-packages',
|
||||
'tkinter',
|
||||
'turtledemo',
|
||||
}
|
||||
|
||||
EXCLUDE_FROM_EMBEDDABLE_LIBRARY = {
|
||||
'ensurepip',
|
||||
'venv',
|
||||
}
|
||||
|
||||
EXCLUDE_FILE_FROM_LIBRARY = {
|
||||
'bdist_wininst.py',
|
||||
}
|
||||
|
||||
EXCLUDE_FILE_FROM_LIBS = {
|
||||
'liblzma',
|
||||
'ssleay',
|
||||
'libeay',
|
||||
'python3stub',
|
||||
}
|
||||
|
||||
EXCLUDED_FILES = {
|
||||
'pyshellext',
|
||||
}
|
||||
|
||||
def is_not_debug(p):
|
||||
if DEBUG_RE.search(p.name):
|
||||
return False
|
||||
|
||||
if TKTCL_RE.search(p.name):
|
||||
return False
|
||||
|
||||
return p.stem.lower() not in DEBUG_FILES and p.stem.lower() not in EXCLUDED_FILES
|
||||
|
||||
def is_not_debug_or_python(p):
|
||||
return is_not_debug(p) and not PYTHON_DLL_RE.search(p.name)
|
||||
|
||||
def include_in_lib(p):
|
||||
name = p.name.lower()
|
||||
if p.is_dir():
|
||||
if name in EXCLUDE_FROM_LIBRARY:
|
||||
return False
|
||||
if name == 'test' and p.parts[-2].lower() == 'lib':
|
||||
return False
|
||||
if name in {'test', 'tests'} and p.parts[-3].lower() == 'lib':
|
||||
return False
|
||||
return True
|
||||
|
||||
if name in EXCLUDE_FILE_FROM_LIBRARY:
|
||||
return False
|
||||
|
||||
suffix = p.suffix.lower()
|
||||
return suffix not in {'.pyc', '.pyo', '.exe'}
|
||||
|
||||
def include_in_embeddable_lib(p):
|
||||
if p.is_dir() and p.name.lower() in EXCLUDE_FROM_EMBEDDABLE_LIBRARY:
|
||||
return False
|
||||
|
||||
return include_in_lib(p)
|
||||
|
||||
def include_in_libs(p):
|
||||
if not is_not_debug(p):
|
||||
return False
|
||||
|
||||
return p.stem.lower() not in EXCLUDE_FILE_FROM_LIBS
|
||||
|
||||
def include_in_tools(p):
|
||||
if p.is_dir() and p.name.lower() in {'scripts', 'i18n', 'pynche', 'demo', 'parser'}:
|
||||
return True
|
||||
|
||||
return p.suffix.lower() in {'.py', '.pyw', '.txt'}
|
||||
|
||||
BASE_NAME = 'python{0.major}{0.minor}'.format(sys.version_info)
|
||||
|
||||
FULL_LAYOUT = [
|
||||
('/', '$build', 'python.exe', is_not_debug),
|
||||
('/', '$build', 'pythonw.exe', is_not_debug),
|
||||
('/', '$build', 'python{}.dll'.format(sys.version_info.major), is_not_debug),
|
||||
('/', '$build', '{}.dll'.format(BASE_NAME), is_not_debug),
|
||||
('DLLs/', '$build', '*.pyd', is_not_debug),
|
||||
('DLLs/', '$build', '*.dll', is_not_debug_or_python),
|
||||
('include/', 'include', '*.h', None),
|
||||
('include/', 'PC', 'pyconfig.h', None),
|
||||
('Lib/', 'Lib', '**/*', include_in_lib),
|
||||
('libs/', '$build', '*.lib', include_in_libs),
|
||||
('Tools/', 'Tools', '**/*', include_in_tools),
|
||||
]
|
||||
|
||||
EMBED_LAYOUT = [
|
||||
('/', '$build', 'python*.exe', is_not_debug),
|
||||
('/', '$build', '*.pyd', is_not_debug),
|
||||
('/', '$build', '*.dll', is_not_debug),
|
||||
('{}.zip'.format(BASE_NAME), 'Lib', '**/*', include_in_embeddable_lib),
|
||||
]
|
||||
|
||||
if os.getenv('DOC_FILENAME'):
|
||||
FULL_LAYOUT.append(('Doc/', 'Doc/build/htmlhelp', os.getenv('DOC_FILENAME'), None))
|
||||
if os.getenv('VCREDIST_PATH'):
|
||||
FULL_LAYOUT.append(('/', os.getenv('VCREDIST_PATH'), 'vcruntime*.dll', None))
|
||||
EMBED_LAYOUT.append(('/', os.getenv('VCREDIST_PATH'), 'vcruntime*.dll', None))
|
||||
|
||||
def copy_to_layout(target, rel_sources):
|
||||
count = 0
|
||||
|
||||
if target.suffix.lower() == '.zip':
|
||||
if target.exists():
|
||||
target.unlink()
|
||||
|
||||
with ZipFile(str(target), 'w', ZIP_DEFLATED) as f:
|
||||
with tempfile.TemporaryDirectory() as tmpdir:
|
||||
for s, rel in rel_sources:
|
||||
if rel.suffix.lower() == '.py':
|
||||
pyc = Path(tmpdir) / rel.with_suffix('.pyc').name
|
||||
try:
|
||||
py_compile.compile(str(s), str(pyc), str(rel), doraise=True, optimize=2)
|
||||
except py_compile.PyCompileError:
|
||||
f.write(str(s), str(rel))
|
||||
else:
|
||||
f.write(str(pyc), str(rel.with_suffix('.pyc')))
|
||||
else:
|
||||
f.write(str(s), str(rel))
|
||||
count += 1
|
||||
|
||||
else:
|
||||
for s, rel in rel_sources:
|
||||
dest = target / rel
|
||||
try:
|
||||
dest.parent.mkdir(parents=True)
|
||||
except FileExistsError:
|
||||
pass
|
||||
if dest.is_file():
|
||||
dest.chmod(stat.S_IWRITE)
|
||||
shutil.copy(str(s), str(dest))
|
||||
if dest.is_file():
|
||||
dest.chmod(stat.S_IWRITE)
|
||||
count += 1
|
||||
|
||||
return count
|
||||
|
||||
def rglob(root, pattern, condition):
|
||||
dirs = [root]
|
||||
recurse = pattern[:3] in {'**/', '**\\'}
|
||||
while dirs:
|
||||
d = dirs.pop(0)
|
||||
for f in d.glob(pattern[3:] if recurse else pattern):
|
||||
if recurse and f.is_dir() and (not condition or condition(f)):
|
||||
dirs.append(f)
|
||||
elif f.is_file() and (not condition or condition(f)):
|
||||
yield f, f.relative_to(root)
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('-s', '--source', metavar='dir', help='The directory containing the repository root', type=Path)
|
||||
parser.add_argument('-o', '--out', metavar='file', help='The name of the output archive', type=Path, default=None)
|
||||
parser.add_argument('-t', '--temp', metavar='dir', help='A directory to temporarily extract files into', type=Path, default=None)
|
||||
parser.add_argument('-e', '--embed', help='Create an embedding layout', action='store_true', default=False)
|
||||
parser.add_argument('-b', '--build', help='Specify the build directory', type=Path, default=None)
|
||||
ns = parser.parse_args()
|
||||
|
||||
source = ns.source or (Path(__file__).resolve().parent.parent.parent)
|
||||
out = ns.out
|
||||
build = ns.build or Path(sys.exec_prefix)
|
||||
assert isinstance(source, Path)
|
||||
assert not out or isinstance(out, Path)
|
||||
assert isinstance(build, Path)
|
||||
|
||||
if ns.temp:
|
||||
temp = ns.temp
|
||||
delete_temp = False
|
||||
else:
|
||||
temp = Path(tempfile.mkdtemp())
|
||||
delete_temp = True
|
||||
|
||||
if out:
|
||||
try:
|
||||
out.parent.mkdir(parents=True)
|
||||
except FileExistsError:
|
||||
pass
|
||||
try:
|
||||
temp.mkdir(parents=True)
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
layout = EMBED_LAYOUT if ns.embed else FULL_LAYOUT
|
||||
|
||||
try:
|
||||
for t, s, p, c in layout:
|
||||
if s == '$build':
|
||||
fs = build
|
||||
else:
|
||||
fs = source / s
|
||||
files = rglob(fs, p, c)
|
||||
extra_files = []
|
||||
if s == 'Lib' and p == '**/*':
|
||||
extra_files.append((
|
||||
source / 'tools' / 'msi' / 'distutils.command.bdist_wininst.py',
|
||||
Path('distutils') / 'command' / 'bdist_wininst.py'
|
||||
))
|
||||
copied = copy_to_layout(temp / t.rstrip('/'), chain(files, extra_files))
|
||||
print('Copied {} files'.format(copied))
|
||||
|
||||
if ns.embed:
|
||||
with open(str(temp / (BASE_NAME + '._pth')), 'w') as f:
|
||||
print(BASE_NAME + '.zip', file=f)
|
||||
print('.', file=f)
|
||||
print('', file=f)
|
||||
print('# Uncomment to run site.main() automatically', file=f)
|
||||
print('#import site', file=f)
|
||||
|
||||
if out:
|
||||
total = copy_to_layout(out, rglob(temp, '**/*', None))
|
||||
print('Wrote {} files to {}'.format(total, out))
|
||||
finally:
|
||||
if delete_temp:
|
||||
shutil.rmtree(temp, True)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(int(main() or 0))
|
188
third_party/python/Tools/msi/msi.props
vendored
188
third_party/python/Tools/msi/msi.props
vendored
|
@ -1,188 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="ReleaseUri">
|
||||
<PropertyGroup>
|
||||
<TargetName>$(OutputName)</TargetName>
|
||||
<DefineSolutionProperties>false</DefineSolutionProperties>
|
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
|
||||
<SuppressIces>$(SuppressIces);ICE03;ICE57;ICE61</SuppressIces>
|
||||
<CompilerSuppressSpecificWarnings>1026</CompilerSuppressSpecificWarnings>
|
||||
<BuildForRelease Condition="'$(BuildForRelease)' == ''">false</BuildForRelease>
|
||||
<SignOutput Condition="'$(SigningCertificate)' != ''">true</SignOutput>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
|
||||
<Platform Condition="'$(Platform)' == ''">x86</Platform>
|
||||
<InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope>
|
||||
<_MakeCatCommand Condition="'$(_MakeCatCommand)' == ''">makecat</_MakeCatCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="wix.props" />
|
||||
<Import Project="..\..\PCBuild\tcltk.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
This URI is used to generate the various GUIDs used by the installer.
|
||||
Installers built with the same URI will upgrade each other or block
|
||||
when attempting to downgrade.
|
||||
|
||||
By default, this is the local computer name, which will produce
|
||||
installers that do not interfere with other installers. Products
|
||||
that intend to bundle Python should rebuild these modules with their
|
||||
own URI to avoid conflicting with the official releases.
|
||||
|
||||
The official releases use "http://www.python.org/$(ArchName)"
|
||||
|
||||
This is not the same as the DownloadUrl property used in the bundle
|
||||
projects.
|
||||
-->
|
||||
<ReleaseUri Condition="'$(ReleaseUri)' == ''">$(ComputerName)/$(ArchName)/</ReleaseUri>
|
||||
<ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
|
||||
<WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" Condition="$(IgnoreCommonWxlTemplates) != 'true'" />
|
||||
<WixExtension Include="WixUtilExtension">
|
||||
<HintPath>WixUtilExtension</HintPath>
|
||||
<Name>WixUtilExtension</Name>
|
||||
</WixExtension>
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<IntermediateOutputPath>$(Py_IntDir)\$(MajorVersionNumber)$(MinorVersionNumber)$(ArchName)_$(Configuration)\msi_$(OutputName)</IntermediateOutputPath>
|
||||
<IntermediateOutputPath Condition="'$(OutputSuffix)' != ''">$(IntermediateOutputPath)_$(OutputSuffix)</IntermediateOutputPath>
|
||||
<OutputPath Condition="'$(OutputPath)' == ''">$(BuildPath)</OutputPath>
|
||||
<OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
|
||||
<OutDir>$(OutputPath)</OutDir>
|
||||
<ReuseCabinetCache>true</ReuseCabinetCache>
|
||||
<CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist</CRTRedist>
|
||||
<CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist>
|
||||
<DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
|
||||
|
||||
<InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="!$(BuildForRelease)">
|
||||
<RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
|
||||
<PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion>
|
||||
<InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<Bitness>32-bit</Bitness>
|
||||
<Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
|
||||
<PlatformArchitecture>32bit</PlatformArchitecture>
|
||||
<PlatformArchitecture Condition="$(Platform) == 'x64'">64bit</PlatformArchitecture>
|
||||
<DefineConstants>
|
||||
$(DefineConstants);
|
||||
Version=$(InstallerVersion);
|
||||
ShortVersion=$(MajorVersionNumber).$(MinorVersionNumber);
|
||||
LongVersion=$(PythonVersion);
|
||||
MajorVersionNumber=$(MajorVersionNumber);
|
||||
MinorVersionNumber=$(MinorVersionNumber);
|
||||
UpgradeMinimumVersion=$(MajorVersionNumber).$(MinorVersionNumber).0.0;
|
||||
NextMajorVersionNumber=$(MajorVersionNumber).$([msbuild]::Add($(MinorVersionNumber), 1)).0.0;
|
||||
Bitness=$(Bitness);
|
||||
PlatformArchitecture=$(PlatformArchitecture);
|
||||
PyDebugExt=$(PyDebugExt);
|
||||
PyArchExt=$(PyArchExt);
|
||||
PyTestExt=$(PyTestExt);
|
||||
OptionalFeatureName=$(OutputName);
|
||||
</DefineConstants>
|
||||
<DefineConstants Condition="'$(CRTRedist)' != ''">
|
||||
$(DefineConstants);CRTRedist=$(CRTRedist);
|
||||
</DefineConstants>
|
||||
<DefineConstants Condition="$(Platform) != 'x64'">
|
||||
$(DefineConstants);Suffix32=-32;
|
||||
</DefineConstants>
|
||||
<DefineConstants Condition="$(Platform) == 'x64'">
|
||||
$(DefineConstants);Suffix32=;
|
||||
</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemDefinitionGroup>
|
||||
<InstallFiles>
|
||||
<Group>generated_filelist</Group>
|
||||
<Condition></Condition>
|
||||
<DiskId></DiskId>
|
||||
<IncludeInCat>false</IncludeInCat>
|
||||
</InstallFiles>
|
||||
<LinkerBindInputPaths>
|
||||
<Visible>false</Visible>
|
||||
</LinkerBindInputPaths>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<LinkerBindInputPaths Include="$(PGOBuildPath);$(BuildPath)">
|
||||
<BindName></BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(PySourcePath)Doc\build\htmlhelp">
|
||||
<BindName></BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(PySourcePath)">
|
||||
<BindName>src</BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(tcltkDir)">
|
||||
<BindName>tcltk</BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(CRTRedist)" Condition="'$(CRTRedist)' != ''">
|
||||
<BindName>redist</BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT">
|
||||
<BindName>redist</BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(BuildPath32)">
|
||||
<BindName>build32</BindName>
|
||||
</LinkerBindInputPaths>
|
||||
<LinkerBindInputPaths Include="$(BuildPath64)">
|
||||
<BindName>build64</BindName>
|
||||
</LinkerBindInputPaths>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
|
||||
<Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<_Uuid Include="CoreUpgradeCode">
|
||||
<Uri>upgradecode</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="UpgradeCode">
|
||||
<Uri>upgradecode/$(OutputName)</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="InstallDirectoryGuidSeed">
|
||||
<Uri>installdirectoryseed</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="PythonExeComponentGuid">
|
||||
<Uri>python.exe</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="PythonwExeComponentGuid">
|
||||
<Uri>pythonw.exe</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="RemoveLib2to3PickleComponentGuid">
|
||||
<Uri>lib2to3/pickles</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="CommonPythonRegComponentGuid">
|
||||
<Uri>registry</Uri>
|
||||
</_Uuid>
|
||||
<_Uuid Include="PythonRegComponentGuid">
|
||||
<Uri>registry/$(OutputName)</Uri>
|
||||
</_Uuid>
|
||||
</ItemGroup>
|
||||
<Target Name="_GenerateGuids" AfterTargets="PrepareForBuild" Condition="$(TargetName) != 'launcher'">
|
||||
<PropertyGroup>
|
||||
<_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
|
||||
<_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri.Replace(`{arch}`, `$(ArchName)`))' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))]))</_GenerateCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<Exec Command='"$(PythonExe)" -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"'
|
||||
WorkingDirectory="$(MSBuildThisFileDirectory)"
|
||||
IgnoreExitCode="false" />
|
||||
|
||||
<ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
|
||||
<Output TaskParameter="Lines" ItemName="_UuidValue" />
|
||||
</ReadLinesFromFile>
|
||||
|
||||
<PropertyGroup>
|
||||
<DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
93
third_party/python/Tools/msi/msi.targets
vendored
93
third_party/python/Tools/msi/msi.targets
vendored
|
@ -1,93 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
|
||||
<Target Name="ProcessInstallFiles" AfterTargets="PrepareForBuild" Condition="@(InstallFiles) != ''">
|
||||
<PropertyGroup>
|
||||
<_FileListTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.csv</_FileListTarget>
|
||||
<_InstallFilesTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.wxs</_InstallFilesTarget>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<InstallFiles>
|
||||
<_Source>%(Source)$([msbuild]::MakeRelative(%(SourceBase), %(FullPath)))</_Source>
|
||||
<_Target>%(Target_)$([msbuild]::MakeRelative(%(TargetBase), %(FullPath)))</_Target>
|
||||
</InstallFiles>
|
||||
|
||||
<_CatalogFiles Include="@(InstallFiles)" Condition="%(InstallFiles.IncludeInCat) and ''!=$([System.IO.File]::ReadAllText(%(InstallFiles.FullPath)))" />
|
||||
</ItemGroup>
|
||||
|
||||
<WriteLinesToFile File="$(_FileListTarget)" Lines="@(InstallFiles->'"%(_Source)","%(_Target)","%(Group)","%(DiskId)","%(Condition)"')" Overwrite="true" />
|
||||
<Exec Command='"$(PythonExe)" csv_to_wxs.py "$(_FileListTarget)" "$(_InstallFilesTarget)"'
|
||||
WorkingDirectory="$(MSBuildThisFileDirectory)" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(_FileListTarget);$(_InstallFilesTarget)" />
|
||||
<Compile Include="$(_InstallFilesTarget)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="GenerateCatalog" AfterTargets="ProcessInstallFiles" Condition="'@(_CatalogFiles)' != ''">
|
||||
<PropertyGroup>
|
||||
<_CatFileSourceTarget>$(IntermediateOutputPath)$(MSBuildProjectName).cdf</_CatFileSourceTarget>
|
||||
<_CatFileTarget>$(IntermediateOutputPath)python_$(MSBuildProjectName).cat</_CatFileTarget>
|
||||
<_CatFile>[CatalogHeader]
|
||||
Name=$([System.IO.Path]::GetFileName($(_CatFileTarget)))
|
||||
ResultDir=$([System.IO.Path]::GetDirectoryName($(_CatFileTarget)))
|
||||
PublicVersion=1
|
||||
CatalogVersion=2
|
||||
HashAlgorithms=SHA256
|
||||
PageHashes=false
|
||||
EncodingType=
|
||||
|
||||
[CatalogFiles]
|
||||
@(_CatalogFiles->'<HASH>%(Filename)%(Extension)=%(FullPath)','
|
||||
')
|
||||
</_CatFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="$(_CatFileSourceTarget)" Lines="$(_CatFile)" Overwrite="true" />
|
||||
<Exec Command='$(_MakeCatCommand) "$(_CatFileSourceTarget)"' WorkingDirectory="$(MSBuildThisFileDirectory)" />
|
||||
<Exec Command='$(_SignCommand) "$(_CatFileTarget)"' WorkingDirectory="$(MSBuildThisFileDirectory)"
|
||||
Condition="Exists($(_CatFileTarget)) and '$(_SignCommand)' != ''" />
|
||||
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(_CatFileSourceTarget);$(_CatFileTarget)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="_TransformWxlTemplates" AfterTargets="PrepareForBuild" Inputs="@(WxlTemplate);$(PySourcePath)include\patchlevel.h" Outputs="$(IntermediateOutputPath)%(Filename).wxl">
|
||||
<PropertyGroup Condition="'@(WxlTemplate)' != ''">
|
||||
<_Content>$([System.IO.File]::ReadAllText(%(WxlTemplate.FullPath)).Replace(`{{ShortVersion}}`, `$(MajorVersionNumber).$(MinorVersionNumber)$(PyTestExt)`).Replace(`{{LongVersion}}`, `$(PythonVersion)$(PyTestExt)`).Replace(`{{Bitness}}`, `$(Bitness)`))</_Content>
|
||||
<_ExistingContent Condition="Exists('$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl')">$([System.IO.File]::ReadAllText($(IntermediateOutputPath)%(WxlTemplate.Filename).wxl))</_ExistingContent>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl"
|
||||
Lines="$(_Content)"
|
||||
Overwrite="true"
|
||||
Condition="$(_Content) != $(_ExistingContent)" />
|
||||
|
||||
<ItemGroup Condition="'@(WxlTemplate)' != ''">
|
||||
<EmbeddedResource Include="$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl" />
|
||||
<FileWrites Include="$(IntermediateOutputPath)%(WxlTemplate.Filename).wxl" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Import Project="$(WixTargetsPath)" />
|
||||
|
||||
<Target Name="SignCabs">
|
||||
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
|
||||
<Exec Command="$(_SignCommand) @(SignCabs->'"%(FullPath)"',' ')" ContinueOnError="false" />
|
||||
</Target>
|
||||
<Target Name="SignMsi">
|
||||
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
|
||||
<Exec Command="$(_SignCommand) @(SignMsi->'"%(FullPath)"',' ')" ContinueOnError="false" />
|
||||
</Target>
|
||||
<Target Name="SignBundleEngine">
|
||||
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
|
||||
<Exec Command="$(_SignCommand) @(SignBundleEngine->'"%(FullPath)"',' ')" ContinueOnError="false" />
|
||||
</Target>
|
||||
<Target Name="SignBundle">
|
||||
<Error Text="Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition="'$(_SignCommand)' == ''" />
|
||||
<Exec Command="$(_SignCommand) @(SignBundle->'"%(FullPath)"',' ')" ContinueOnError="false" />
|
||||
</Target>
|
||||
</Project>
|
19
third_party/python/Tools/msi/path/path.wixproj
vendored
19
third_party/python/Tools/msi/path/path.wixproj
vendored
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{91C99298-8E2E-4422-A5AF-CC4FFF9A58D3}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>path</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<SuppressIces>ICE71</SuppressIces>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="*.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
39
third_party/python/Tools/msi/path/path.wxs
vendored
39
third_party/python/Tools/msi/path/path.wxs
vendored
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<Component Id="PrependPath_CU" Directory="InstallDirectory" Guid="*">
|
||||
<Condition>NOT ALLUSERS=1</Condition>
|
||||
<RegistryKey Root="HKCU" Key="[REGISTRYKEY]">
|
||||
<RegistryValue KeyPath="yes" Key="InstalledFeatures" Name="$(var.OptionalFeatureName)" Value="$(var.Version)" Type="string" />
|
||||
</RegistryKey>
|
||||
|
||||
<CreateFolder Directory="Scripts" />
|
||||
<RemoveFolder Id="Remove_Scripts_CU" Directory="Scripts" On="uninstall" />
|
||||
|
||||
<Environment Id="PATH_CU" Action="set" Name="PATH" Part="first" Value="[InstallDirectory]" />
|
||||
<Environment Id="SCRIPTS_PATH_CU" Action="set" Name="PATH" Part="first" Value="[Scripts]" />
|
||||
</Component>
|
||||
<Component Id="PrependPath_LM" Directory="InstallDirectory" Guid="*">
|
||||
<Condition>ALLUSERS=1</Condition>
|
||||
<RegistryKey Root="HKLM" Key="[REGISTRYKEY]">
|
||||
<RegistryValue KeyPath="yes" Key="InstalledFeatures" Name="$(var.OptionalFeatureName)" Value="$(var.Version)" Type="string" />
|
||||
</RegistryKey>
|
||||
|
||||
<CreateFolder Directory="Scripts" />
|
||||
<RemoveFolder Id="Remove_Scripts_LM" Directory="Scripts" On="uninstall" />
|
||||
|
||||
<Environment Id="PATH_LM" Action="set" Name="PATH" Part="first" Value="[InstallDirectory]" System="yes" />
|
||||
<Environment Id="SCRIPTS_PATH_LM" Action="set" Name="PATH" Part="first" Value="[Scripts]" System="yes" />
|
||||
<Environment Id="PY_PATHEXT_LM" Action="set" Name="PATHEXT" Part="last" Value=".PY" System="yes" />
|
||||
<Environment Id="PYW_PATHEXT_LM" Action="set" Name="PATHEXT" Part="last" Value=".PYW" System="yes" />
|
||||
</Component>
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Descriptor">Add to Path</String>
|
||||
<String Id="ShortDescriptor">Path</String>
|
||||
<String Id="NoPython">No !(loc.ProductName) installation was detected.</String>
|
||||
</WixLocalization>
|
19
third_party/python/Tools/msi/pip/pip.wixproj
vendored
19
third_party/python/Tools/msi/pip/pip.wixproj
vendored
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{91C99298-8E2E-4422-A5AF-CC4FFF9A58D3}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>pip</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
<SuppressIces>ICE71</SuppressIces>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="*.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="*.wxl" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
39
third_party/python/Tools/msi/pip/pip.wxs
vendored
39
third_party/python/Tools/msi/pip/pip.wxs
vendored
|
@ -1,39 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<Property Id="PYTHON_EXE" Secure="yes">
|
||||
<ComponentSearch Id="PythonExe" Guid="$(var.PythonExeComponentGuid)">
|
||||
<FileSearch Name="python.exe" />
|
||||
</ComponentSearch>
|
||||
</Property>
|
||||
|
||||
<Condition Message="!(loc.NoPython)">PYTHON_EXE</Condition>
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentRef Id="OptionalFeature" />
|
||||
</Feature>
|
||||
|
||||
<?if $(var.Platform)~="x64" ?>
|
||||
<CustomAction Id="UpdatePip" BinaryKey="WixCA" DllEntry="CAQuietExec64" Execute="deferred" Return="ignore"/>
|
||||
<?else ?>
|
||||
<CustomAction Id="UpdatePip" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore"/>
|
||||
<?endif ?>
|
||||
|
||||
<!-- Install/uninstall pip -->
|
||||
<CustomAction Id="SetUpdatePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -E -s -m ensurepip -U --default-pip' Execute="immediate" />
|
||||
<CustomAction Id="SetRemovePipCommandLine" Property="UpdatePip" Value='"[PYTHON_EXE]" -E -s -B -m ensurepip._uninstall' Execute="immediate" />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="SetUpdatePipCommandLine" Before="UpdatePip">(&DefaultFeature=3) AND NOT (!DefaultFeature=3)</Custom>
|
||||
<Custom Action="SetRemovePipCommandLine" Before="UpdatePip">(&DefaultFeature=2) AND (!DefaultFeature=3)</Custom>
|
||||
|
||||
<Custom Action="UpdatePip" Before="InstallFinalize">UpdatePip</Custom>
|
||||
</InstallExecuteSequence>
|
||||
</Product>
|
||||
</Wix>
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Descriptor">pip Bootstrap</String>
|
||||
<String Id="ShortDescriptor">pip</String>
|
||||
<String Id="NoPython">No !(loc.ProductName) installation was detected.</String>
|
||||
</WixLocalization>
|
74
third_party/python/Tools/msi/purge.py
vendored
74
third_party/python/Tools/msi/purge.py
vendored
|
@ -1,74 +0,0 @@
|
|||
# Purges the Fastly cache for Windows download files
|
||||
#
|
||||
# Usage:
|
||||
# py -3 purge.py 3.5.1rc1
|
||||
#
|
||||
|
||||
__author__ = 'Steve Dower <steve.dower@python.org>'
|
||||
__version__ = '1.0.0'
|
||||
|
||||
import re
|
||||
import sys
|
||||
|
||||
from urllib.request import *
|
||||
|
||||
VERSION_RE = re.compile(r'(\d+\.\d+\.\d+)(\w+\d+)?$')
|
||||
|
||||
try:
|
||||
m = VERSION_RE.match(sys.argv[1])
|
||||
if not m:
|
||||
print('Invalid version:', sys.argv[1])
|
||||
print('Expected something like "3.5.1rc1"')
|
||||
sys.exit(1)
|
||||
except LookupError:
|
||||
print('Missing version argument. Expected something like "3.5.1rc1"')
|
||||
sys.exit(1)
|
||||
|
||||
URL = "https://www.python.org/ftp/python/{}/".format(m.group(1))
|
||||
REL = m.group(2) or ''
|
||||
|
||||
FILES = [
|
||||
"core.msi",
|
||||
"core_d.msi",
|
||||
"core_pdb.msi",
|
||||
"dev.msi",
|
||||
"dev_d.msi",
|
||||
"doc.msi",
|
||||
"exe.msi",
|
||||
"exe_d.msi",
|
||||
"exe_pdb.msi",
|
||||
"launcher.msi",
|
||||
"lib.msi",
|
||||
"lib_d.msi",
|
||||
"lib_pdb.msi",
|
||||
"path.msi",
|
||||
"pip.msi",
|
||||
"tcltk.msi",
|
||||
"tcltk_d.msi",
|
||||
"tcltk_pdb.msi",
|
||||
"test.msi",
|
||||
"test_d.msi",
|
||||
"test_pdb.msi",
|
||||
"tools.msi",
|
||||
"Windows6.0-KB2999226-x64.msu",
|
||||
"Windows6.0-KB2999226-x86.msu",
|
||||
"Windows6.1-KB2999226-x64.msu",
|
||||
"Windows6.1-KB2999226-x86.msu",
|
||||
"Windows8.1-KB2999226-x64.msu",
|
||||
"Windows8.1-KB2999226-x86.msu",
|
||||
"Windows8-RT-KB2999226-x64.msu",
|
||||
"Windows8-RT-KB2999226-x86.msu",
|
||||
]
|
||||
PATHS = [
|
||||
"python-{}.exe".format(m.group(0)),
|
||||
"python-{}-webinstall.exe".format(m.group(0)),
|
||||
"python-{}-amd64.exe".format(m.group(0)),
|
||||
"python-{}-amd64-webinstall.exe".format(m.group(0)),
|
||||
] + ["win32{}/{}".format(REL, f) for f in FILES] + ["amd64{}/{}".format(REL, f) for f in FILES]
|
||||
|
||||
print('Purged:')
|
||||
for n in PATHS:
|
||||
u = URL + n
|
||||
with urlopen(Request(u, method='PURGE', headers={'Fastly-Soft-Purge': 1})) as r:
|
||||
r.read()
|
||||
print(' ', u)
|
50
third_party/python/Tools/msi/tcltk/tcltk.wixproj
vendored
50
third_party/python/Tools/msi/tcltk/tcltk.wixproj
vendored
|
@ -1,50 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{DB350600-186C-4E52-BA98-26A7CECB067F}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>tcltk</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Shortcut validation is not necessary -->
|
||||
<SuppressICEs>ICE43</SuppressICEs>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="tcltk.wxs" />
|
||||
<Compile Include="tcltk_files.wxs" />
|
||||
<Compile Include="tcltk_reg.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InstallFiles Include="$(tcltkDir)bin\*.dll" Exclude="$(tcltkDir)bin\*g.dll">
|
||||
<SourceBase>$(tcltkDir)</SourceBase>
|
||||
<Source>!(bindpath.tcltk)</Source>
|
||||
<TargetBase>$(tcltkDir)bin</TargetBase>
|
||||
<Target_>DLLs\</Target_>
|
||||
<Group>tcltk_dlls</Group>
|
||||
</InstallFiles>
|
||||
|
||||
<InstallFiles Include="$(tcltkDir)lib\**\*">
|
||||
<SourceBase>$(tcltkDir)</SourceBase>
|
||||
<Source>!(bindpath.tcltk)</Source>
|
||||
<TargetBase>$(tcltkDir)lib</TargetBase>
|
||||
<Target_>tcl\</Target_>
|
||||
<Group>tcltk_lib</Group>
|
||||
</InstallFiles>
|
||||
|
||||
<InstallFiles Include="$(PySourcePath)Lib\tkinter\**\*;$(PySourcePath)Lib\idlelib\**\*;$(PySourcePath)Lib\turtledemo\**\*"
|
||||
Exclude="$(PySourcePath)Lib\**\*.pyc;$(PySourcePath)Lib\**\*.pyo">
|
||||
<SourceBase>$(PySourcePath)</SourceBase>
|
||||
<Source>!(bindpath.src)</Source>
|
||||
<TargetBase>$(PySourcePath)</TargetBase>
|
||||
<Target_></Target_>
|
||||
<Group>tkinter_lib</Group>
|
||||
</InstallFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
66
third_party/python/Tools/msi/tcltk/tcltk.wxs
vendored
66
third_party/python/Tools/msi/tcltk/tcltk.wxs
vendored
|
@ -1,66 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
<PropertyRef Id="REGISTRYKEY" />
|
||||
|
||||
<Property Id="PYTHON_EXE" Secure="yes">
|
||||
<ComponentSearch Id="PythonExe" Guid="$(var.PythonExeComponentGuid)">
|
||||
<FileSearch Name="python.exe" />
|
||||
</ComponentSearch>
|
||||
</Property>
|
||||
|
||||
<Property Id="PYTHONW_EXE" Secure="yes">
|
||||
<ComponentSearch Id="PythonwExe" Guid="$(var.PythonwExeComponentGuid)">
|
||||
<FileSearch Name="pythonw.exe" />
|
||||
</ComponentSearch>
|
||||
</Property>
|
||||
|
||||
<Condition Message="!(loc.NoPython)">PYTHON_EXE and PYTHONW_EXE</Condition>
|
||||
|
||||
<Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="tkinter_extension" />
|
||||
<ComponentGroupRef Id="tcltk_dlls" />
|
||||
<ComponentGroupRef Id="tcltk_lib" />
|
||||
<ComponentGroupRef Id="tkinter_lib" Primary="yes" />
|
||||
|
||||
<Component Id="idle_reg" Directory="InstallDirectory">
|
||||
<RegistryValue KeyPath="yes" Root="HKMU" Key="[REGISTRYKEY]\Idle" Type="string" Value="[#Lib_idlelib_idle.pyw]" />
|
||||
</Component>
|
||||
<ComponentRef Id="OptionalFeature" />
|
||||
</Feature>
|
||||
<Feature Id="AssociateFiles" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="tkinter_lib" />
|
||||
<ComponentGroupRef Id="idle_reg" />
|
||||
</Feature>
|
||||
<Feature Id="Shortcuts" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
|
||||
<ComponentGroupRef Id="tkinter_lib" />
|
||||
|
||||
<Component Id="idle_shortcut" Directory="MenuDir">
|
||||
<RegistryValue Root="HKMU" Key="[REGISTRYKEY]\IdleShortcuts" Type="integer" Value="1" KeyPath="yes" />
|
||||
<RemoveFolder Id="Remove_MenuDir" On="uninstall" />
|
||||
|
||||
<Shortcut Id="IDLE"
|
||||
Directory="MenuDir"
|
||||
Name="!(loc.ShortcutName)"
|
||||
Description="!(loc.ShortcutDescription)"
|
||||
Target="[PYTHONW_EXE]"
|
||||
Arguments='"[#Lib_idlelib_idle.pyw]"'
|
||||
Icon="idle.exe"
|
||||
WorkingDirectory="InstallDirectory">
|
||||
<Icon Id="idle.exe" SourceFile="!(bindpath.src)Lib\idlelib\Icons\idle.ico" />
|
||||
</Shortcut>
|
||||
<Shortcut Id="pydoc.py"
|
||||
Target="[PYTHON_EXE]"
|
||||
Arguments='-m pydoc -b'
|
||||
Name="!(loc.PyDocShortcutName)"
|
||||
Description="!(loc.PyDocShortcutDescription)"
|
||||
Icon="idle.exe"
|
||||
WorkingDirectory="InstallDirectory" />
|
||||
</Component>
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,28 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{EDA1FA5A-E2AA-4EAF-B49B-87D981CD0F16}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>tcltk_d</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="tcltk_d.wxs" />
|
||||
<Compile Include="tcltk_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<InstallFiles Include="$(tcltkDir)bin\*g.dll">
|
||||
<SourceBase>$(tcltkDir)</SourceBase>
|
||||
<Source>!(bindpath.tcltk)</Source>
|
||||
<TargetBase>$(tcltkDir)bin</TargetBase>
|
||||
<Target_>DLLs\</Target_>
|
||||
<Group>tcltk_dlls_d</Group>
|
||||
</InstallFiles>
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
14
third_party/python/Tools/msi/tcltk/tcltk_d.wxs
vendored
14
third_party/python/Tools/msi/tcltk/tcltk_d.wxs
vendored
|
@ -1,14 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title_d)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
|
||||
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
|
||||
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
|
||||
|
||||
<PropertyRef Id="UpgradeTable" />
|
||||
|
||||
<Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
|
||||
<ComponentGroupRef Id="tkinter_extension_d" />
|
||||
<ComponentGroupRef Id="tcltk_dlls_d" />
|
||||
</Feature>
|
||||
</Product>
|
||||
</Wix>
|
|
@ -1,12 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
|
||||
<String Id="Descriptor">Tcl/Tk Support</String>
|
||||
<String Id="ShortDescriptor">tcltk</String>
|
||||
<String Id="NoPython">No !(loc.ProductName) installation was detected.</String>
|
||||
<String Id="ShortcutName">IDLE (Python {{ShortVersion}} {{Bitness}})</String>
|
||||
<String Id="ShortcutDescription">Launches IDLE, the interactive environment for !(loc.ProductName).</String>
|
||||
<String Id="PyDocShortcutName">Python {{ShortVersion}} Module Docs ({{Bitness}})</String>
|
||||
<String Id="PyDocShortcutDescription">Start the !(loc.ProductName) documentation server.</String>
|
||||
<String Id="EditMenu">&Edit with IDLE</String>
|
||||
<String Id="EditSubMenu">Edit with IDLE {{ShortVersion}} ({{Bitness}})</String>
|
||||
</WixLocalization>
|
|
@ -1,35 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Fragment>
|
||||
<ComponentGroup Id="tkinter_extension">
|
||||
<Component Id="_tkinter.pyd" Directory="DLLs" Guid="*">
|
||||
<File Name="_tkinter.pyd" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="_tkinter.lib" Directory="libs" Guid="*">
|
||||
<File Name="_tkinter.lib" KeyPath="yes" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="tkinter_extension_symbols">
|
||||
<Component Id="_tkinter.pdb" Directory="DLLs" Guid="*">
|
||||
<File Name="_tkinter.pdb" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
|
||||
<Fragment>
|
||||
<ComponentGroup Id="tkinter_extension_d">
|
||||
<Component Id="_tkinter_d.pyd" Directory="DLLs" Guid="*">
|
||||
<File Name="_tkinter_d.pyd" />
|
||||
</Component>
|
||||
<Component Id="_tkinter_d.lib" Directory="DLLs" Guid="*">
|
||||
<File Name="_tkinter_d.lib" />
|
||||
</Component>
|
||||
<Component Id="_tkinter_d.pdb" Directory="DLLs" Guid="*">
|
||||
<File Name="_tkinter_d.pdb" />
|
||||
</Component>
|
||||
</ComponentGroup>
|
||||
</Fragment>
|
||||
</Wix>
|
|
@ -1,19 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectGuid>{02053AFA-1831-499A-B3EA-D8B223D3C40D}</ProjectGuid>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<OutputName>tcltk_pdb</OutputName>
|
||||
<OutputType>Package</OutputType>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\msi.props" />
|
||||
<ItemGroup>
|
||||
<Compile Include="tcltk_pdb.wxs" />
|
||||
<Compile Include="tcltk_files.wxs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WxlTemplate Include="*.wxl_template" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="..\msi.targets" />
|
||||
</Project>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue