Updater Now Can Re-Install the Full VCStudio
I made some mistakes in the names of the Versions. For the updater. And so I need a way to fix it. So users could install the updates regardless of their version. I think I'm going to push a silent update for this. And change the names of the versions. So users could click update all for the next one. Or something like this. I don't know. Wait. Let's give users a day or two. I gonna update with the wrong names this time. Fully documented. Then update the number. So 21.1 will be 21.01 which is the more reasonable name. LOL. Anyways. Here is this. LOL.
This commit is contained in:
parent
8070f85dd6
commit
c4df06615d
3 changed files with 61 additions and 2 deletions
|
@ -71,6 +71,8 @@ def layer(win):
|
||||||
|
|
||||||
frame = win.current["frame"] - win.update["frame"] - 50
|
frame = win.current["frame"] - win.update["frame"] - 50
|
||||||
files = win.update["get_files"]
|
files = win.update["get_files"]
|
||||||
|
if win.settings["Update_all"]:
|
||||||
|
files = win.update["get_all_files"]
|
||||||
|
|
||||||
UI_color.set(layer, win, "progress_background")
|
UI_color.set(layer, win, "progress_background")
|
||||||
UI_elements.roundrect(layer, win,
|
UI_elements.roundrect(layer, win,
|
||||||
|
|
|
@ -29,6 +29,9 @@ def layer(win):
|
||||||
win.current['h'])
|
win.current['h'])
|
||||||
layer = cairo.Context(surface)
|
layer = cairo.Context(surface)
|
||||||
|
|
||||||
|
print("NEW FILES:", win.update["get_files"])
|
||||||
|
print("ALL FILES:", win.update["get_all_files"])
|
||||||
|
|
||||||
|
|
||||||
#text setting
|
#text setting
|
||||||
layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
|
layer.select_font_face("Monospace", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
|
||||||
|
@ -68,10 +71,54 @@ def layer(win):
|
||||||
button=do,
|
button=do,
|
||||||
icon="cancel",
|
icon="cancel",
|
||||||
tip=talk.text("cancel"))
|
tip=talk.text("cancel"))
|
||||||
|
|
||||||
|
|
||||||
|
# Setting to get all files. Sometimes you need a way to restore the entire
|
||||||
|
# program. Or sometimes I make mistakes. And want give myself and others a
|
||||||
|
# simple way to refresh the system. So here I gonna make a button that will
|
||||||
|
# tell the updater to ignore the update version and download the whole
|
||||||
|
# package. All 300 something files. ( It's 2021/01 at the time. )
|
||||||
|
|
||||||
|
# Also not so long ago I made Version naming mistakes. So some kind of way
|
||||||
|
# to download versions should exist. Here we go.
|
||||||
|
|
||||||
|
if "Update_all" not in win.settings:
|
||||||
|
win.settings["Update_all"] = False
|
||||||
|
settings.write("Update_all", False)
|
||||||
|
|
||||||
|
if win.settings["Update_all"]:
|
||||||
|
ic = "checked"
|
||||||
|
else:
|
||||||
|
ic = "unchecked"
|
||||||
|
|
||||||
|
def do():
|
||||||
|
win.settings["Update_all"] = not win.settings["Update_all"]
|
||||||
|
settings.write("Update_all", win.settings["Update_all"])
|
||||||
|
|
||||||
|
|
||||||
|
UI_elements.roundrect(layer, win,
|
||||||
|
win.current["w"]/2-250,
|
||||||
|
win.current["h"]-140,
|
||||||
|
420,
|
||||||
|
40,
|
||||||
|
10,
|
||||||
|
button=do,
|
||||||
|
icon=ic,
|
||||||
|
tip=talk.text("update_all_tooltip"))
|
||||||
|
|
||||||
|
|
||||||
|
UI_color.set(layer, win, "text_normal")
|
||||||
|
layer.set_font_size(15)
|
||||||
|
layer.move_to(
|
||||||
|
win.current["w"]/2-200,
|
||||||
|
win.current["h"]-115)
|
||||||
|
layer.show_text(talk.text("update_all")+" "+str(len(win.update["get_all_files"]))+" "+talk.text("files"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Install Updates button
|
# Install Updates button
|
||||||
try:
|
try:
|
||||||
if win.update["count"]:
|
if win.update["count"] or win.settings["Update_all"]:
|
||||||
def do():
|
def do():
|
||||||
win.url = "install_updates"
|
win.url = "install_updates"
|
||||||
win.update["frame"] = win.current["frame"]
|
win.update["frame"] = win.current["frame"]
|
||||||
|
@ -87,7 +134,7 @@ def layer(win):
|
||||||
icon="ok",
|
icon="ok",
|
||||||
tip=talk.text("update_install"))
|
tip=talk.text("update_install"))
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# Clipping everything
|
# Clipping everything
|
||||||
UI_elements.roundrect(layer, win,
|
UI_elements.roundrect(layer, win,
|
||||||
|
|
|
@ -50,6 +50,7 @@ def get_update_info(win):
|
||||||
stdout=PIPE, universal_newlines=True)
|
stdout=PIPE, universal_newlines=True)
|
||||||
win.update["versions"] = {}
|
win.update["versions"] = {}
|
||||||
win.update["get_files"] = []
|
win.update["get_files"] = []
|
||||||
|
win.update["get_all_files"] = []
|
||||||
|
|
||||||
elif "END" not in win.update:
|
elif "END" not in win.update:
|
||||||
# This going to read lines returned by the process on every frame.
|
# This going to read lines returned by the process on every frame.
|
||||||
|
@ -94,6 +95,15 @@ def get_update_info(win):
|
||||||
if line not in win.update["get_files"]:
|
if line not in win.update["get_files"]:
|
||||||
win.update["get_files"].append(line)
|
win.update["get_files"].append(line)
|
||||||
|
|
||||||
|
# All files. In case the user wants to update everything
|
||||||
|
# or I made a mistake somewhere. There will be an option
|
||||||
|
# in the update UI to download everything.
|
||||||
|
|
||||||
|
if line not in win.update["get_all_files"]:
|
||||||
|
win.update["get_all_files"].append(line)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue