Lich:Software/Mac Installation: Difference between revisions

The official GemStone IV encyclopedia.
< Lich:Software
Jump to navigation Jump to search
mNo edit summary
 
(22 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{3rd-party}}
==Background==
To install Lich on newer versions of Mac OS, you will need a bit of familiarity with the Mac Terminal application. Some familiarity with Homebrew will help, although you should be able to follow the steps below without any prior knowledge of Homebrew.


This guide will attempt to install Lich for the Avalon Front End only. The entire process will take 60-90 minutes to complete, but the time required will depend on how many prerequisites you need to install and how many errors you encounter. If you get stuck, see any errors or run into any problems, or for information about other front ends, please contact Doug (doug@play.net or Doug#6198 on Discord) for help.
Mac OS X systems for all versions from Mavericks (10.9) to Mojave (10.14) have some of the elements you need to run [[Lich_(software)|Lich]] already installed. Some elements are missing, and will require you to install components on your system. While most software distributed for Mac OS X comes in the form of an automated install file, Lich is different. Lich will require that you install some components via a Terminal window command prompt. You will also start Lich from the Terminal window.


Please note that this guide will involve changing settings on your device for the technologies involved. You will need to decide whether it’s safe for you to customize these tools to work with Lich. If you have no idea what any of these technologies are, then you probably aren’t using them for any other purpose, but proceed at your own risk.
==Note for versions prior to Mavericks (10.9)==


Installation instructions for Mac OS X versions prior to 10.9 is more complicated. The best option is to update your OS X version to current.


==Steps to Install==
==Before You Start==


You will need to install a few things.
To run this script, download the [http://bit.ly/GSMLich installer] and then:


# Install the [https://www.play.net/gs4/play/avalon-info.asp Avalon Front End] from the play.net site.
1) Open up your Terminal window (you can use Spotlight to search for Terminal, then open the application)
# Install [https://brew.sh Homebrew] by following the instructions at the Homebrew site. You will be asked to supply your sudo password at least once, and perhaps a couple of times through this process.
2) In your terminal window enter the following commands:
# The Hombrew setup will also install Apple's Command Line Tools. You will be asked to accept the Apple license.
cd
chmod 744 ./Downloads/osxlich.sh
./Downloads/osxlich.sh
3) The output in Terminal will tell you when you're done.


When you are finished with these steps and Hombrew has installed, in the Terminal application you should run this command <code>brew doctor</code>
There are six steps to getting Lich up and running on your new Mac. The installer will take care of the first five.


Your system should respond with <code>Ready to brew</code>. If you get any other result, please seek assistance.
1) Installing the [[Avalon]] client.
2) Installing the xQuartz windowing system.
3) Installing the software compiling tools from Apple.
4) Installing the core software Ruby will use to support gems required for Lich.
5) Installing the Ruby gems used by Lich.
6) Testing the game and finalizing the installation.




==The Process==
Depending on the capabilities of your Mac and your network, you should anticipate that this installation process will take between 15 minutes and 45 minutes for most Macbook Pros and MacPros.


There are three general steps to installing all the packages and software needed to run Lich on Mac.


* First we will install various packages through Homebrew. This will include installing a different version of Ruby. Apple's version of Ruby does not work well with Lich.


* Second, we will install the gems in the new Ruby that we installed.
==Running Lich for the First Time==


* Finally, we will download and unzip the current Lich software so that we can run Lich.
For most first time lich users, starting up is easy. In terminal, run the following command:


To get started, enter these commands in Terminal, one at a time, and press ENTER. Allow the system to complete the command before moving on to the next one.
ruby lich/lich.rbw


# <code>brew install gtk+3</code>
Log in with your account and password, and then select the character you want to play, and select Avalon as your FE.
# <code>brew install rbenv</code>
# <code>brew install adwaita-icon-theme</code>


Now we need to set up your SHELL environment to take advantage of these packages.
In order to start the game with Lich (for Frostbite and other FE users), from Terminal we'll have to run the following command:


Enter the following command to check your shell: <p><code>echo $SHELL</code></p>
sudo ruby lich/lich.rbw --gemstone --<name of the FE you are using>


* If the Terminal displays <code>/bin/bash</code>, run the following commands: <p><code>echo 'eval "$(rbenv init -)"' >> ~/.bash_profile</code></p><p><code>echo 'if [ -z $DISPLAY ]; then export DISPLAY=:0.0; fi' >> ~/.bash_profile</code></p><p><code>source ~/.bash_profile</code></p>
* If the Terminal displays <code>/bin/zsh</code>, run the following commands: <p><code>echo 'eval "$(rbenv init -)"' >> ~/.zshrc</code></p><p><code>echo 'if [ -z $DISPLAY ]; then export DISPLAY=:0.0; fi' >> ~/.zshrc</code></p><p><code>source ~/.zshrc</code></p>


This completes the installation of the core packages you will need. Now we'll use rbenv to install the new Ruby. You're welcome to select a Ruby version if you are comfortable with any particular one. Note: Ruby 3.0 and higher does not support Lich presently. The most tested Ruby version is 2.7.7.
'''Quick pro tip:''' The next time you want to play, just open up Terminal and hit your 'up arrow' one time. You should see the ruby line above in your Terminal window. You can just press enter, fire up Lich and enjoy again!


Before we begin, let's check to be sure rbenv is working properly. Enter this command in Terminal and press ENTER.


* <code>rbenv versions</code>
Enjoy!


This should return one line that looks like <code>* system</code>. If you see that line, you can proceed. If not, seek assistance. If you are proceeding, then enter these commands in Terminal, one at a time, and press ENTER. Allow the system to complete the command before moving on to the next one.
==A Few (More) Quick Pro Tips==


# <code>rbenv install 3.2.3</code>
If you've read this far, you're going to benefit!
# <code>rbenv global 3.2.3</code>
# <code>ruby -v</code>


If everything worked, the last line will return the version of Ruby that is currently active. It should look something like this:
'''caffeinate -di [command]'''
<code>ruby 3.2.3 (2024-01-16 revision 5124f9ac75) [arm64-darwin22]</code>


If you did not receive that line, or if you received a line like this:
Sometimes your Mac will want to go to sleep, and will disrupt your processes - even sometimes causing the dread 'SEGFAULT' that reboots your Mac with cryptic information that no one really can use (despite claims to the contrary). If you use the 'caffeinate' command in Terminal, your Mac will not sleep ( [d]isplay or computer [i]dle ) until the command completes. Suggested usage might be 'caffeinate -di ./osxinstall.sh' as one (very pertinent) example.
<code>ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22]</code>
seek assistance (restarting the terminal you used to run commands up to this point may be required for `ruby -v` to show the proper, updated version of ruby).


The key is the ruby 3.2.3 part -> it needs to read 3.2.3
'''Install Wine'''


'''3.2.3 is expected'''. If your version reflects 3.2.3, proceed to the next steps. Enter these commands, one at a time, and press ENTER. Wait for the system to finish before moving on to the next.
Took the plunge from a Windows PC to Mac OS X, but not quite ready to give up on your Stormfront or Wizard (my personal fav) yet? Great news! You don't have to. While Avalon is a tried and tested Mac front end, let's face it - the PC crowd presently has the better collection of front ends. So, how do you make this magic all happen? Just follow these instructions (wine installs are as long or longer than the core OS X Lich installs, so make sure you have time!) And now might just be a good time to test 'caffeinate' on that first command - it takes a while and might abort if the machine tries to sleep.


# <code>gem install sqlite3 gtk3 curses sequel terminal-table ascii_charts concurrent-ruby tomlib --no-document</code>
{|{{prettytable}}
|'''Command''' || '''Explanation'''
|-
|'''Open Terminal''' || Yes, we love this application to do heavy work!
|-
|'''cd''' || Always a good idea anytime you're not sure exactly where you are (which folder) on your Mac
|-
|'''caffeinate -di HOMEBREW_NO_AUTO_UPDATE=1 brew install wine winetricks''' || This will take a bit of time to complete, so we'll pour in some caffeine.
|-
|'''curl -OL http://www.play.net/software/lnchInst.exe''' || Don't just click the link, copy (or type) the entire command.
|-
|'''wine lnchInst.exe''' || You might see a few errors / warnings, but it'll work as of 8/2016
|-
|'''ruby ./lich/lich.rbw''' || Log in as normal and select the windows FE of your choice -- remember, I recommend Wizard.
|}


Now run a quick test to see if things work:
''Troubleshooting - you may get this strange error message: "concat': no implicit conversion of Errno::EACCES into String (TypeError)" . If you've used Avalon and Lich previously (in particular, using 'sudo ruby' as the instructions say), then we have one step we need to take to remove this error. Don't worry, it is an expected outcome of using sudo with lich, and can be fixed with one line.''


* Run the following command to start the Ruby shell (you will see the command prompt change): <p><code>irb</code></p>
{|{{prettytable}}
# Run this command to test if the first gem is working: <p><code>require 'sqlite3'</code></p><p>The system should respond <code>true</code></p>
|'''Command''' || '''Explanation'''
# Run this command to test if the second gem is working: <p><code>require 'gtk3'</code></p><p>This should also respond <code>true</code> in the Terminal. It might take a second or two.</p>
|-
# Now, run this command to return to your regular shell prompt: <p><code>exit</code></p>
|'''cd''' || Absolutely ensure we're in the right directory
|-
|'''sudo chown -R $(whoami):staff ./lich''' || change ownership of all content in the lich directory to your username
|-
|'''ruby ./lich/lich.rbw''' || continue on with the login
|}


If all of these activities show the right results, the hard part is behind you. Now we simply need to get the Lich files:
At this point, you'll see the Lich login window - just type in your account information, select your character, and then '''look at the two radio buttons'''. One of them is Wizard, and the other Stormfront. Select your preference, and click PLAY. Your front end will be downloaded and you'll be guided to install (please just select the default locations - wine knows what it's doing).
# Download the [https://github.com/elanthia-online/lich-5/releases/latest Lich5] files. (Windows/Mac all run the same files).
# Unzip it the file in your Downloads folder. This will create a folder called Lich5. Drag the Lich5 folder (not the zip file, the folder) to your Desktop.


'''That's it!''' You will start / access Lich and the game from the Terminal window.
''Caution - sometimes wine takes a bit of time 'searching' for a previous installation of a file, especially the Wizard. No panic, let the process complete. Then you may not connect, especially the Wizard, the first time. No worries - wait it out and close up Terminal, then start Terminal again, and re-enter the command. You'll get in the second time.''


# Run the following command in the Terminal: <p><code>ruby ~/Desktop/Lich5/lich.rbw</code></p>
''Note: Stormfront is a very nice looking front end, but it has a memory leak in it. This situation is really exacerbated on a Mac / wine installation. You'll notice the front end start to get sluggish. When it does - simply move someplace safe, log out, and log back in. Voilà!''
# After a couple seconds, you should see the Lich login window.
# Enter your login information, and click CONNECT.
# Select your character, select the Avalon Front End, and click PLAY.
# The game will start! You will see some new Lich-related text in the scroll, including a repository error (normal).


Lich5 will then automatically start downloading the map database and associated image files for the game. After that's complete, you're ready to play. Good luck and have fun!
'''Use those config files!'''


==Lich for Other Front Ends==
If you've been playing for a while, you'll have a couple of challenges to overcome - migrating any non-lich scripts you may have, and migrating your existing highlights, macros and other settings. The process is slightly different for each front end, but in general:


No guides are available at this time, please email doug@play.net for help.
Wine installs all Windows programs under the user directory at the following path:

~/.wine/drive_c/Program\ Files

So our Simutronics front ends are stored at

~/.wine/drive_c/Program\ Files/SIMU/STORM

~/.wine/drive_c/Program\ Files/SIMU/WIZARD

To move your existing Stormfront configuration, take these steps:

1) Check to see if your scripts and such are saved on the server. If they are - confirm they're available to you
2) If they're not, on your old system with Stormfront - click on the Options button, then select SETTINGS and EXPORT
3) This will create an XML file. Copy this file over to your Mac (desktop is fine if you wish)
4) Start the game on your Mac with Lich and Stormfront, and then on that system, click Options > SETTINGS and IMPORT
5) Confirm your settings / highlights / scripts are available to you.

To move over your existing Wizard configuration (it's a bit harder), take these steps:

1) On your old system, copy the directory under Wizard called Gemstone
2) On your new Mac you'll need to use Terminal to put them in the right place
3) On your new Mac, you need to have the Wizard front end (via wine) already installed
4) Put the Gemstone folder on your desktop
5) In Terminal, type in
cd
cp -R ./Desktop/Gemstone ./.wine/drive_c/Program\ Files/SIMU/WIZARD/
6) Log into the game and see if your files made the transfer


'''Don't forget, Terminal remembers your command history'''

Just like in the game front ends, if you want to repeat a command that you've already typed in, you can simply hit the UP ARROW on your keyboard, and scroll backwards to find the command. If you go too far, DOWN ARROW will scroll you forwards. Admittedly, this is most advantageous when you're getting ready to play, and you hit UP ARROW to get your 'ruby ./lich/lich.rbw' command back.

From time to time, contributors may make changes / modifications to these tips (and the article in general), so bookmark this page, and check it periodically to see what's new and exciting!

'''If you're lazy, like a good Unix admin, use AUTOCOMPLETE in your Terminal window'''

Your Terminal window in Mac OS X will allow you to zip through long filenames and directory paths, if you use the TAB key (autocomplete). For example, in the Wizard instructions above, you can simply type in the following (and hit the TAB key where the field has [T]ab

5) cp -R ./Desk[T]ab/Gem[T]ab ./.wine/driv[T]ab/Prog[T]ab/SIMU/WIZ[T]ab

Autocomplete makes things much easier, and much less error prone! This will work if the file or directory already exists. If you hit TAB and it doesn't autocomplete, the capitalization is off - Unix is case sensitive!


==Resources==
==Resources==
* [http://bit.ly/GSLichDiag OS X Lich Diagnostics] 3rd party, not supported by Simutronics
* [http://bit.ly/GSLichInstall OS X Lich Installation Script] 3rd party, not supported by Simutronics
* [[Lich scripting reference]]
* [[Lich scripting reference]]
* Tillmen's Lich Update (v4.6.33): https://lichproject.org/
* Playershops by Lich: https://ps.lichproject.org/
* Playershops by Lich: https://ps.lichproject.org/
* Unofficial Support for Lich: http://forum.gsplayers.com/forumdisplay.php?f=104
* Unofficial Support for Lich: http://forum.gsplayers.com/forumdisplay.php?f=104
Line 154: Line 100:


{{Third-Party Software}}
{{Third-Party Software}}
[[Category:Third-Party Software]]

Latest revision as of 22:54, 18 January 2024

Lich:Software/Mac Installation is a third party script and is not maintained by Simutronics. Simutronics is not responsible for the accuracy of the information presented on this page, nor is it liable for issues stemming from the use of the application on players' personal devices.

To install Lich on newer versions of Mac OS, you will need a bit of familiarity with the Mac Terminal application. Some familiarity with Homebrew will help, although you should be able to follow the steps below without any prior knowledge of Homebrew.

This guide will attempt to install Lich for the Avalon Front End only. The entire process will take 60-90 minutes to complete, but the time required will depend on how many prerequisites you need to install and how many errors you encounter. If you get stuck, see any errors or run into any problems, or for information about other front ends, please contact Doug (doug@play.net or Doug#6198 on Discord) for help.

Please note that this guide will involve changing settings on your device for the technologies involved. You will need to decide whether it’s safe for you to customize these tools to work with Lich. If you have no idea what any of these technologies are, then you probably aren’t using them for any other purpose, but proceed at your own risk.


Before You Start

You will need to install a few things.

  1. Install the Avalon Front End from the play.net site.
  2. Install Homebrew by following the instructions at the Homebrew site. You will be asked to supply your sudo password at least once, and perhaps a couple of times through this process.
  3. The Hombrew setup will also install Apple's Command Line Tools. You will be asked to accept the Apple license.

When you are finished with these steps and Hombrew has installed, in the Terminal application you should run this command brew doctor

Your system should respond with Ready to brew. If you get any other result, please seek assistance.


The Process

There are three general steps to installing all the packages and software needed to run Lich on Mac.

  • First we will install various packages through Homebrew. This will include installing a different version of Ruby. Apple's version of Ruby does not work well with Lich.
  • Second, we will install the gems in the new Ruby that we installed.
  • Finally, we will download and unzip the current Lich software so that we can run Lich.

To get started, enter these commands in Terminal, one at a time, and press ENTER. Allow the system to complete the command before moving on to the next one.

  1. brew install gtk+3
  2. brew install rbenv
  3. brew install adwaita-icon-theme

Now we need to set up your SHELL environment to take advantage of these packages.

Enter the following command to check your shell:

echo $SHELL

  • If the Terminal displays /bin/bash, run the following commands:

    echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

    echo 'if [ -z $DISPLAY ]; then export DISPLAY=:0.0; fi' >> ~/.bash_profile

    source ~/.bash_profile

  • If the Terminal displays /bin/zsh, run the following commands:

    echo 'eval "$(rbenv init -)"' >> ~/.zshrc

    echo 'if [ -z $DISPLAY ]; then export DISPLAY=:0.0; fi' >> ~/.zshrc

    source ~/.zshrc

This completes the installation of the core packages you will need. Now we'll use rbenv to install the new Ruby. You're welcome to select a Ruby version if you are comfortable with any particular one. Note: Ruby 3.0 and higher does not support Lich presently. The most tested Ruby version is 2.7.7.

Before we begin, let's check to be sure rbenv is working properly. Enter this command in Terminal and press ENTER.

  • rbenv versions

This should return one line that looks like * system. If you see that line, you can proceed. If not, seek assistance. If you are proceeding, then enter these commands in Terminal, one at a time, and press ENTER. Allow the system to complete the command before moving on to the next one.

  1. rbenv install 3.2.3
  2. rbenv global 3.2.3
  3. ruby -v

If everything worked, the last line will return the version of Ruby that is currently active. It should look something like this: ruby 3.2.3 (2024-01-16 revision 5124f9ac75) [arm64-darwin22]

If you did not receive that line, or if you received a line like this: ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.arm64e-darwin22] seek assistance (restarting the terminal you used to run commands up to this point may be required for `ruby -v` to show the proper, updated version of ruby).

The key is the ruby 3.2.3 part -> it needs to read 3.2.3

3.2.3 is expected. If your version reflects 3.2.3, proceed to the next steps. Enter these commands, one at a time, and press ENTER. Wait for the system to finish before moving on to the next.

  1. gem install sqlite3 gtk3 curses sequel terminal-table ascii_charts concurrent-ruby tomlib --no-document

Now run a quick test to see if things work:

  • Run the following command to start the Ruby shell (you will see the command prompt change):

    irb

  1. Run this command to test if the first gem is working:

    require 'sqlite3'

    The system should respond true

  2. Run this command to test if the second gem is working:

    require 'gtk3'

    This should also respond true in the Terminal. It might take a second or two.

  3. Now, run this command to return to your regular shell prompt:

    exit

If all of these activities show the right results, the hard part is behind you. Now we simply need to get the Lich files:

  1. Download the Lich5 files. (Windows/Mac all run the same files).
  2. Unzip it the file in your Downloads folder. This will create a folder called Lich5. Drag the Lich5 folder (not the zip file, the folder) to your Desktop.

That's it! You will start / access Lich and the game from the Terminal window.

  1. Run the following command in the Terminal:

    ruby ~/Desktop/Lich5/lich.rbw

  2. After a couple seconds, you should see the Lich login window.
  3. Enter your login information, and click CONNECT.
  4. Select your character, select the Avalon Front End, and click PLAY.
  5. The game will start! You will see some new Lich-related text in the scroll, including a repository error (normal).

Lich5 will then automatically start downloading the map database and associated image files for the game. After that's complete, you're ready to play. Good luck and have fun!

Lich for Other Front Ends

No guides are available at this time, please email doug@play.net for help.

Resources

Third-Party Software - edit
Lich Installation: Lich
Downloadable Lich Scripts: Go2 | Map | Repository | Popular Scripts