Fixed crash on launch

This commit is contained in:
Cuptain 2024-06-21 00:23:23 +10:00
parent 1212dd49c6
commit 460e99dcd4

19
Main.py
View File

@ -8,6 +8,8 @@ import time
import tkinter as tk
from tkinter import filedialog
import configparser
import customtkinter
from customtkinter import *
# Initialize a configparser object for managing the configuration file
config = configparser.ConfigParser()
@ -52,15 +54,16 @@ def main():
stored_prism_instance_path = default_prism_instance_path
# GUI for selecting Prism instance path
root = tk.Tk()
root.title("Select Prism Instance Path")
app = CTk()
set_appearance_mode("dark")
#root.title("Select Prism Instance Path")
# Label for instructions
label = tk.Label(root, text="Select Prism instance path:")
label = CTkLabel(master=app, text="Select Prism instance path:")
label.pack(pady=10)
# Entry widget for Prism instance path
prism_instance_path_entry = tk.Entry(root, width=50)
prism_instance_path_entry = CTkEntry(master=app, width=50)
prism_instance_path_entry.pack(pady=5)
# If a stored Prism instance path exists, pre-fill the entry widget
@ -68,20 +71,20 @@ def main():
prism_instance_path_entry.insert(0, stored_prism_instance_path)
# Button to select directory
select_button = tk.Button(root, text="Browse...", command=select_prism_instance_path)
select_button = CTkButton(master=app, text="Browse...", command=select_prism_instance_path)
select_button.pack(pady=5)
# Function to proceed with installation
def start_installation():
prism_instance_path = prism_instance_path_entry.get()
root.destroy() # Close the GUI window
app.destroy() # Close the GUI window
perform_installation(instance_name, prism_command, prism_instance_path)
# Button to start installation
install_button = tk.Button(root, text="Launch Minecraft", command=start_installation)
install_button = CTkButton(master=app, text="Launch Minecraft", command=start_installation)
install_button.pack(pady=10)
root.mainloop()
app.mainloop()
def perform_installation(instance_name, prism_command, prism_instance_path):
ftp = FTP("gitea.piwalker.net")