Skip to content

Commit

Permalink
v0.6 EOL
Browse files Browse the repository at this point in the history
I will only make a windows compiled executable for this release.
+ Added the ability to set a custom java location per instance.
  • Loading branch information
calmilamsy committed Sep 5, 2019
1 parent 8fc9288 commit ab8aae9
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 33 deletions.
18 changes: 1 addition & 17 deletions compile_unix.sh
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
echo Change the 4th line in this batch file to your python install.

# CHANGE THIS TO WHAT YOUR PYTHON 3.6+ INSTALL IS (e.g.: C:\Program Files\python\scripts\python.exe
export pythonver=python3

echo Is \"$pythonver\" the correct python 3.6+ directory?
echo CTRL+C if incorrect.

read -p "Press enter to continue..."

echo Creating venv.
$pythonver -m venv venv

echo Activating venv.
chmod a+x venv/bin/activate
source venv/bin/activate

echo Adding dependencies.
pip install pyqt5 requests appdirs pyinstaller pypresence mitmproxy

echo Using pyinstaller.
pyinstaller -y -F -i "favicon.ico" --add-data "background.png":"." --add-data "logo.png":"." --add-data "favicon.ico":"." --add-data "blogbackground.png":"." --add-data "blog.html":"." --add-data "refresh.png":"." --add-data "venv/lib/python3.7/site-packages/mitmproxy/addons/onboardingapp":"mitmproxy/addons/onboardingapp" --add-data "EasyMineLauncher.jar":"." pymcl.py
echo Complete!
echo Done!
read -p "Press enter to continue..."
14 changes: 2 additions & 12 deletions compile_win.bat
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
@echo OFF

echo Change the 4th line in this batch file to your python install.
@rem CHANGE THIS TO WHAT YOUR PYTHON 3.6+ INSTALL IS (e.g.: C:\Program Files\python\scripts\python.exe
set pythonver=python

echo Is "%pythonver%" the correct python 3.6+ directory?
echo Close the window if incorrect.
PAUSE

virtualenv venv

echo Activating venv. && venv\scripts\activate && echo Adding dependencies. && pip install pyqt5 requests appdirs pypresence mitmproxy pyinstaller && echo Using pyinstaller. && pyinstaller -y -F -i "favicon.ico" --add-data "background.png";"." --add-data "logo.png";"." --add-data "favicon.ico";"." --add-data "blogbackground.png";"." --add-data "blog.html";"." --add-data "refresh.png";"." --add-data "venv\Lib\site-packages\mitmproxy\addons\onboardingapp";"mitmproxy\addons\onboardingapp" --add-data "EasyMineLauncher.jar";"." pymcl.py
echo Complete!
echo Activating venv. && venv\scripts\activate && echo Using pyinstaller. && pyinstaller -y -F -i "favicon.ico" --add-data "background.png";"." --add-data "logo.png";"." --add-data "favicon.ico";"." --add-data "blogbackground.png";"." --add-data "blog.html";"." --add-data "refresh.png";"." --add-data "venv\Lib\site-packages\mitmproxy\addons\onboardingapp";"mitmproxy\addons\onboardingapp" --add-data "EasyMineLauncher.jar";"." pymcl.py
echo Done!
PAUSE
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@
}
}

VER = "v0.6 Alpha Pre 4.2"
VER = "v0.6 EOL"

PRINT_INFO = True
PRINT_WARN = True
Expand Down
35 changes: 32 additions & 3 deletions mainlauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,14 @@ def launch(self):
elif not self.loginBox.text().isalnum():
raise TypeError("Username not alphanumeric!")

self.launchArgs = ["java"]
self.launchArgs = []
if self.instanceConfig["javaloc"] != "":
self.launchArgs.append(self.instanceConfig["javaloc"])
else:
self.launchArgs.append("java")
for arg in self.instanceConfig["javaargs"].split(" -"):
if not len(arg) < 3:
self.launchArgs.append("-" + arg)

if self.instanceConfig["proxyskin"] or self.instanceConfig["proxysound"] or self.instanceConfig["proxycape"]:
self.proxy = utils.minecraftProxy(doSkinFix=self.instanceConfig["proxyskin"], doSoundFix=self.instanceConfig["proxysound"], doCapeFix=self.instanceConfig["proxycape"], loop=asyncio.new_event_loop())
self.proxy.start()
Expand Down Expand Up @@ -347,7 +350,7 @@ def launch(self):
self.launchArgs = []
except Exception as e:
# Tragic.
self.error("Minecraft is unable to start. Make sure you have java and minecraft installed and an alphanumeric username set.\nCheck your launch args if you have set any too.")
self.error("Minecraft is unable to start. Make sure you have java and minecraft installed and an alphanumeric username set.\nCheck your launch args and java location if you have set any too.")
utils.logger.info("Rejected username: " + self.loginBox.text())
utils.logger.info(e)

Expand Down Expand Up @@ -508,6 +511,23 @@ def createConfigTab(self):
self.enableAutoProxyCape.setChecked(mainWin.instanceConfig["proxycape"])
self.enableAutoProxyCape.move(150, 137)

self.javaLoc = QLineEdit(self.configTab, text=mainWin.instanceConfig["javaargs"])
self.javaLoc.resize(310, 24)
self.javaLoc.move(150, 160)

try:
mainWin.instanceConfig["javaloc"]
except:
mainWin.instanceConfig["javaloc"] = ""
self.javaLoc = QLineEdit(self.configTab, text=mainWin.instanceConfig["javaloc"])
self.javaLoc.resize(310, 24)
self.javaLoc.move(150, 160)

self.getJavDirButton = QPushButton("...", self.configTab)
self.getJavDirButton.resize(24, 22)
self.getJavDirButton.move(465, 160)
self.getJavDirButton.clicked.connect(self.getJavDir)

# Labelz
self.javaArgsLabel = QLabel(self.configTab, text="Java arguments:")
self.javaArgsLabel.resize(100, 20)
Expand Down Expand Up @@ -549,11 +569,20 @@ def createConfigTab(self):
self.enableAutoProxyCapeLabel2.resize(250, 20)
self.enableAutoProxyCapeLabel2.move(170, 132)

self.javaArgsLabel = QLabel(self.configTab, text="Java location:")
self.javaArgsLabel.resize(100, 20)
self.javaArgsLabel.move(20, 160)

def getDir(self):
fileName, _ = QFileDialog.getOpenFileName(self, "Select a Mod ZIP File", os.path.expanduser("~"), "Mod Archive (*.zip;*.jar)")
if fileName:
self.modZipDir.setText(fileName)

def getJavDir(self):
fileName, _ = QFileDialog.getOpenFileName(self, "Select a JRE", os.path.expanduser("~"), "JRE (*)")
if fileName:
self.javaLoc.setText(fileName)


# Fires when options window is closed.
def closeEvent(self, event, *args, **kwargs):
Expand Down
22 changes: 22 additions & 0 deletions setup_unix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
echo Change the 4th line in this batch file to your python install.

# CHANGE THIS TO WHAT YOUR PYTHON 3.6+ INSTALL IS (e.g.: C:\Program Files\python\scripts\python.exe
export pythonver=python3

echo Is \"$pythonver\" the correct python 3.6+ directory?
echo CTRL+C if incorrect.

read -p "Press enter to continue..."

echo Creating venv.
$pythonver -m venv venv

echo Activating venv.
chmod a+x venv/bin/activate
source venv/bin/activate

echo Adding dependencies.
pip install pyqt5 requests appdirs pyinstaller pypresence mitmproxy

echo Done!
read -p "Press enter to continue..."
16 changes: 16 additions & 0 deletions setup_win.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo OFF

echo Change the 5th line in this batch file to your python install.
@rem CHANGE THIS TO WHAT YOUR PYTHON 3.6+ INSTALL IS (e.g.: C:\Program Files\python\scripts\python.exe
set pythonver=python

echo Is "%pythonver%" the correct python 3.6+ directory?
echo Close the window if incorrect.
PAUSE

virtualenv venv

echo Activating venv. && venv\scripts\activate && echo Adding dependencies. && pip install pyqt5 requests appdirs pypresence mitmproxy pyinstaller

echo Done!
PAUSE

0 comments on commit ab8aae9

Please sign in to comment.