Last active
July 24, 2026 18:27
-
-
Save joshuacurtiss/87e1c95541c6642e0dcfec7f7e94443f to your computer and use it in GitHub Desktop.
Install NW Scheduler on macOS using Wine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env zsh | |
| # | |
| # Installs NW Scheduler Desktop (https://nwscheduler.com) on macOS reliably, using Wine. | |
| # Be patient! This process can take several minutes before the NWS installer is launched. | |
| # | |
| # Requirements: | |
| # - Install Homebrew (https://brew.sh) | |
| # - It will make sure to install Wine, Winetricks, and XQuartz if they are not already installed | |
| # - It will require a downloaded copy of NWS installer in the directory | |
| # | |
| command -v brew >/dev/null 2>&1 || { echo >&2 "Homebrew is required. Aborting."; exit 1; } | |
| # Find NWS installer | |
| installer_path=$(find . -name "NWS-Desktop-Setup*" -type f -print -quit 2>/dev/null) | |
| [[ -z $installer_path ]] && echo "NWS installer not found. Aborting." && exit 1 | |
| # Install Wine, Winetricks, XQuartz, and Rosetta 2 if they are not already installed | |
| brew install wine-stable winetricks xquartz | |
| softwareupdate --install-rosetta --agree-to-license | |
| wine_path=$(find /Applications -name 'Wine*.app' -maxdepth 3 -type d -print -quit 2>/dev/null) | |
| [[ -z $wine_path ]] && echo "Wine installation not found. Aborting." && exit 1 | |
| xattr -d com.apple.quarantine "$wine_path" | |
| # Configure Wine environment | |
| export WINEPREFIX="$HOME/.wine-nws" | |
| wineserver -k | |
| wine wineboot -u | |
| winecfg /v | |
| # TODO: If multiple guids are found, this will break. | |
| guid=$(wine uninstaller --list 2>&1 | grep Mono | awk -F'|' '{print $1}') | |
| echo "Mono GUID: ${guid:-'Not found.'}" | |
| [[ -z $guid ]] && echo "No Mono installation found. Aborting." && exit 1 | |
| wine uninstaller --remove "$guid" | |
| wine reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release 2>/dev/null && echo 'Mono is still present! Aborting!' && exit 1 | |
| winetricks -q dotnet48 & | |
| WT_PID=$! | |
| echo "Waiting for .Net installation to finish..." | |
| while kill -0 $WT_PID 2>/dev/null; do | |
| sleep 5 | |
| date | |
| pkill -9 -i mscorsvw 2>/dev/null | |
| done | |
| wait $WT_PID | |
| ! wine reg query "HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full" /v Release 2>/dev/null && echo 'The .Net installation failed! Aborting!' && exit 1 | |
| winetricks -q d3dx9 d3dcompiler_47 gdiplus fontfix | |
| winetricks -q allfonts | |
| wine reg add "HKCU\Software\Microsoft\Avalon.Graphics" /v "DisableHWAcceleration" /t REG_DWORD /d 1 /f | |
| # Run the NWS installer | |
| wine "$installer_path" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment