Added normal self-updation
This commit is contained in:
@@ -8,10 +8,12 @@ import json
|
|||||||
launchfolder = os.getcwd()
|
launchfolder = os.getcwd()
|
||||||
offprojects = launchfolder + "/OfficialProjects/"
|
offprojects = launchfolder + "/OfficialProjects/"
|
||||||
launcherfiles = offprojects + "/LAUNCHERFILES/"
|
launcherfiles = offprojects + "/LAUNCHERFILES/"
|
||||||
launchergithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/KOTIKOT_launcher.py"
|
launcherurl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/KOTIKOT_launcher.py"
|
||||||
launcherguigithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherMain.py"
|
guiurl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherMain.py"
|
||||||
launcherremindergithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherReminder.py"
|
reminderurl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherReminder.py"
|
||||||
launchersettingsgithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherSettings.py"
|
settingsurl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/KOTIKOTlauncherSettings.py"
|
||||||
|
launcherversionurl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/v"
|
||||||
|
appslisturl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/LAUNCHERFILES/apps.json"
|
||||||
|
|
||||||
|
|
||||||
# ---------------- Checking folders ----------------
|
# ---------------- Checking folders ----------------
|
||||||
@@ -23,10 +25,16 @@ if not os.path.exists(launcherfiles):
|
|||||||
|
|
||||||
# ---------------- Self-updataing launcher ----------------
|
# ---------------- Self-updataing launcher ----------------
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
urllib.request.urlretrieve(launchergithuburl, "KOTIKOT_launcher.py")
|
urllib.request.urlretrieve(appslisturl, launcherfiles + "apps.json")
|
||||||
urllib.request.urlretrieve(launcherguigithuburl, launcherfiles + "KOTIKOTlauncherMain.py")
|
|
||||||
urllib.request.urlretrieve(launcherremindergithuburl, launcherfiles + "KOTIKOTlauncherReminder.py")
|
with open(launcherfiles + "/v") as v_file:
|
||||||
urllib.request.urlretrieve(launchersettingsgithuburl, launcherfiles + "KOTIKOTlauncherSettings.py")
|
v = int(v_file.read())
|
||||||
|
if v < int(requests.get(launcherversionurl).text):
|
||||||
|
urllib.request.urlretrieve(launcherurl, "KOTIKOT_launcher.py")
|
||||||
|
urllib.request.urlretrieve(guiurl, launcherfiles + "KOTIKOTlauncherMain.py")
|
||||||
|
urllib.request.urlretrieve(reminderurl, launcherfiles + "KOTIKOTlauncherReminder.py")
|
||||||
|
urllib.request.urlretrieve(settingsurl, launcherfiles + "KOTIKOTlauncherSettings.py")
|
||||||
|
urllib.request.urlretrieve(launcherversionurl, launcherfiles + "v")
|
||||||
|
|
||||||
|
|
||||||
# ---------------- Launching GUI ----------------
|
# ---------------- Launching GUI ----------------
|
||||||
@@ -63,7 +71,6 @@ def download_app(app):
|
|||||||
|
|
||||||
|
|
||||||
def launchApp():
|
def launchApp():
|
||||||
try:
|
|
||||||
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
|
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
|
||||||
apps = json.load(appsfile)
|
apps = json.load(appsfile)
|
||||||
name = KOTIKOTlauncher.sender().text()
|
name = KOTIKOTlauncher.sender().text()
|
||||||
@@ -89,8 +96,6 @@ def launchApp():
|
|||||||
print(f"---------------- {displayName} ----------------")
|
print(f"---------------- {displayName} ----------------")
|
||||||
subprocess.Popen(str(sys.executable + " " if app['runtime'] == "python" else "") + app['run'], cwd=directory,
|
subprocess.Popen(str(sys.executable + " " if app['runtime'] == "python" else "") + app['run'], cwd=directory,
|
||||||
shell=True, close_fds=True)
|
shell=True, close_fds=True)
|
||||||
except:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
# ---------------- Checking buttons ----------------
|
# ---------------- Checking buttons ----------------
|
||||||
|
|||||||
1
OfficialProjects/LAUNCHERFILES/v
Normal file
1
OfficialProjects/LAUNCHERFILES/v
Normal file
@@ -0,0 +1 @@
|
|||||||
|
0
|
||||||
Reference in New Issue
Block a user