Advertisement
Deukhoofd

Untitled

Mar 26th, 2021
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Error when any command fails. Prevents incomplete installs.
  4. set -e
  5.  
  6. write_red_bold () {
  7. printf "\\033[00;31m\\033[1m%s\\033[0m\\n" "$1"
  8. }
  9.  
  10. write_bold () {
  11. printf "\\033[1m%b\\033[0m\\n" "$1"
  12. }
  13.  
  14. print_step () {
  15. printf "\\n\\033[31m\\033[1m##### OVERALL INSTALLATION STEP %s #####\\033[0m\\n" "$1"
  16. }
  17.  
  18. write_bold "Unofficial Pokémon Insurgence Wine Installation Tool"
  19. write_bold "Based on the Unofficial Pkmn Uranium Installer https://github.com/microbug/pokemon-uranium-on-macos"
  20.  
  21. if [ -d "$HOME/pkmn_insurg" ]; then
  22. write_red_bold "Error: ~/pkmn_insurg already exists. If you have an incomplete installation, delete these files first using rm -rf \"$HOME/pkmn_insurg\"."
  23. write_red_bold "If you wish to update an older version to a newer version, use the update script".
  24. exit 1
  25. fi
  26.  
  27. print_step 1
  28. if [ -x "$(command -v brew)" ]; then
  29. write_bold "Homebrew is already installed! Good for you, Homebrew is awesome."
  30. else
  31. write_bold "Homebrew not installed, installing now"
  32. write_red_bold "Accept all prompts and provide your password when it's asked for. Note that no password will be shown while typing."
  33. /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
  34. brew analytics off
  35. fi
  36.  
  37. print_step 2
  38. write_bold "Updating Homebrew"
  39. brew update
  40.  
  41. print_step 3
  42. write_bold "Tapping homebrew/versions"
  43. brew tap homebrew/cask-versions
  44. brew tap gcenx/wine
  45.  
  46. print_step 4
  47. write_bold "Installing XQuartz"
  48. brew install --cask xquartz
  49.  
  50. print_step 5
  51. write_bold "Installing Wine Crossover"
  52. brew install --cask --no-quarantine wine-crossover
  53.  
  54. print_step 6
  55. write_bold "Installing Winetricks"
  56. brew install winetricks
  57.  
  58. print_step 7
  59. write_bold "Installing wget"
  60. brew install wget
  61.  
  62. print_step 8
  63. write_bold "Creating virtual Windows installation at ~/pkmn_insurg"
  64. write_red_bold "Remember to accept all prompts to install Mono and/or Gecko, you may be asked several times"
  65. write_bold "Lots of Wine logs (may look like nonsense) coming up..."
  66. export PATH=$PATH:"/Applications/Wine Stable.app/Contents/Resources/wine/bin/"
  67. mkdir ~/pkmn_insurg
  68. export WINEPREFIX=~/pkmn_insurg
  69. export WINEARCH=win32
  70. cd $WINEPREFIX || exit
  71. wineboot
  72. wineserver -w --debug=0 # Wait for process to finish before continuing
  73. winetricks -q directplay directmusic dsound d3dx9_43 ddr=opengl win10 devenum dmsynth quartz
  74. sleep 5 # Let Wine finish spewing logs
  75.  
  76. print_step 9
  77. write_bold "Adding game start script"
  78. wget -qcO "$HOME/pkmn_insurg/Run-Pokémon-Insurgence.command" "https://gitlab.com/levi506/installing-insurgnece/raw/master/assets/macOS/run.sh"
  79. chmod +x "$HOME/pkmn_insurg/Run-Pokémon-Insurgence.command"
  80. ln -sf "$HOME/pkmn_insurg/Run-Pokémon-Insurgence.command" "$HOME/Desktop/Run-Pokémon-Insurgence.command"
  81.  
  82. print_step 10
  83. write_bold "Clearing caches"
  84. rm -rf ~/.cache/wine ~/.cache/winetricks
  85. rm -rf $(brew --cache)
  86.  
  87. print_step 11
  88. write_bold "Installing Insurg"
  89. wget -c "https://p-insurgence.com/releases/1.2.7/Pokemon Insurgence 1.2.7 Core.zip"
  90. unzip "Pokemon Insurgence 1.2.7 Core.zip" -d "$HOME/pkmn_insurg/drive_c/Program Files (x86)/"
  91. mv -f "$HOME/pkmn_insurg/drive_c/Program Files (x86)/Pokemon Insurgence 1.2.7 Core" "$HOME/pkmn_insurg/drive_c/Program Files (x86)/Pokemon Insurgence"
  92. mv -f "Pokemon Insurgence 1.2.7 Core.zip" "$HOME/pkmn_insurg/drive_c/Program Files (x86)/"
  93. write_bold "Installing Insurgence. This might take some time while it's downloading the game. Please be patient."
  94. echo "1.2.7" > "$HOME/pkmn_insurg/version"
  95.  
  96. write_bold "Done!"
  97. write_red_bold "Wait for all Wine configuration to finish (wait for any remaining windows to close), then REBOOT and check the guide on the Pokemon Insurgence Forums for next steps"
  98.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement