Skip to content

Instantly share code, notes, and snippets.

@mihaiconstantin
Last active March 29, 2022 04:44
Show Gist options
  • Save mihaiconstantin/680355d1392db04aa70cc94e0b3b7aa4 to your computer and use it in GitHub Desktop.
Save mihaiconstantin/680355d1392db04aa70cc94e0b3b7aa4 to your computer and use it in GitHub Desktop.
Installing and running Windows applications on M1 Macs

Goal

Install and run the Windows version of LatentGOLD 6.0 on a Mac device (Intel or Apple Silicon).

Steps

1. Install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Make sure to read the installation logs on how to add the brew binary to the path, e.g.,

echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/$USER/.zprofile

Note. If the installation prompts you to install the Command Line Developer Tools run xcode-select --install and try to reinstall homebrew again.

2. Install wine

Note.

  • The wine-stable available via homebrew will not work because this version of wine is not yet fully compatible with Apple Silicon devices. We use instead a custom version of wine by folks from Code Weavers. This version is called wine-crossover and is what is being used in the CrossOver software (i.e., https://www.codeweavers.com/crossover).

  • the homebrew formula for installing wine-crossover is available on Github at https://github.com/Gcenx/homebrew-wine.

brew install --cask --no-quarantine gcenx/wine/wine-crossover

From the repository README.md:

This will install Wine Crossover into /Applications and function as the official brew cask would. The --no-quarantine flag is required so brew skips the quarantine flag that causes Gatekeeper to believe Wine Crossover is broken.

Check that the installation succeeded: wine --version. And we can see the installation location via which wine (i.e., /opt/homebrew/bin/wine).

3. Download LatentGOLD 6.0

4. Install LatentGOLD 6.0

  • wine creates configuration environments that simulate a Windows installation. The default environment is located at ~/.wine. This can be modified by running winecfg. If you have multiple environments, you can tell wine which environment to target via the WINEPREFIX variable.
WINEPREFIX=~/.wine-new-environment winecfg
  • Install LatentGOLD 6.0 in the default wine environment.
wine /Users/mihai/Downloads/LG60setup.exe
  • On Windows, it is installed by default at C:\Program Files\LatentGOLD6.0 and can be started via the lg60.exe binary.

5. Start LatentGOLD 6.0

  • If you navigate to ~/.wine/drive_c you will notice that it follows the file structure of a typical Windows installation.
├── Program Files
│   └── ...
├── Program Files (x86)
│   └── ...
├── ProgramData
│   └── Microsoft
├── users
│   ├── Public
│   └── crossover
│       ├── ...
│       ├── Desktop -> /Users/mihai/Desktop
│       ├── Downloads -> /Users/mihai/Downloads
│       ├── My Documents -> /Users/mihai/Documents
│       ├── ...
└── windows
  • We can tell wine where to find the installed binary lg60.exe i.e., at ~/.wine/drive_c/Program\ Files/LatentGOLD6.0/lg60.exe.
wine ~/.wine/drive_c/Program\ Files/LatentGOLD6.0/lg60.exe
  • Another way, is to tell wine to open an equivalent of the Windows Explorer and navigate to the installation location via the interface.
wine explorer.exe

6. Create alias

  • We can add an alias to the command above to start LatentGOLD 6.0 more easily. To do that, we need to figure out what shell we use by running:
echo $SHELL

If the output is /bin/zsh then we need to edit the file ~/.zshrc. Else if the output is /bin/bash then we need to edit the file ~/.bash_profile.

  • Depending on which shell you use, run the following to add an alias lgold that when used will invoke the wine command with the full path to the LatentGOLD 6.0 binary:

For /bin/zsh:

echo "alias lgold='wine ~/.wine/drive_c/Program\ Files/LatentGOLD6.0/lg60.exe'" >> ~/.zshrc

For /bin/bash

echo "alias lgold='wine ~/.wine/drive_c/Program\ Files/LatentGOLD6.0/lg60.exe'" >> ~/.bash_profile
  • Quit and reopen the terminal or source the shell configuration file to load the changes (i.e., source ~/.zshrc or source ~/.bash_profile) and start the application by running lgold.

7. Create shortcut

  • We can also use the Shortcuts app to create a shortcut we can run from the Menu Bar.

  • We create a shortcut that runs the following command in the Terminal app:

/opt/homebrew/bin/wine ~/.wine/drive_c/Program\ Files/LatentGOLD6.0/lg60.exe

8. Uninstalling

  • Remove wine:
brew uninstall --cask wine-crossover
  • Remove the .wine environment:
rm -rf ~/.wine
  • Remove the alias from ~/.zshrc or ~/.bash_profile.
  • Delete the shortcut in Shortcuts app.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment