From d5cd159d2c21a89671ba5713da1cfba1edb4c80f Mon Sep 17 00:00:00 2001 From: faroukbmiled Date: Sat, 7 Oct 2023 15:09:42 +0100 Subject: [PATCH] Fixes for python 3.12 --- boiiiwd_package/src/main.py | 4 ++-- boiiiwd_package/src/settings_tab.py | 4 ++-- build.py | 12 ++++++++---- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/boiiiwd_package/src/main.py b/boiiiwd_package/src/main.py index 9b3cc11..1f39bcf 100644 --- a/boiiiwd_package/src/main.py +++ b/boiiiwd_package/src/main.py @@ -901,7 +901,7 @@ class BOIIIWD(ctk.CTk): start_time = 0 while not os.path.exists(map_folder) and not self.settings_tab.stopped: process = subprocess.Popen( - [steamcmd_path + "\steamcmd.exe"] + command.split(), + [steamcmd_path + "/steamcmd.exe"] + command.split(), stdout=None if self.settings_tab.console else subprocess.PIPE, stderr=None if self.settings_tab.console else subprocess.PIPE, text=True, @@ -954,7 +954,7 @@ class BOIIIWD(ctk.CTk): continue else: process = subprocess.Popen( - [steamcmd_path + "\steamcmd.exe"] + command.split(), + [steamcmd_path + "/steamcmd.exe"] + command.split(), stdout=None if self.settings_tab.console else subprocess.PIPE, stderr=None if self.settings_tab.console else subprocess.PIPE, text=True, diff --git a/boiiiwd_package/src/settings_tab.py b/boiiiwd_package/src/settings_tab.py index 019a357..6230cd1 100644 --- a/boiiiwd_package/src/settings_tab.py +++ b/boiiiwd_package/src/settings_tab.py @@ -581,7 +581,7 @@ class SettingsTab(ctk.CTkFrame): boiii_folder_entry.insert(0, selected_folder) def open_steam_browser(): - selected_folder = ctk.filedialog.askdirectory(title="Select Steam Folder (ex: C:\Program Files (x86)\Steam)") + selected_folder = ctk.filedialog.askdirectory(title="Select Steam Folder (ex: C:/Program Files (x86)/Steam)") if selected_folder: steam_folder_entry.delete(0, "end") steam_folder_entry.insert(0, selected_folder) @@ -600,7 +600,7 @@ class SettingsTab(ctk.CTkFrame): boiii_folder = boiii_folder_entry.get() if not os.path.exists(steam_folder) and not os.path.exists(ws_folder): - show_message("Not found", "Either you have no items downloaded from Steam or wrong path, please recheck path (ex: C:\Program Files (x86)\Steam)") + show_message("Not found", "Either you have no items downloaded from Steam or wrong path, please recheck path (ex: C:/Program Files (x86)/Steam)") return if not os.path.exists(boiii_folder): diff --git a/build.py b/build.py index 101f272..4325a82 100644 --- a/build.py +++ b/build.py @@ -1,3 +1,5 @@ +import os +import shutil import PyInstaller.__main__ from distutils.sysconfig import get_python_lib @@ -13,7 +15,6 @@ PyInstaller.__main__.run([ "--noconfirm", "--onefile", "--windowed", - "--ascii", "--icon", f"{ICON}", "--add-data", "boiiiwd_package/resources;resources", "--add-data", "boiiiwd_package/src;imports", @@ -23,7 +24,10 @@ PyInstaller.__main__.run([ "--add-data", "boiiiwd_package/src;settings_tab", "--add-data", "boiiiwd_package/src;update_window", "--add-data", "boiiiwd_package/src;main", - "--add-data", f"{site_packages_path}\customtkinter;customtkinter", - "--add-data", f"{site_packages_path}\CTkMessagebox;CTkMessagebox", - "--add-data", f"{site_packages_path}\CTkToolTip;CTkToolTip", + "--add-data", f"{site_packages_path}/customtkinter;customtkinter", + "--add-data", f"{site_packages_path}/CTkMessagebox;CTkMessagebox", + "--add-data", f"{site_packages_path}/CTkToolTip;CTkToolTip", ]) + +current_directory = os.path.dirname(__file__) +shutil.copy2(os.path.join(current_directory, "dist", "BOIIIWD.exe"), current_directory)