diff --git a/windows-setup/build_setup.cmd b/windows-setup/build_setup.cmd index 4675231..d3f3bf3 100755 --- a/windows-setup/build_setup.cmd +++ b/windows-setup/build_setup.cmd @@ -1 +1,2 @@ -python -m PyInstaller setup.py --noconsole --onefile -i ../assets/newflow.ico \ No newline at end of file +:: pip install PyInstaller +python -m PyInstaller setup.py --noconsole --windowed --onefile -i ../assets/newflow.ico \ No newline at end of file diff --git a/windows-setup/setup.py b/windows-setup/setup.py index 467c6c7..5625980 100755 --- a/windows-setup/setup.py +++ b/windows-setup/setup.py @@ -1,4 +1,4 @@ -setup_version = "0.0.2"; +setup_version = "0.0.3"; import urllib.request; from zipfile import ZipFile; @@ -12,11 +12,11 @@ import tkinter; from tkinter import ttk; -temp_dir = tempfile.gettempdir(); +temp_dir = tempfile.gettempdir()+"\\"; newflow_download = "https://github.com/malisipi/NewFlow/archive/refs/heads/main.zip"; -electron_download = "https://github.com/electron/electron/releases/download/v28.2.2/electron-v28.2.2-win32-x64.zip"; +electron_download = "https://github.com/electron/electron/releases/download/v31.4.0/electron-v31.4.0-win32-x64.zip"; ytextratorjs_download = "https://github.com/malisipi/yt-extractor.js/archive/refs/heads/main.zip"; -electron_ver = "v28.2.2"; +electron_ver = "v31.4.0"; def read_license(): webbrowser.open("https://www.apache.org/licenses/LICENSE-2.0.txt"); @@ -87,11 +87,18 @@ def newflow_install(): update_state("Finished!"); show_progress(1,1,1); +def clear_cache(): + if(os.path.exists(temp_dir + "electron" + electron_ver + ".zip")): + os.remove(temp_dir + "electron" + electron_ver + ".zip"); + if(os.path.exists(temp_dir + "newflow.zip")): + os.remove(temp_dir + "newflow.zip"); + if(os.path.exists(temp_dir + "ytextractor.zip")): + os.remove(temp_dir + "ytextractor.zip"); + setup_window = tkinter.Tk(); setup_window.title("NewFlow - Setup " + setup_version); setup_window.resizable(False, False); setup_window.geometry('400x200'); -setup_window.iconbitmap(sys.executable); state_text = tkinter.Label(setup_window, text="Setup is ready!", justify="center"); state_text.place(x=60, y=40, width=280, height=25); @@ -103,5 +110,7 @@ def newflow_install(): website_button.place(x=20, y=155, width=100, height=25); license_button = ttk.Button(setup_window, text='Read License', command=read_license); license_button.place(x=280, y=155, width=100, height=25); +clear_cache_button = ttk.Button(setup_window, text='Clear Cache', command=clear_cache); +clear_cache_button.place(x=150, y=155, width=100, height=25); setup_window.mainloop();