2012-12-31 22:11:37 +00:00
#!/usr/bin/env python
#
# Python installer
#
import subprocess
import sys
import os
2013-01-01 15:32:48 +00:00
import platform
2012-12-31 22:11:37 +00:00
# if nix then run installer
2013-01-01 15:32:48 +00:00
if platform . system ( ) == " Linux " :
2012-12-31 22:11:37 +00:00
# give installer a null value
installer = " "
try :
# if our command option is true then install stuff
if sys . argv [ 1 ] == " install " :
installer = True
# if index is out of range then flag options
except IndexError :
2013-01-01 15:32:48 +00:00
print " ** SET Dependancy Installer v0.2 ** "
2013-03-16 19:47:25 +00:00
print " \n To install: setup.py install "
2012-12-31 22:11:37 +00:00
# if user specified install then lets to the installation
if installer == True :
# if we trigger on sources.list then we know its ubuntu
if os . path . isfile ( " /etc/apt/sources.list " ) :
2013-03-16 19:47:25 +00:00
# force install of debian packages
2013-01-01 15:32:48 +00:00
subprocess . Popen ( " apt-get --force-yes -y install build-essential python-pexpect python-beautifulsoup python-pefile python-crypto python-openssl python-pymssql " , shell = True ) . wait ( )
2012-12-31 22:11:37 +00:00
# if sources.list is not available then we're running something offset
else :
print " [*] Your not running a Debian variant. Installer not finished for this type of Linux distro. "
print " [*] Install subversion, python-pexpect, python-beautifulsoup, python-crypto, python-openssl, python-pefile manually for all of SET dependancies. "
sys . exit ( )
2013-01-01 15:32:48 +00:00
if platform . system ( ) == ' Darwin ' :
2013-03-16 19:47:25 +00:00
subprocess . Popen ( " easy_install pexpect beautifulsoup pycrypto pyopenssl pefile pymssql beautifulsoup " , shell = True ) . wait ( )
print " [!] Note that you will need to install XCODE for OSX and run ' sudo easy_install cython pymssql ' to finish. "
2013-01-01 15:32:48 +00:00
if platform . system != " Linux " :
2013-03-16 19:47:25 +00:00
if platform . system != " Darwin " :
print " [!] Sorry this installer is not designed for any other system other than Linux and Mac. Please install the python depends manually. "