Skip to content

Commit

Permalink
Update windows installer
Browse files Browse the repository at this point in the history
  • Loading branch information
malisipi committed Aug 19, 2024
1 parent dd7030a commit 6e214f4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
3 changes: 2 additions & 1 deletion windows-setup/build_setup.cmd
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
python -m PyInstaller setup.py --noconsole --onefile -i ../assets/newflow.ico
:: pip install PyInstaller
python -m PyInstaller setup.py --noconsole --windowed --onefile -i ../assets/newflow.ico
19 changes: 14 additions & 5 deletions windows-setup/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
setup_version = "0.0.2";
setup_version = "0.0.3";

import urllib.request;
from zipfile import ZipFile;
Expand All @@ -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");
Expand Down Expand Up @@ -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);
Expand All @@ -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();

0 comments on commit 6e214f4

Please sign in to comment.