diff --git a/KOTIKOT_launcher.py b/KOTIKOT_launcher.py index b1527ac..8aa0197 100644 --- a/KOTIKOT_launcher.py +++ b/KOTIKOT_launcher.py @@ -27,8 +27,12 @@ if not os.path.exists(launcherfiles): if __name__ == "__main__": urllib.request.urlretrieve(appslisturl, launcherfiles + "apps.json") - with open(launcherfiles + "/v") as v_file: - v = int(v_file.read()) + try: + with open(launcherfiles + "/v") as v_file: + v = int(v_file.read()) + except: + v = -1 + if v < int(requests.get(launcherversionurl).text): urllib.request.urlretrieve(launcherurl, "KOTIKOT_launcher.py") urllib.request.urlretrieve(guiurl, launcherfiles + "KOTIKOTlauncherMain.py") @@ -82,8 +86,11 @@ def launchApp(): download_app(app) else: - with open(directory + "/v") as v_file: - v = int(v_file.read()) + try: + with open(directory + "/v") as v_file: + v = int(v_file.read()) + except: + v = -1 if v < int(requests.get('/'.join(app['urls'][0].split('/')[:-1]) + '/v').text): print('Current app version is ' + str(v) + ' and new version is ' + requests.get('/'.join(app['urls'][0].split('/')[:-1]) + '/v').text) diff --git a/OfficialProjects/LAUNCHERFILES/v b/OfficialProjects/LAUNCHERFILES/v index c227083..56a6051 100644 --- a/OfficialProjects/LAUNCHERFILES/v +++ b/OfficialProjects/LAUNCHERFILES/v @@ -1 +1 @@ -0 \ No newline at end of file +1 \ No newline at end of file