macos support
This commit is contained in:
@@ -3,27 +3,22 @@ $winget = Get-Command winget -ErrorAction SilentlyContinue
|
|||||||
|
|
||||||
if (!$winget) {
|
if (!$winget) {
|
||||||
Write-Host "Error: winget is not installed." -Foreground Red
|
Write-Host "Error: winget is not installed." -Foreground Red
|
||||||
Write-Host "This script probably will not work without winget." -Foreground Red
|
Write-Host "This script will not work without winget." -Foreground Red
|
||||||
Write-Host "Run 'Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe' and then search for 'App Installer' on the Microsoft Store to install winget." -Foreground Red
|
Write-Host "Please install winget - trying to open Microsoft Store" -Foreground Yellow
|
||||||
Write-Host "If you do install winget, this script should handle the rest." -Foreground Red
|
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
|
||||||
|
Start-Process "ms-windows-store://pdp/?ProductId=9NBLGGH4NNS1"
|
||||||
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check that java is installed
|
# Check that java is installed
|
||||||
if (-not (Get-Command "C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin\java" -ErrorAction SilentlyContinue)) {
|
if (-not (Get-Command "C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot\bin\java" -ErrorAction SilentlyContinue)) {
|
||||||
Write-Host "Error: java is not installed." -Foreground Red
|
Write-Host "Error: java is not installed." -Foreground Red
|
||||||
|
|
||||||
if ($winget) {
|
Write-Host "Attempting to install java."
|
||||||
Write-Host "Attempting to install java."
|
winget install AdoptOpenJDK.OpenJDK.11
|
||||||
winget install AdoptOpenJDK.OpenJDK.11
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
Write-Host "Please install java to continue." -Foreground Red
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Test-Path ".venv") { } else { python -m venv .venv }
|
if (-not (Test-Path ".venv")) { python -m venv .venv }
|
||||||
|
|
||||||
. .\.venv\Scripts\Activate.ps1
|
. .\.venv\Scripts\Activate.ps1
|
||||||
|
|
||||||
|
|||||||
@@ -16,8 +16,9 @@ MULTIMC_DIR = ""
|
|||||||
INSTANCE_DIR = ""
|
INSTANCE_DIR = ""
|
||||||
|
|
||||||
if OS == "darwin":
|
if OS == "darwin":
|
||||||
cprint("no support for macos yet", "red")
|
MULTIMC_PARENT_DIR = "/Applications/MultiMC.app"
|
||||||
exit(1)
|
MULTIMC_DIR = f"{MULTIMC_PARENT_DIR}/Data"
|
||||||
|
INSTANCE_DIR = f"{MULTIMC_DIR}/instances/FishPogPixelmon"
|
||||||
|
|
||||||
if OS == "linux":
|
if OS == "linux":
|
||||||
MULTIMC_PARENT_DIR = f"{os.getenv('HOME')}/.local/share"
|
MULTIMC_PARENT_DIR = f"{os.getenv('HOME')}/.local/share"
|
||||||
@@ -51,6 +52,9 @@ def run_mmc():
|
|||||||
if OS == "linux":
|
if OS == "linux":
|
||||||
subprocess.Popen(["./MultiMC"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
subprocess.Popen(["./MultiMC"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
if OS == "darwin":
|
||||||
|
subprocess.Popen(["open", "-a", "MultiMC"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
|
||||||
# mods
|
# mods
|
||||||
def mods():
|
def mods():
|
||||||
|
|||||||
@@ -12,10 +12,19 @@ if ! [ -x "$(command -v java)" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# check that multimc is installed
|
# check if is macos or linux
|
||||||
if ! [ -x "$(command -v multimc)" ]; then
|
if [[ "$OSTYPE" == "linux"* ]]; then
|
||||||
echo 'Error: multimc is not installed. Please install it to continue.' >&2
|
# check that multimc is installed
|
||||||
exit 1
|
if ! [ -x "$(command -v multimc)" ]; then
|
||||||
|
echo 'Error: multimc is not installed. Please install it to continue.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||||
|
# check that MultiMC.app is in /Applications
|
||||||
|
if ! [ -d "/Applications/MultiMC.app" ]; then
|
||||||
|
echo 'Error: MultiMC.app is not installed. Please install it to continue.' >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! [ -d .venv ]; then python -m venv .venv; fi
|
if ! [ -d .venv ]; then python -m venv .venv; fi
|
||||||
|
|||||||
Reference in New Issue
Block a user