Dev new system, launcher will not work until update

This commit is contained in:
BarsTiger
2022-03-18 22:00:36 +02:00
parent e211f5ac19
commit 6e86136ae9
21 changed files with 231 additions and 150 deletions

View File

@@ -1,6 +1,9 @@
import urllib.request, os, time, sys, subprocess
from subprocess import *
from PyQt5 import *
import urllib.request
import os
import sys
import subprocess
import requests
import json
launchfolder = os.getcwd()
offprojects = launchfolder + "/OfficialProjects/"
@@ -10,40 +13,74 @@ launcherguigithuburl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_
launcherremindergithuburl = "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"
################### Checking folders #####################
# ---------------- Checking folders ----------------
if not os.path.exists(offprojects):
os.mkdir(offprojects)
if not os.path.exists(launcherfiles):
os.mkdir(launcherfiles)
################### Self-updataing launcher #####################
urllib.request.urlretrieve(launchergithuburl, "KOTIKOT_launcher.py")
urllib.request.urlretrieve(launcherguigithuburl, launcherfiles + "KOTIKOTlauncherMain.py")
urllib.request.urlretrieve(launcherremindergithuburl, launcherfiles + "KOTIKOTlauncherReminder.py")
urllib.request.urlretrieve(launchersettingsgithuburl, launcherfiles + "KOTIKOTlauncherSettings.py")
# ---------------- Self-updataing launcher ----------------
# if __name__ == "__main__":
# urllib.request.urlretrieve(launchergithuburl, "KOTIKOT_launcher.py")
# urllib.request.urlretrieve(launcherguigithuburl, launcherfiles + "KOTIKOTlauncherMain.py")
# urllib.request.urlretrieve(launcherremindergithuburl, launcherfiles + "KOTIKOTlauncherReminder.py")
# urllib.request.urlretrieve(launchersettingsgithuburl, launcherfiles + "KOTIKOTlauncherSettings.py")
################### Launching GUI #####################
# ---------------- Launching GUI ----------------
import OfficialProjects.LAUNCHERFILES.KOTIKOTlauncherMain as kkui
import OfficialProjects.LAUNCHERFILES.KOTIKOTlauncherSettings as kkset
import OfficialProjects.LAUNCHERFILES.KOTIKOTlauncherReminder as kkrem
app = kkui.QtWidgets.QApplication(sys.argv)
KOTIKOTlauncher = kkui.QtWidgets.QMainWindow()
ui = kkui.Ui_KOTIKOTlauncher()
ui.setupUi(KOTIKOTlauncher)
KOTIKOTlauncher.show()
if __name__ == "__main__":
KOTIKOTlauncher.show()
KOTIKOTsettings = kkset.QtWidgets.QMainWindow()
uiset = kkset.Ui_Form()
uiset.setupUi(KOTIKOTsettings)
Popen('python ' + launcherfiles + "KOTIKOTlauncherReminder.py", shell=True)
KOTIKOTreminder = kkrem.QtWidgets.QMainWindow()
uirem = kkrem.Ui_Form()
uirem.setupUi(KOTIKOTreminder)
################### Launching programs (func) #####################
# ---------------- Launching programs ----------------
def openSettings():
KOTIKOTsettings.show()
def download_app(app):
for url in app['urls']:
print('Downloading ' + url)
urllib.request.urlretrieve(url, offprojects + app['dir'] + "/" + url.split("/")[-1])
print('Finished')
def launchApp():
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
apps = json.load(appsfile)
name = KOTIKOTlauncher.sender().text()
app = apps[name]
directory = offprojects + app['dir']
if not os.path.exists(directory):
os.mkdir(directory)
download_app(app)
else:
with open(directory + "/v") as v_file:
v = int(v_file.read())
if v < int(requests.get('/'.join(app['urls'][0][:-1])).text):
print('bebras')
download_app(app)
def launchAutoShipper():
autoShipperDir = offprojects + "/AutoShipper/"
autoShipperUrl = "https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/AutoShipper/autoshipper.py"
@@ -224,23 +261,12 @@ def launchKotoPythonCompiler():
os.system("python " + KotoPythonCompiler)
################### Checking buttons #####################
ui.pushButton_1.clicked.connect(launchAutoShipper)
ui.pushButton_2.clicked.connect(launchAutoBridger)
ui.pushButton_3.clicked.connect(launchCatBench)
ui.pushButton_4.clicked.connect(launchautoPageRestarter)
ui.pushButton_5.clicked.connect(launchFilesConnector)
ui.pushButton_6.clicked.connect(launchMeowarch)
ui.pushButton_7.clicked.connect(launchPyQtConverter)
ui.pushButton_8.clicked.connect(launchfileGenerator)
ui.pushButton_9.clicked.connect(launchSuperTimer)
ui.pushButton_10.clicked.connect(launchKotoGameScam)
ui.pushButton_11.clicked.connect(launchNoHiddenText)
ui.pushButton_12.clicked.connect(launchAutoBridger2)
ui.pushButton_13.clicked.connect(launchKotoGTAsingler)
ui.pushButton_14.clicked.connect(launchKOTO_LAN_Control)
ui.pushButton_15.clicked.connect(launchKotoPythonCompiler)
# ---------------- Checking buttons ----------------
for button in ui.buttons:
button.clicked.connect(launchApp)
ui.actionOpen_settings.triggered.connect(openSettings)
################### Exiting #####################
sys.exit(app.exec_())
# ---------------- Executing and exiting ----------------
if __name__ == "__main__":
sys.exit(app.exec_())

View File

@@ -6,8 +6,8 @@ ping -n 3 localhost > nul
ping -n 3 localhost > nul
ping -n 3 localhost > nul
@echo ----- Downloadig Python from official site --------------------------------------------------
@echo ----- python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe ------------------------------------
powershell -command iwr https://www.python.org/ftp/python/3.10.1/python-3.10.1-amd64.exe -OutFile python.exe
@echo ----- python.org/ftp/python/3.10.3/python-3.10.3-amd64.exe ------------------------------------
powershell -command iwr https://www.python.org/ftp/python/3.10.3/python-3.10.3-amd64.exe -OutFile python.exe
@echo ----- After installing python, run Install-KOTIKOT_launcher to install KOTIKOT_launcher -----
@echo off
ping -n 3 localhost > nul

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -1,124 +1,56 @@
from PyQt5 import QtCore, QtGui, QtWidgets
import json
class Ui_KOTIKOTlauncher(object):
def setupUi(self, KOTIKOTlauncher):
# self.gridLayout.addWidget(self.pushButton, ряд, столбец, 1, 1)
@staticmethod
def genSize() -> tuple:
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
apps = len(list(json.load(appsfile)))
h = 1
w = 1
while h * w < apps:
h += 1
if h * w < apps:
w += 1
return h * 105 + 5, w * 105 + 25, w
def setupUi(self, KOTIKOTlauncher):
self.genSize()
KOTIKOTlauncher.setObjectName("KOTIKOTlauncher")
KOTIKOTlauncher.resize(434, 470)
KOTIKOTlauncher.setMinimumSize(QtCore.QSize(50, 50))
KOTIKOTlauncher.setMaximumSize(QtCore.QSize(16777215, 16777215))
self.size = self.genSize()
KOTIKOTlauncher.resize(self.size[0], self.size[1])
KOTIKOTlauncher.setMinimumSize(QtCore.QSize(self.size[0], self.size[1]))
KOTIKOTlauncher.setMaximumSize(QtCore.QSize(self.size[0], self.size[1]))
self.centralwidget = QtWidgets.QWidget(KOTIKOTlauncher)
self.centralwidget.setObjectName("centralwidget")
self.gridLayoutWidget = QtWidgets.QWidget(self.centralwidget)
self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 431, 435))
self.gridLayoutWidget.setGeometry(QtCore.QRect(0, 0, 425, 425))
self.gridLayoutWidget.setObjectName("gridLayoutWidget")
self.gridLayout = QtWidgets.QGridLayout(self.gridLayoutWidget)
self.gridLayout.setContentsMargins(7, 7, 7, 7)
self.gridLayout.setSpacing(7)
self.gridLayout.setContentsMargins(5, 5, 5, 5)
self.gridLayout.setSpacing(5)
self.gridLayout.setObjectName("gridLayout")
self.pushButton_1 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_1.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_1.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_1.setStyleSheet("")
self.pushButton_1.setObjectName("pushButton")
self.gridLayout.addWidget(self.pushButton_1, 0, 0, 1, 1)
with open("OfficialProjects/LAUNCHERFILES/apps.json") as appsfile:
apps = list(json.load(appsfile))
self.pushButton_2 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_2.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_2.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_2.setObjectName("pushButton_2")
self.gridLayout.addWidget(self.pushButton_2, 0, 1, 1, 1)
self.pushButton_3 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_3.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_3.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_3.setObjectName("pushButton_3")
self.gridLayout.addWidget(self.pushButton_3, 0, 2, 1, 1)
self.pushButton_4 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_4.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_4.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_4.setObjectName("pushButton_4")
self.gridLayout.addWidget(self.pushButton_4, 1, 0, 1, 1)
self.pushButton_5 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_5.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_5.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_5.setObjectName("pushButton_5")
self.gridLayout.addWidget(self.pushButton_5, 1, 1, 1, 1)
self.pushButton_6 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_6.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_6.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_6.setObjectName("pushButton_6")
self.gridLayout.addWidget(self.pushButton_6, 1, 2, 1, 1)
self.pushButton_7 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_7.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_7.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_7.setObjectName("pushButton_7")
self.gridLayout.addWidget(self.pushButton_7, 3, 0, 1, 1)
self.pushButton_8 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_8.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_8.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_8.setObjectName("pushButton_8")
self.gridLayout.addWidget(self.pushButton_8, 3, 1, 1, 1)
self.pushButton_9 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_9.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_9.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_9.setObjectName("pushButton_9")
self.gridLayout.addWidget(self.pushButton_9, 3, 2, 1, 1)
self.pushButton_10 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_10.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_10.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_10.setObjectName("pushButton_100")
self.gridLayout.addWidget(self.pushButton_10, 0, 4, 1, 1)
self.pushButton_11 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_11.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_11.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_11.setObjectName("pushButton_11")
self.gridLayout.addWidget(self.pushButton_11, 1, 4, 1, 1)
self.pushButton_12 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_12.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_12.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_12.setObjectName("pushButton_12")
self.gridLayout.addWidget(self.pushButton_12, 3, 4, 1, 1)
self.pushButton_13 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_13.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_13.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_13.setObjectName("pushButton_13")
self.gridLayout.addWidget(self.pushButton_13, 4, 0, 1, 1)
self.pushButton_14 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_14.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_14.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_14.setObjectName("pushButton_14")
self.gridLayout.addWidget(self.pushButton_14, 4, 1, 1, 1)
self.pushButton_15 = QtWidgets.QPushButton(self.gridLayoutWidget)
self.pushButton_15.setMinimumSize(QtCore.QSize(100, 100))
self.pushButton_15.setMaximumSize(QtCore.QSize(100, 100))
self.pushButton_15.setObjectName("pushButton_15")
self.gridLayout.addWidget(self.pushButton_15, 4, 2, 1, 1)
self.buttons = list()
for i in range(len(apps)):
self.buttons.append(QtWidgets.QPushButton(self.gridLayoutWidget))
self.buttons[i].setMinimumSize(QtCore.QSize(100, 100))
self.buttons[i].setMaximumSize(QtCore.QSize(100, 100))
self.buttons[i].setObjectName(apps[i])
self.buttons[i].setText(apps[i])
self.gridLayout.addWidget(self.buttons[i], i // self.size[2], i % self.size[2], 1, 1)
KOTIKOTlauncher.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(KOTIKOTlauncher)
self.menubar.setGeometry(QtCore.QRect(0, 0, 434, 21))
self.menubar.setObjectName("menubar")
KOTIKOTlauncher.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(KOTIKOTlauncher)
self.statusbar.setObjectName("statusbar")
KOTIKOTlauncher.setStatusBar(self.statusbar)
self.menuSettings = QtWidgets.QMenu(self.menubar)
self.menubar.addAction(self.menuSettings.menuAction())
@@ -126,7 +58,6 @@ class Ui_KOTIKOTlauncher(object):
self.actionOpen_settings.setObjectName("actionOpen_settings")
self.menuSettings.addAction(self.actionOpen_settings)
self.retranslateUi(KOTIKOTlauncher)
QtCore.QMetaObject.connectSlotsByName(KOTIKOTlauncher)
@@ -135,21 +66,6 @@ class Ui_KOTIKOTlauncher(object):
KOTIKOTlauncher.setWindowTitle(_translate("KOTIKOTlauncher", "KOTIKOTlauncher"))
self.menuSettings.setTitle(_translate("KOTIKOTlauncher", "Settings"))
self.actionOpen_settings.setText(_translate("KOTIKOTlauncher", "Open settings"))
self.pushButton_1.setText(_translate("KOTIKOTlauncher", "AutoShipper"))
self.pushButton_2.setText(_translate("KOTIKOTlauncher", "Bars`s auto\nbridger"))
self.pushButton_3.setText(_translate("KOTIKOTlauncher", "CatBench"))
self.pushButton_4.setText(_translate("KOTIKOTlauncher", "autoPage\nRestarter"))
self.pushButton_5.setText(_translate("KOTIKOTlauncher", "Files\nconnector"))
self.pushButton_6.setText(_translate("KOTIKOTlauncher", "Meowarch"))
self.pushButton_7.setText(_translate("KOTIKOTlauncher", "PyQt\nconverter"))
self.pushButton_8.setText(_translate("KOTIKOTlauncher", "File\ngenerator"))
self.pushButton_9.setText(_translate("KOTIKOTlauncher", "SuperTimer"))
self.pushButton_10.setText(_translate("KOTIKOTlauncher", "Koto\nGame\nScam"))
self.pushButton_11.setText(_translate("KOTIKOTlauncher", "noHidden\nText"))
self.pushButton_12.setText(_translate("KOTIKOTlauncher", "Bars`s auto\nbridger 2"))
self.pushButton_13.setText(_translate("KOTIKOTlauncher", "KotoGTA\nSingler"))
self.pushButton_14.setText(_translate("KOTIKOTlauncher", "KOTO_LAN\nControl"))
self.pushButton_15.setText(_translate("KOTIKOTlauncher", "Koto\nPython\nCompiler"))
if __name__ == "__main__":

View File

@@ -1,5 +1,6 @@
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
@@ -17,7 +18,7 @@ class Ui_Form(object):
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "ALWAYS CHECK TERMINAL"))
self.label.setText(_translate("Form", "<html><head/><body><p>Some apps will open in terminal.</p><p>You should check it!</p></body></html>"))
self.label.setText(_translate("Form", "This app opened in terminal"))
if __name__ == "__main__":

View File

@@ -0,0 +1,122 @@
{
"AutoShipper":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/AutoShipper/autoshipper.py"],
"dir": "AutoShipper",
"runtime": "python",
"run": "autoshipper.py",
"window": false
},
"Bars`s \nauto \nbridger":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/AutoBridger/AutoBridge.py"],
"dir": "AutoBridger",
"runtime": "python",
"run": "AutoBridge.py",
"window": false
},
"CatBench":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/CatBench/CatBench.py"],
"dir": "CatBench",
"runtime": "python",
"run": "CatBench.py",
"window": false
},
"autoPage\nRestarter":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/CoolAutoPressers/autoPageRestarter.py"],
"dir": "autoPageRestarter",
"runtime": "python",
"run": "autoPageRestarter.py",
"window": false
},
"Files connector":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/FilesConnector/FilesConnector.py"],
"dir": "FilesConnector",
"runtime": "python",
"run": "FilesConnector.py",
"window": true
},
"Meowarch":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/meowarch/meowarch.py"],
"dir": "meowarch",
"runtime": "python",
"run": "meowarch.py",
"window": true
},
"PyQtConverter":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/PyQtConverter/PyQtConverter.py"],
"dir": "PyQtConverter",
"runtime": "python",
"run": "PyQtConverter.py",
"window": true
},
"File generator":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/RandomBigOrSmallFileCreator/fileGenerator.py"],
"dir": "fileGenerator",
"runtime": "python",
"run": "fileGenerator.py",
"window": false
},
"SuperTimer":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/SuperTimer/SuperTimer.py"],
"dir": "SuperTimer",
"runtime": "python",
"run": "SuperTimer.py",
"window": false
},
"KotoGameScam":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/KotoGameScam/KotoGameScam.py"],
"dir": "KotoGameScam",
"runtime": "python",
"run": "KotoGameScam.py",
"window": true
},
"noHiddenText":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/noHiddenText/noHiddenText.py"],
"dir": "noHiddenText",
"runtime": "python",
"run": "noHiddenText.py",
"window": false
},
"Bars`s \nauto \nbridger 2":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/AutoBridger2/AutoBridger2.py"],
"dir": "AutoBridger2",
"runtime": "python",
"run": "AutoBridger2.py",
"window": false
},
"KOTO_LAN\nControl":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/KOTO_LAN_Control/KOTO_LAN_Control.py"],
"dir": "KOTO_LAN_Control",
"runtime": "python",
"run": "KOTO_LAN_Control.py",
"window": true
},
"KotoGTAsingler":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/KotoGTAsingler/KotoGTAsingler.py"],
"dir": "KotoGTAsingler",
"runtime": "python",
"run": "KotoGTAsingler.py",
"window": true
},
"KotoPython\nCompiler":
{
"urls": ["https://raw.githubusercontent.com/BarsTiger/KOTIKOTapps_download_repo/master/OfficialProjects/KotoPythonCompiler/KotoPythonCompiler.py"],
"dir": "KotoPythonCompiler",
"runtime": "python",
"run": "KotoPythonCompiler.py",
"window": true
}
}

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0

View File

@@ -0,0 +1 @@
0