2019-04-03 10:57:23 -04:00
import urllib2
import zipfile
import subprocess
import sys
import os
def pip_install ( package ) :
subprocess . call ( [ sys . executable , " -m " , " pip " , " install " , package ] )
2020-08-01 22:15:07 -04:00
print " installing requests "
pip_install ( ' requests ' )
import requests
2019-04-03 10:57:23 -04:00
print " downloading pybass "
2020-08-01 22:15:07 -04:00
filedata = urllib2 . urlopen ( ' http://master.dl.sourceforge.net/project/pybass/pybass_055.zip ' )
2019-04-03 10:57:23 -04:00
datatowrite = filedata . read ( )
with open ( ' pybass_055.zip ' , ' wb ' ) as f :
f . write ( datatowrite )
f . close ( )
print " extracting pybass "
zip_ref = zipfile . ZipFile ( ' pybass_055.zip ' , ' r ' )
zip_ref . extractall ( )
zip_ref . close ( )
print " renaming pybass.py "
2020-08-01 22:24:37 -04:00
if os . path . exists ( " pybass/__init__.py " ) : os . remove ( ' pybass/__init__.py ' )
2019-04-03 10:57:23 -04:00
os . rename ( ' pybass/pybass.py ' , ' pybass/__init__.py ' )
print " downloading bass "
2020-08-02 13:03:19 -04:00
filedata = urllib2 . urlopen ( ' http://us.un4seen.com/files/bass24.zip ' )
2019-04-03 10:57:23 -04:00
datatowrite = filedata . read ( )
with open ( ' bass24.zip ' , ' wb ' ) as f :
f . write ( datatowrite )
f . close ( )
print " extracting bass "
zip_ref = zipfile . ZipFile ( ' bass24.zip ' , ' r ' )
zip_ref . extract ( ' bass.dll ' )
zip_ref . close ( )
2020-08-02 13:03:19 -04:00
print " downloading bassopus "
filedata = urllib2 . urlopen ( ' http://us.un4seen.com/files/bassopus24.zip ' )
datatowrite = filedata . read ( )
with open ( ' bassopus24.zip ' , ' wb ' ) as f :
f . write ( datatowrite )
f . close ( )
print " extracting bassopus "
zip_ref = zipfile . ZipFile ( ' bassopus24.zip ' , ' r ' )
zip_ref . extract ( ' bassopus.dll ' )
zip_ref . close ( )
print " installing apng "
pip_install ( " apng " )
try :
from PIL import Image
2020-08-08 02:59:36 -04:00
if Image . __version__ != " 5.3.0 " :
jm = raw_input ( " Pillow version 5.3.0 is recommended for compatibility with AO2XP; You have version %s \n Replace with version 5.3.0? (Y/N) > " % Image . __version__ ) . lower ( )
2020-08-02 13:03:19 -04:00
if jm == " y " :
2020-08-08 02:59:36 -04:00
print " installing Pillow 5.3.0 "
pip_install ( " Pillow==5.3.0 " )
2020-08-02 20:55:19 -04:00
else :
2020-08-08 02:59:36 -04:00
print " Pillow 5.3.0 already exists, skipping "
2020-08-02 13:03:19 -04:00
except ImportError :
2020-08-08 02:59:36 -04:00
print " installing Pillow 5.3.0 "
pip_install ( " Pillow==5.3.0 " )
2020-08-02 13:03:19 -04:00
2019-04-03 10:57:23 -04:00
print " downloading pyqt4 "
2020-08-01 22:15:07 -04:00
filedata = requests . get ( ' http://raw.githubusercontent.com/dhb52/python-lib/master/PyQt4-4.11.4-cp27-cp27m-win32.whl ' )
datatowrite = filedata . content
2019-04-03 10:57:23 -04:00
with open ( ' PyQt4-4.11.4-cp27-cp27m-win32.whl ' , ' wb ' ) as f :
f . write ( datatowrite )
f . close ( )
2020-08-01 22:15:07 -04:00
2019-04-03 10:57:23 -04:00
print " installing pyqt4 "
pip_install ( ' PyQt4-4.11.4-cp27-cp27m-win32.whl ' )
print " installing pyinstaller "
pip_install ( ' pyinstaller ' )
print " done "