This commit is contained in:
Mauricio 2021-01-17 21:13:11 -04:00
commit be4206d835
2 changed files with 12 additions and 3 deletions

View File

@ -1,13 +1,18 @@
import sys, thread, time, os
import sys, thread, time, os, platform
from os.path import exists
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
osname = platform.system()
bassdll = "bass.dll"
if osname != "Windows":
bassdll = "libbass.so"
debugmode = len(sys.argv) > 1 and sys.argv[1] == "debug"
if not debugmode:
fakebass = len(sys.argv) > 1 and sys.argv[1] == "bass"
if not exists("bass.dll") or fakebass:
QtGui.QMessageBox.critical(None, "Unable to launch game", "Couldn't find the file 'bass.dll' on the client folder.\nAO2XP needs this file in order to play sounds and music.\nThe file is included in the client's zip file, make sure it's in the same folder as AO2XP.exe")
if not exists(bassdll) or fakebass:
QtGui.QMessageBox.critical(None, "Unable to launch game", "Couldn't find the file %s on the client folder.\nAO2XP needs this file in order to play sounds and music.\nThe file is included in the client's zip file, make sure it's in the same folder as the AO2XP exe." % bassdll)
os._exit(-2)
class gamewindow(QtGui.QMainWindow):

View File

@ -70,6 +70,10 @@ zip_ref = zipfile.ZipFile(BASSOPUSZIP, 'r')
zip_ref.extract(BASSOPUSDLL)
zip_ref.close()
if platform.system() == "Darwin":
os.rename(BASSDLL, "libbass.so")
os.rename(BASSOPUSDLL, "libbassopus.so")
print "installing apng"
pip_install("apng")