Skip to content

Commit

Permalink
1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
v-pun215 authored Jul 10, 2023
1 parent 07d69a8 commit 14a8b62
Show file tree
Hide file tree
Showing 7 changed files with 134 additions and 10 deletions.
2 changes: 1 addition & 1 deletion check.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1
0
19 changes: 17 additions & 2 deletions eclient.pyw
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import json
from tkinter import *
from tkinter import ttk
from ttkbootstrap import Style
from tkinter.ttk import Progressbar
from tkinter.messagebox import askquestion, showinfo
Expand All @@ -18,9 +20,9 @@ import ctypes
windll.shcore.SetProcessDpiAwareness(1)
myappid = u'vpun215.eclient.idk.1.0' # arbitrary string
ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)

first=False
currn_dir = os.getcwd()
mc_dir = r"{}/.minecraft".format(currn_dir)
mc_dir = r"{}\.minecraft".format(currn_dir)
os_name = platform.platform()

def get_size(bytes, suffix="B"):
Expand Down Expand Up @@ -117,6 +119,7 @@ if not os.path.exists(r"{}/settings.json".format(currn_dir)):
with open("settings.json", "w") as js_set:
json.dump(settings, js_set, indent=4)
js_set.close()
first = True
else:
pass

Expand Down Expand Up @@ -191,6 +194,7 @@ if not os.path.exists(r"{}/settings.json".format(currn_dir)):
font = ("SF Pro Display", int(13.0)),
bg="#3a3a3a",
fg="cyan1")
first=True

else:
c1 = Label(
Expand All @@ -200,6 +204,17 @@ else:
fg="cyan1")

c1.place(x=248, y=350)
def open_popup():
top= Toplevel(root)
top.geometry("450x250")
top.title("Welcome to eClient!")
Label(top, text= "Welcome to eClient!", font=("SF Pro Display", 25,'bold')).place(x=25,y=20)
Label(top, text= "If you have any issues, fell free to report them at the ", font=("SF Pro Display", 11)).place(x=10,y=90)
Label(top, text= "GitHub.", font=("SF Pro Display", 11)).place(x=10,y=110)
#root.after(10000)
if first == True:
open_popup()


root.after(10000, lambda: c1.configure(text="Getting everything ready...."))

Expand Down
Binary file added eclient.zip
Binary file not shown.
108 changes: 103 additions & 5 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,115 @@
import platform
import getpass
import time
import wget
import shutil
from elevate import elevate
elevate()

print("Welcome to eClient.")

print("-eClient Setup-")
print("Getting necessary stuff...")
time.sleep(5)
time.sleep(2)
os_name = platform.platform()
usr_accnt = getpass.getuser()
currn_dir = os.getcwd()
py_ver = platform.python_version()
def end():
print("Thank you for choosing eClient.")
print("Setup will now start installing eClient.")
dire = input("Where do you want to install eClient? (Default: C:\\Users\\{}\\AppData\\Roaming\\eClient): ".format(usr_accnt))
if dire == "":
print("Installing eClient to default directory...")
os.chdir(r"C:\\Users\\{}\\AppData\\Roaming\\".format(usr_accnt))
wget.download("https://eclient-libs.earthsoft.me/eclient.zip", bar=wget.bar_adaptive)
filename3 = wget.detect_filename("https://eclient-libs.earthsoft.me/eclient.zip")
os.system('powershell -Command "Expand-Archive -LiteralPath eclient.zip -DestinationPath eClient"')
os.system("del eclient.zip")
wget.download("https://eclient-libs.earthsoft.me/Install-Font.ps1", bar=wget.bar_adaptive)
wget.download("https://eclient-libs.earthsoft.me/command.py", bar=wget.bar_adaptive)
filename5= wget.detect_filename("https://eclient-libs.earthsoft.me/command.py")
filename4 = wget.detect_filename("https://eclient-libs.earthsoft.me/Install-Font.ps1")
os.system('move "Install-Font.ps1" "eClient/fonts"')
os.chdir(r"C:\\Users\\{}\\AppData\\Roaming\\eClient\fonts".format(usr_accnt))
os.system("powershell -executionpolicy bypass -File .\Install-Font.ps1 .\SF Pro Display Regular.otf")
os.system("powershell -executionpolicy bypass -File .\Install-Font.ps1 .\SF Pro Display Bold.otf")
os.chdir(r"C:\\Users\\{}\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\minecraft_launcher_lib\\".format(usr_accnt))
os.system("del command.py")
os.chdir(r"C:\\Users\\{}\\AppData\\Roaming\\".format(usr_accnt))
shutil.move('command.py', 'C:\\Users\\{}\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\minecraft_launcher_lib\\'.format(usr_accnt))
print("eClient installed.")
print("Creating shortcut...")
wget.download("https://eclient-libs.earthsoft.me/shortcut.exe", bar=wget.bar_adaptive)
shutil.move('shortcut.exe', 'C:\\Windows\\System32'.format(usr_accnt))
google = "C:\\Users\\{}\\AppData\\Roaming\\eClient".format(usr_accnt)
os.chdir(r"C:\\Users\\{}\\Desktop\\ ".format(usr_accnt))
os.system(f"shortcut.exe /F:eClient.lnk /A:C /T:{google}\\eclient.pyw /W:{google} /I:{google}\\mc.ico")
elif not dire == "":
print("Installing eClient to {}...".format(dire))
os.chdir(dire)
wget.download("https://eclient-libs.earthsoft.me/eclient.zip", bar=wget.bar_adaptive)
filename3 = wget.detect_filename("https://eclient-libs.earthsoft.me/eclient.zip")
os.system('powershell -Command "Expand-Archive -LiteralPath eclient.zip -DestinationPath eClient"')
os.system("del eclient.zip")
wget.download("https://eclient-libs.earthsoft.me/Install-Font.ps1", bar=wget.bar_adaptive)
wget.download("https://eclient-libs.earthsoft.me/command.py", bar=wget.bar_adaptive)
filename5= wget.detect_filename("https://eclient-libs.earthsoft.me/command.py")
filename4 = wget.detect_filename("https://eclient-libs.earthsoft.me/Install-Font.ps1")
shutil.move('Install-Font.ps1', 'eClient/fonts')
os.chdir("{}\\eClient\\fonts".format(dire))
os.system("powershell -executionpolicy bypass -File .\Install-Font.ps1 .\SF Pro Display Regular.otf")
os.system("powershell -executionpolicy bypass -File .\Install-Font.ps1 .\SF Pro Display Bold.otf")
os.chdir(r"C:\\Users\\{}\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\minecraft_launcher_lib\\".format(usr_accnt))
os.system("del command.py")
os.chdir(dire)
shutil.move('command.py', 'C:\\Users\\{}\\AppData\\Local\\Programs\\Python\\Python310\\Lib\\site-packages\\minecraft_launcher_lib\\'.format(usr_accnt))
print("eClient installed.")
print("Creating shortcut...")
wget.download("https://eclient-libs.earthsoft.me/shortcut.exe", bar=wget.bar_adaptive)
shutil.move('shortcut.exe', 'C:\\Windows\\System32'.format(usr_accnt))
google2 = "{}\\eClient".format(dire)
os.chdir(r"C:\\Users\\{}\\Desktop\\ ".format(usr_accnt))
os.system(f"shortcut.exe /F:eClient.lnk /A:C /T:{google2}\\eclient.pyw /W:{google2} /I:{google2}\\mc.ico")
print("Shortcut created.")
os.system("pause")


def java():
inst = input("Do you have Java 17 installed? (Y/N): ")
if inst == "Y" or "y":
print("Ok.")
end()
elif inst == "N" or "n":
os.system("cls")
print("Installing Java 17.....")
wget.download("https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64.msi", bar=wget.bar_adaptive)
filename2 = wget.detect_filename("https://download.bell-sw.com/java/17.0.3+7/bellsoft-jdk17.0.3+7-windows-amd64.msi")
os.system(f"msiexec /i {filename2}")
time.sleep(5)
os.remove(f"{filename2}")
end()
def dep():
os.system("cls")
wget.download("https://libs-pi.vercel.app/requirements.txt", bar=wget.bar_adaptive)
os.system("pip install -r requirements.txt")
os.system("cls")
java()

if os_name.startswith("Linux"):
py = input("Do you have Python 3.10 installed? (Y/N): ")
if py == "Y" or "y":
print("Ok, installing packages.")
dep()
elif py == "N" or "n":
print("Installing Python 3.10...")
wget.download("https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exe", bar=wget.bar_adaptive)
filename = wget.detect_filename("https://www.python.org/ftp/python/3.10.0/python-3.10.0-amd64.exei")
os.system(f"msiexec /i {filename}")
time.sleep(5)
os.remove(f"{filename}")
dep()


'''if os_name.startswith("Linux"):
os.system("clear")
os.system("python3 -m pip install -r requirements.txt")
os.system("sudo apt-get install gksudo fonts-symbola autoconf automake libtool gcc tor gtk2-engines-murrine python3 -y")
Expand All @@ -37,7 +135,7 @@
os.system("pip install -r requirements.txt")
os.system("cls")
os.chdir(r"C:\\Users\\{}\\Downloads\\ ".format(usr_accnt))
import wget
os.system("cls")
print("Installing Java 17.....")
Expand All @@ -47,4 +145,4 @@
time.sleep(5)
os.remove(f"{filename}")
print("All requirements installed. Run eclient.py now to run the launcher.")

'''
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ def lunar():
font = ("SF Pro Display", int(20.0), "bold"))
self.canvas11.create_text(
508.0, 420.0,
text = "Version 1.1",
text = "Version 1.2",
fill = "white",
font = ("SF Pro Display", int(12.0)))
self.canvas11.create_text(
Expand Down Expand Up @@ -2471,7 +2471,7 @@ def confirm(self):
def password_window(self):
self.p3 = tk.Toplevel()
self.p3.title("Enter Password")
self.p3.geometry("630x300")
self.p3.geometry("630x200")

self.p3.configure(bg="white")
self.p3.resizable(False,False)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ speedtest-cli
psutil
pywebview
customtkinter
elevate

10 changes: 10 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os, getpass, wget, shutil
from elevate import elevate
usr_accnt = getpass.getuser()
elevate()
print("Creating shortcut...")
#wget.download("https://eclient-libs.earthsoft.me/shortcut.exe", bar=wget.bar_adaptive)
#shutil.move('shortcut.exe', 'C:\\Windows\\System32'.format(usr_accnt))
google = "C:\\Users\\{}\\AppData\\Roaming\\eClient".format(usr_accnt)
os.chdir(r"C:\\Users\\{}\\Desktop\\ ".format(usr_accnt))
os.system(f"shortcut.exe /F:eClient.lnk /A:C /T:{google}\\eclient.pyw /W:{google} /I:{google}\\mc.ico")

0 comments on commit 14a8b62

Please sign in to comment.