Skip to content

Commit

Permalink
Fixed bugs in installer for linux versions and released 0.4.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hash3liZer committed Sep 18, 2021
1 parent 88194a5 commit f331d15
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 11 deletions.
31 changes: 21 additions & 10 deletions proxverter/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -26,7 +28,7 @@ def activate(self):
)
else:
cmline = subprocess.Popen(
self.chocoline,
self.aptline,
shell=True,
stdin=subprocess.PIPE,
stdout=fl,
Expand All @@ -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()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit f331d15

Please sign in to comment.