mirror of
https://github.com/rbreaves/kinto.git
synced 2025-08-01 08:46:40 +02:00
- Updated Uninstaller to silence some output
This commit is contained in:
32
setup.py
32
setup.py
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
import json, time, os, sys, subprocess, shlex
|
||||
import json, time, os, sys, subprocess, shlex, platform
|
||||
from shutil import copyfile
|
||||
from subprocess import PIPE, Popen
|
||||
from prekinto import *
|
||||
@@ -16,8 +16,9 @@ def windows_setup():
|
||||
print("")
|
||||
# Short DOS path notation
|
||||
path= cmdline('echo %cd%')[:-1]
|
||||
print("Copying autohotkey combinations for Terminals & Editors...")
|
||||
os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk")
|
||||
if default > 0 and default < 3:
|
||||
print("Copying autohotkey combinations for Terminals & Editors...")
|
||||
os.system("copy /Y " + path + "\\windows\\kinto.ahk " + path + "\\windows\\kinto-new.ahk")
|
||||
if default == 1:
|
||||
os.system('perl -pi -e "s/(; )(.*)(; MacModifiers)/$2$3/g" ./windows/kinto-new.ahk')
|
||||
# os.system("regedit " + path + "\\windows\\macbook_winctrl_swap.reg")
|
||||
@@ -25,12 +26,17 @@ def windows_setup():
|
||||
os.system('perl -pi -e "s/(; )(.*)(; WinModifiers)/$2$3/g" ./windows/kinto-new.ahk')
|
||||
# os.system("regedit " + path + "\\windows\\standard_ctrlalt_swap.reg")
|
||||
elif default == 3:
|
||||
os.system("regedit " + path + "\\windows\\remove_keyswap.reg")
|
||||
os.system("del /f .\\windows\\kinto-new.ahk")
|
||||
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
|
||||
os.system("taskkill /IM autohotkey.exe")
|
||||
os.system('rd /s /q %userprofile%\\.kinto')
|
||||
os.system('del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs"')
|
||||
print("Removing any old registry keys from prior versions...")
|
||||
p = subprocess.Popen(['powershell.exe', "Remove-ItemProperty -Path HKLM:'SYSTEM\CurrentControlSet\Control\Keyboard Layout' -Name 'Scancode Map' -ErrorAction SilentlyContinue"], stdout=sys.stdout)
|
||||
print("Removing Kinto from Startup folder...")
|
||||
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2>$null")
|
||||
os.system('(del "%userprofile%\\AppData\\Roaming\\Microsoft\\Windows\\STARTM~1\\Programs\\Startup\\kinto-start.vbs") 2>$null')
|
||||
print("Ending any running Kinto tasks...")
|
||||
os.system("(taskkill /IM autohotkey.exe) 2>$null")
|
||||
print("Removing Kinto from users profile directory...")
|
||||
os.system('(rd /s /q %userprofile%\\.kinto) 2>$null')
|
||||
print("")
|
||||
print("Uninstall of Kinto is Complete.")
|
||||
if default > 0 and default < 3:
|
||||
stvscode = yn_choice(bcolors.CYELLOW2 + "Would you like to use Sublime Text 3 keymaps in VS Code?\n" + bcolors.ENDC)
|
||||
print("Will now install chocolatey and autohotkey with elevated privileges...")
|
||||
@@ -56,7 +62,7 @@ def windows_setup():
|
||||
# # print("\nPlease log off and back on for changes to take full effect.")
|
||||
print("If using WSL then please remember to right click on title bar -> Properties -> Edit Options -> Use Ctrl+Shift+C/V as Copy/Paste and enable it.")
|
||||
else:
|
||||
os.system("del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\"")
|
||||
os.system("(del \"C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\kinto.ahk\") 2>$null")
|
||||
|
||||
def cmdline(command):
|
||||
process = Popen(
|
||||
@@ -67,7 +73,11 @@ def cmdline(command):
|
||||
)
|
||||
return process.communicate()[0]
|
||||
|
||||
# check_x11 = cmdline("env | grep -i x11").strip()
|
||||
if platform.system() == 'Windows':
|
||||
print("\nYou are detected as running Windows.")
|
||||
windows_setup()
|
||||
sys.exit()
|
||||
|
||||
check_x11 = cmdline("(env | grep -i x11 || loginctl show-session \"$XDG_SESSION_ID\" -p Type) | awk -F= '{print $2}'").strip()
|
||||
|
||||
if len(check_x11) == 0:
|
||||
|
Reference in New Issue
Block a user