Skip to content

Commit df06c94

Browse files
committed
Fixed Updater and updated README.md
1 parent d3ec382 commit df06c94

File tree

9 files changed

+74
-44
lines changed

9 files changed

+74
-44
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ dist/
88
*.html
99
*.pkg
1010
*.exe
11-
*.bak
11+
*.bak
12+
build/

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# VexTrack
22

3-
![Status badge](https://img.shields.io/badge/Status-Beta-yellow?style=for-the-badge "Development Status") [![Language badge](https://img.shields.io/badge/Language-Python_3.8.2-inactive?logo=python&logoColor=ffffff&style=for-the-badge)](https://python.org "Language")
3+
![Status badge](https://img.shields.io/badge/Status-Stable-green?style=for-the-badge "Development Status") [![Language badge](https://img.shields.io/badge/Language-Python_3.8.2-inactive?logo=python&logoColor=ffffff&style=for-the-badge)](https://python.org "Language")
44
![GitHub License](https://img.shields.io/github/license/BitTim/ValorantXPCalc?logo=github&style=for-the-badge "License")
55
![GitHub repo size](https://img.shields.io/github/repo-size/BitTim/ValorantXPCalc?logo=github&style=for-the-badge) ![GitHub contributors](https://img.shields.io/github/contributors/BitTim/ValorantXPCalc?logo=github&style=for-the-badge "Contributors") ![GitHub last commit (branch)](https://img.shields.io/github/last-commit/BitTim/ValorantXPCalc?logo=github&style=for-the-badge "Last commit")
66

77
## Installation
8-
Download zip from ![Here](https://github.com/BitTim/VexTrack/releases/tag/v1.1) and extract VexTrack.exe in a folder. After opening VexTrack fro the first time, a new folder "dat" will be created in the same folder the exe is in automatically.
8+
Download zip from ![Here](https://github.com/BitTim/VexTrack/releases/tag/latest) and extract all contents in a folder. After opening VexTrack for the first time, a new folder "dat" will be created in the same folder the exe is in automatically.

main.spec renamed to Updater.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
block_cipher = None
55

66

7-
a = Analysis(['src\\main.py'],
7+
a = Analysis(['src\\Updater.py'],
88
pathex=['P:\\VexTrack'],
99
binaries=[],
1010
datas=[],
@@ -24,7 +24,7 @@ exe = EXE(pyz,
2424
a.zipfiles,
2525
a.datas,
2626
[],
27-
name='main',
27+
name='Updater',
2828
debug=False,
2929
bootloader_ignore_signals=False,
3030
strip=False,

VexTrack.spec

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
block_cipher = None
5+
6+
7+
a = Analysis(['src\\VexTrack.py'],
8+
pathex=['P:\\VexTrack'],
9+
binaries=[],
10+
datas=[],
11+
hiddenimports=[],
12+
hookspath=[],
13+
runtime_hooks=[],
14+
excludes=[],
15+
win_no_prefer_redirects=False,
16+
win_private_assemblies=False,
17+
cipher=block_cipher,
18+
noarchive=False)
19+
pyz = PYZ(a.pure, a.zipped_data,
20+
cipher=block_cipher)
21+
exe = EXE(pyz,
22+
a.scripts,
23+
a.binaries,
24+
a.zipfiles,
25+
a.datas,
26+
[],
27+
name='VexTrack',
28+
debug=False,
29+
bootloader_ignore_signals=False,
30+
strip=False,
31+
upx=True,
32+
upx_exclude=[],
33+
runtime_tmpdir=None,
34+
console=False , icon='VexTrack.ico')

build/main/warn-main.txt

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,6 @@ missing module named org - imported by copy (optional)
1818
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
1919
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level), PyInstaller.loader.pyimod02_archive (delayed)
2020
missing module named urllib.pathname2url - imported by urllib (conditional), PyInstaller.lib.modulegraph._compat (conditional)
21-
missing module named urllib.getproxies_environment - imported by urllib (conditional), requests.compat (conditional)
22-
missing module named urllib.proxy_bypass_environment - imported by urllib (conditional), requests.compat (conditional)
23-
missing module named urllib.proxy_bypass - imported by urllib (conditional), requests.compat (conditional)
24-
missing module named urllib.getproxies - imported by urllib (conditional), requests.compat (conditional)
25-
missing module named urllib.urlencode - imported by urllib (conditional), requests.compat (conditional)
26-
missing module named urllib.unquote_plus - imported by urllib (conditional), requests.compat (conditional)
27-
missing module named urllib.quote_plus - imported by urllib (conditional), requests.compat (conditional)
28-
missing module named urllib.unquote - imported by urllib (conditional), requests.compat (conditional)
29-
missing module named urllib.quote - imported by urllib (conditional), requests.compat (conditional)
3021
missing module named _posixsubprocess - imported by subprocess (optional), multiprocessing.util (delayed)
3122
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
3223
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
@@ -41,7 +32,7 @@ missing module named multiprocessing.AuthenticationError - imported by multiproc
4132
missing module named asyncio.DefaultEventLoopPolicy - imported by asyncio (delayed, conditional), asyncio.events (delayed, conditional)
4233
missing module named vms_lib - imported by platform (delayed, conditional, optional)
4334
missing module named java - imported by platform (delayed)
44-
missing module named _winreg - imported by platform (delayed, optional), requests.utils (delayed, conditional, optional), pkg_resources._vendor.appdirs (delayed, conditional)
35+
missing module named _winreg - imported by platform (delayed, optional), pkg_resources._vendor.appdirs (delayed, conditional)
4536
missing module named readline - imported by cmd (delayed, conditional, optional), code (delayed, conditional, optional), pdb (delayed, optional)
4637
missing module named 'org.python' - imported by pickle (optional), xml.sax (delayed, conditional), setuptools.sandbox (conditional)
4738
missing module named posix - imported by os (conditional, optional), shutil (conditional)
@@ -137,9 +128,9 @@ missing module named ordereddict - imported by pyparsing (optional), pkg_resourc
137128
runtime module named six.moves - imported by cycler (top-level), dateutil.rrule (top-level), dateutil.tz.tz (top-level), dateutil.tz._factories (top-level), dateutil.tz.win (top-level)
138129
missing module named six.moves.range - imported by six.moves (top-level), dateutil.rrule (top-level)
139130
missing module named six.moves.zip - imported by six.moves (top-level), cycler (top-level)
140-
missing module named StringIO - imported by urllib3.packages.six (conditional), requests.compat (conditional), PyInstaller.lib.modulegraph._compat (conditional), PyInstaller.lib.modulegraph.zipio (conditional), setuptools._vendor.six (conditional), six (conditional), pkg_resources._vendor.six (conditional)
131+
missing module named StringIO - imported by PyInstaller.lib.modulegraph._compat (conditional), PyInstaller.lib.modulegraph.zipio (conditional), setuptools._vendor.six (conditional), six (conditional), pkg_resources._vendor.six (conditional)
141132
missing module named dateutil.tz.tzfile - imported by dateutil.tz (top-level), dateutil.zoneinfo (top-level)
142-
missing module named olefile - imported by PIL.FpxImagePlugin (top-level), PIL.MicImagePlugin (top-level)
133+
missing module named olefile - imported by PIL.MicImagePlugin (top-level), PIL.FpxImagePlugin (top-level)
143134
missing module named 'PySide2.QtGui' - imported by PIL.ImageQt (conditional, optional)
144135
missing module named PySide2 - imported by PIL.ImageQt (conditional, optional), matplotlib.backends.qt_compat (delayed, conditional)
145136
missing module named 'PySide6.QtGui' - imported by PIL.ImageQt (conditional, optional)
@@ -165,19 +156,3 @@ missing module named matplotlib.axes.Axes - imported by matplotlib.axes (delayed
165156
missing module named _dummy_threading - imported by dummy_threading (optional)
166157
missing module named pytest - imported by matplotlib (delayed, optional)
167158
missing module named 'typing.io' - imported by importlib.resources (top-level)
168-
missing module named Cookie - imported by requests.compat (conditional)
169-
missing module named cookielib - imported by requests.compat (conditional)
170-
missing module named urllib2 - imported by requests.compat (conditional)
171-
missing module named urlparse - imported by requests.compat (conditional)
172-
missing module named simplejson - imported by requests.compat (optional)
173-
missing module named backports - imported by urllib3.packages.ssl_match_hostname (optional)
174-
missing module named brotli - imported by urllib3.util.request (optional), urllib3.response (optional)
175-
missing module named Queue - imported by urllib3.util.queue (conditional)
176-
missing module named "'urllib3.packages.six.moves.urllib'.parse" - imported by urllib3.request (top-level), urllib3.poolmanager (top-level)
177-
runtime module named urllib3.packages.six.moves - imported by http.client (top-level), urllib3.util.response (top-level), urllib3.connectionpool (top-level), 'urllib3.packages.six.moves.urllib' (top-level), urllib3.util.queue (top-level)
178-
missing module named socks - imported by urllib3.contrib.socks (optional)
179-
missing module named cryptography - imported by urllib3.contrib.pyopenssl (top-level), requests (conditional, optional)
180-
missing module named 'OpenSSL.crypto' - imported by urllib3.contrib.pyopenssl (delayed)
181-
missing module named 'cryptography.x509' - imported by urllib3.contrib.pyopenssl (delayed, optional)
182-
missing module named 'cryptography.hazmat' - imported by urllib3.contrib.pyopenssl (top-level)
183-
missing module named OpenSSL - imported by urllib3.contrib.pyopenssl (top-level)

src/main.py renamed to src/VexTrack.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from tkinter import *
88
from tkinter import ttk, messagebox
99
from addDiag import AddDiag
10-
from updater import *
1110

1211
from datetime import *
1312

@@ -19,8 +18,11 @@
1918

2019
windowSize = vars.WINDOW_GEOMETRY.split("x")
2120

21+
with open(vars.VERSION_PATH, 'r') as f:
22+
versionString = f.read()
23+
2224
root = tk.Tk()
23-
root.title(vars.WINDOW_TITLE + " " + vars.VERSION_STRING)
25+
root.title(vars.WINDOW_TITLE + " " + versionString)
2426
root.iconbitmap("VexTrack.exe")
2527
root.geometry(vars.WINDOW_GEOMETRY)
2628
root.minsize(int(windowSize[0]), int(windowSize[1]))
@@ -564,12 +566,12 @@ def updateValues():
564566
# Main Loop
565567
# ================================
566568

567-
checkNewVersion()
569+
os.startfile(vars.UPDATER_PATH)
570+
568571
init()
569572

570573
while dailyBar == None:
571574
continue
572575

573576
updateValues()
574-
575577
root.mainloop()

src/updater.py

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,45 @@
1+
from tkinter import *
12
from tkinter import messagebox
23
import os
34
import requests
45
from vars import *
56

7+
root = Tk()
8+
root.withdraw()
9+
610
def downloadNewVersion(versionString):
11+
os.system("taskkill /f /im " + EXE_FILENAME)
12+
713
url = "https://github.com/" + GITHUB_USER + "/" + GITHUB_REPO + "/releases/download/" + versionString + "/" + EXE_FILENAME
814
r = requests.get(url)
915

1016
with open(EXE_FILENAME, 'wb') as f:
11-
f.write(r.content)
17+
f.write(r.content)
18+
19+
with open(VERSION_PATH, 'w') as f:
20+
f.write(versionString)
1221

1322
def restartProgram():
1423
os.startfile(EXE_FILENAME)
15-
exit()
24+
root.destroy()
1625

1726
def checkNewVersion():
1827
response = requests.get("https://api.github.com/repos/" + GITHUB_USER + "/" + GITHUB_REPO + "/releases/latest")
1928
latestVersionString = response.json()["tag_name"]
2029

21-
versionNumber = VERSION_STRING.split("v")[1]
30+
with open(VERSION_PATH, 'r') as f:
31+
versionString = f.read()
32+
33+
versionNumber = versionString.split("v")[1]
2234
latestVersionNumber = latestVersionString.split("v")[1]
2335

2436
if(versionNumber < latestVersionNumber):
25-
res = messagebox.askquestion("Updater", "A new version is available: " + latestVersionString + " Do you want to update?")
37+
res = messagebox.askquestion("Updater", "A new version is available: " + latestVersionString + "\nDo you want to update?")
2638
if res == "yes":
2739
downloadNewVersion(latestVersionString)
2840
messagebox.showinfo("Updater", "Update complete, program will restart now")
29-
restartProgram()
41+
42+
restartProgram()
43+
root.destroy()
44+
45+
checkNewVersion()

src/vars.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
BUFFER_DAYS = 8
99

1010
CONFIG_PATH = "dat/config.json"
11+
UPDATER_PATH = "Updater.exe"
12+
VERSION_PATH = "version"
1113

1214
WINDOW_TITLE = "Vex Track"
1315
WINDOW_GEOMETRY = "700x640"
1416

1517
GITHUB_USER = "BitTim"
1618
GITHUB_REPO = "VexTrack"
17-
EXE_FILENAME = "VexTrack.exe"
18-
VERSION_STRING = "v1.2"
19+
EXE_FILENAME = "VexTrack.exe"

version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v1.2

0 commit comments

Comments
 (0)