Skip to content

Instantly share code, notes, and snippets.

@hexxt-git
Created March 12, 2026 07:04
Show Gist options
  • Select an option

  • Save hexxt-git/af4692796417022beb447bd62a11f68a to your computer and use it in GitHub Desktop.

Select an option

Save hexxt-git/af4692796417022beb447bd62a11f68a to your computer and use it in GitHub Desktop.
A script that resets the CrossOver trial period on macOS, allowing you to continue using it beyond the 14-day window.
#!/bin/bash
# --- Paths ---
PLIST_DOMAIN="com.codeweavers.CrossOver"
PLIST_PATH="$HOME/Library/Preferences/com.codeweavers.CrossOver.plist"
BOTTLES_DIR="$HOME/Library/Application Support/CrossOver/bottles"
echo "--- CrossOver Maintenance Started ---"
# 1. Safely stop CrossOver
if pgrep -x "CrossOver" > /dev/null; then
echo "Closing CrossOver..."
killall "CrossOver"
else
echo "CrossOver is already closed."
fi
# 2. Reset the 14-day trial timestamp in the plist
if [ -f "$PLIST_PATH" ]; then
YESTERDAY=$(date -v-1d +"%Y-%m-%d %H:%M:%S +0000")
defaults write "$PLIST_DOMAIN" FirstRunDate -date "$YESTERDAY"
echo "✅ Trial date reset to: $YESTERDAY"
else
echo "⚠️ Global plist not found. Skipping trial date reset."
fi
# 3. Clean the expired registry block with feedback
if [ -d "$BOTTLES_DIR" ]; then
find "$BOTTLES_DIR" -name "system.reg" | while read -r reg_file; do
bottle_name=$(basename "$(dirname "$reg_file")")
# Check if the pattern exists before trying to replace it
if grep -qi "\[Software\\\\CodeWeavers\\\\CrossOver\\\\cxoffice\]" "$reg_file"; then
# Perform the multi-line deletion
perl -i -0777 -pe 's/^\[Software\\+CodeWeavers\\+CrossOver\\+cxoffice\].*?(\n\n|(?=\n\[)|$)/ /gmi' "$reg_file"
echo "✅ Cleaned expiration block from bottle: $bottle_name"
else
echo "ℹ️ Bottle \"$bottle_name\" is already clean."
fi
done
else
echo "⚠️ Bottles directory not found. Skipping registry cleaning."
fi
echo "--- Maintenance Complete ---"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment