Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
2.18 Alpha Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Bink-Lab committed Apr 16, 2024
1 parent 1364891 commit 08e2fd8
Show file tree
Hide file tree
Showing 16 changed files with 198 additions and 116 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/env
/downloads
/downloads
TODO.md
tr.py
/backup
Binary file removed Output/Sidney-Installer.exe
Binary file not shown.
7 changes: 3 additions & 4 deletions Release Notes.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
Nieuw:

Custom autoclicker
Pikachu :3
- Minecraft [ Werkt misschien ]

----------------------
Verwijderd:

Nada
- Onnodige items

----------------------
Kapot:

Minecraft werkt op het moment niet.
Minecraft werkt op het moment niet 100%
Binary file modified __pycache__/installer.cpython-311.pyc
Binary file not shown.
Binary file modified func/__pycache__/funcs.cpython-311.pyc
Binary file not shown.
Binary file removed func/api/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed func/api/__pycache__/funcs.cpython-311.pyc
Binary file not shown.
Binary file modified func/api/__pycache__/quotes_api.cpython-311.pyc
Binary file not shown.
Binary file added func/api/__pycache__/update.cpython-311.pyc
Binary file not shown.
3 changes: 1 addition & 2 deletions func/api/quotes_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ def get_random_quote():

def print_quote(quote_data):
if quote_data:
cprint("Een random quote:\n", 'white')
for q in quote_data:
cprint(f'"{q["content"]}"\n', 'white')
cprint(f"- {q['author']}", 'white')
cprint(f"- {q['author']}\n", 'white')

def quote():
quote_data = get_random_quote()
Expand Down
69 changes: 69 additions & 0 deletions func/api/update.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import requests
import os
import time
import wget
import keyboard
from termcolor import cprint, colored
from func.funcs import *

def github():
# URL of the Github API
url = "https://api.github.com/repos/bink-lab/Installer/releases/latest"

try:
# Get the release information
response = requests.get(url)
response.raise_for_status() # Raise an exception for bad status codes
release = response.json()

# Compare the tag name with the current version
current_version = "2.18-Alpha"
# Replace with the current version
if release["tag_name"] > current_version:
os.system("cls")
watermark()
cprint("[ INFO ] A new update is available! \n", 'white')
# Find the asset with exe extension (self-installer)
exe_asset = next((asset for asset in release["assets"] if asset["name"].endswith(".exe")), None)
# Find the asset with zip extension (source code)
zip_asset = next((asset for asset in release["assets"] if asset["name"].endswith(".zip")), None)
if exe_asset and zip_asset:
# Ask user for their choice
cprint("[ INFO ] Choose the update type:\n", 'white')
cprint("[1] Self-installer (exe)", 'white')
cprint("[2] Source code (zip)", 'white')
cprint("[3] Continue with current version", 'white')
choice = input(colored("\n[ INFO ] Enter the number corresponding to your choice: ", 'white'))
if choice == '1':
download_url = exe_asset['browser_download_url']
elif choice == '2':
download_url = zip_asset['browser_download_url']
elif choice == '3':
cprint("\n[ INFO ] Continuing with current version.", 'white')
return
else:
cprint("\n[ ERROR ] Invalid choice. Exiting update process.", 'red')
return

cprint(f"[ INFO ] Downloading the latest version from: {download_url}\n", 'white')
quote()
filename = wget.download(download_url)
os.system("cls")
watermark()
cprint(f"\n\n[ Update downloaded: {filename} ]\n", 'white')
cprint("[ INFO ] Use the new version!", 'white')
cprint("[ INFO ] Opening download directory...", 'white')
time.sleep(2) # Wait for a moment before opening the directory
directory = os.path.dirname(os.path.realpath(filename))
subprocess.Popen(f'explorer "{directory}"') # Open directory in file explorer
cprint("[ INFO ] Press 'esc' to exit", 'white')
keyboard.wait("esc")
exit()
else:
cprint("\n[ ERROR ] Could not find both exe and zip files for this update.", 'red')
else:
cprint("\n[ INFO ] Current version is up-to-date.", 'white')
except requests.RequestException as e:
cprint("\n[ ERROR ] Error fetching release information:", 'red')
cprint(str(e), 'red')
time.sleep(2)
30 changes: 3 additions & 27 deletions func/funcs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time
import requests
import wget
import subprocess
import os
import keyboard
from termcolor import colored, cprint
Expand Down Expand Up @@ -34,35 +35,10 @@ def watermark():
\$$$$$$ |
\______/ \n\n""", 'white'))

def github():
# URL van de Github API
url = "https://api.github.com/repos/bink-lab/Installer/releases/latest"

try:
# Haal de release informatie
response = requests.get(url)
response.raise_for_status() # Raise an exception for bad status codes
release = response.json()

# Vergelijk de tagnaam met de huidige versie
current_version = "2.12-Alpha"
# Vervang met de huidige versie
if release["tag_name"] > current_version:
cprint("[ INFO ] Er is een nieuwe update beschikbaar! \n", 'white')
cprint("[ INFO ] Download de nieuwste versie: ", release["assets"][0]["browser_download_url"], " \n", 'white')
quote()
filename = wget.download(release["assets"][0]["browser_download_url"])
cprint(f"\n\n[ Update gedownload: {filename} ]\n", 'white')
cprint("[ INFO ] Gebruik de nieuwe versie!", 'white')
cprint("[ INFO ] Druk op 'esc' om te stoppen", 'white')
keyboard.wait("esc")
exit()
else:
cprint("\n[ INFO ] Huidige versie is up-to-date.", 'white')
except requests.RequestException as e:
cprint("\n[ ERROR ] Fout bij het ophalen van release informatie:", 'red')
cprint(str(e), 'red')
time.sleep(2)





Binary file modified installer.exe
Binary file not shown.
Loading

0 comments on commit 08e2fd8

Please sign in to comment.