diff --git a/proxverter/installer.py b/proxverter/installer.py index 42822ec..93b07cf 100755 --- a/proxverter/installer.py +++ b/proxverter/installer.py @@ -7,6 +7,8 @@ class Installer: def __init__(self, output=os.devnull): self.chocoline = 'powershell.exe "Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString(\'https://community.chocolatey.org/install.ps1\'))' self.chocolime = 'powershell.exe "choco install {} -y"' + self.aptline = 'apt update' + self.aptlime = 'apt install {}' self.platform = platform.system().lower() if self.platform == "windows": self.startupinfo = subprocess.STARTUPINFO() @@ -26,7 +28,7 @@ def activate(self): ) else: cmline = subprocess.Popen( - self.chocoline, + self.aptline, shell=True, stdin=subprocess.PIPE, stdout=fl, @@ -36,20 +38,29 @@ def activate(self): fl.close() if cmline.returncode: - raise ImportError(f"Unable to install choco installer. Return code: {cmline}") + raise ImportError(f"Unable to activate environment installer. Return code: {cmline}") return cmline.returncode == 0 def install(self, pkg): fl = open(self.output, 'a') - cmline = subprocess.Popen( - self.chocolime.format(pkg), - shell=True, - stdin=subprocess.PIPE, - stdout=fl, - stderr=fl, - startupinfo=self.startupinfo - ) + if hasattr(self, 'startupinfo'): + cmline = subprocess.Popen( + self.chocolime.format(pkg), + shell=True, + stdin=subprocess.PIPE, + stdout=fl, + stderr=fl, + startupinfo=self.startupinfo + ) + else: + cmline = subprocess.Popen( + self.aptlime.format(pkg), + shell=True, + stdin=subprocess.PIPE, + stdout=fl, + stderr=fl + ) cmline.communicate() fl.close() diff --git a/setup.py b/setup.py index 4c379a3..d0219b2 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="proxverter", - version="0.4.7", + version="0.4.8", author="hash3liZer", author_email="admin@shellvoide.com", description="Cross platform system wide proxy server & TLS Interception library for Python",