Created
May 2, 2025 15:31
-
-
Save Rich77498/3aaba477667ad35c3975051715e49405 to your computer and use it in GitHub Desktop.
bash script reset crossover on mac updated 2025
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 bash | |
| # Locate CrossOver.app | |
| CO_PWD=~/Applications/CrossOver.app/Contents/MacOS | |
| [ -d "${CO_PWD}" ] || CO_PWD=/Applications/CrossOver.app/Contents/MacOS | |
| if [ ! -d "${CO_PWD}" ]; then | |
| echo "CrossOver not found in default locations. Exiting..." | |
| exit 1 | |
| fi | |
| cd "${CO_PWD}" || exit | |
| # Kill existing CrossOver processes | |
| PROC_NAME='CrossOver' | |
| # Use pgrep to get PIDs | |
| pids=$(pgrep "${PROC_NAME}") | |
| if [ -n "${pids}" ]; then | |
| echo "Stopping CrossOver processes..." | |
| kill -9 ${pids} >/dev/null 2>&1 | |
| # Wait until processes terminate | |
| while pgrep -q "${PROC_NAME}"; do | |
| sleep 1 | |
| done | |
| fi | |
| # Reset trial dates to 3 hours ago (UTC) | |
| DATETIME=$(date -u -v-3H '+%Y-%m-%dT%TZ') | |
| plutil -replace FirstRunDate -date "${DATETIME}" ~/Library/Preferences/com.codeweavers.CrossOver.plist | |
| plutil -replace SULastCheckTime -date "${DATETIME}" ~/Library/Preferences/com.codeweavers.CrossOver.plist | |
| # Show notification | |
| osascript -e "display notification \"Trial reset: Date set to ${DATETIME}\"" | |
| # Remove evaluation files from all bottles | |
| find ~/Library/Application\ Support/CrossOver/Bottles -type f \( -name ".eval" -o -name ".update-timestamp" \) -delete | |
| # Launch CrossOver | |
| echo "Starting CrossOver..." | |
| "./CrossOver.origin" >> /tmp/co_log.log 2>&1 |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
use
to run without downloading