Advertisement
j0h

crossover_IDEC.sh

j0h
May 12th, 2025 (edited)
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 3.62 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. : '
  4. This script installs a CrossOver bottle that contains the IDEC automation suite.
  5. It assumes CrossOver is installed and configures the environment accordingly.
  6. Use at your own risk.
  7. '
  8.  
  9. # Set the bottle name here
  10. BOTTLE_NAME="WindLDR"
  11.  
  12. # Exit if CrossOver is not installed
  13. if ! command -v cxrun &> /dev/null; then
  14.     echo "Error: CrossOver is not installed. Please install it first."
  15.     exit 1
  16. fi
  17.  
  18. echo "CrossOver is installed."
  19.  
  20. # Function to check if a package is installed
  21. is_installed() {
  22.     dpkg -l "$1" &> /dev/null
  23.     return $?
  24. }
  25.  
  26. # List of required packages
  27. packages=(
  28.     "ttf-mscorefonts-installer"
  29.     "winetricks"
  30.     "cups"
  31.     "cups-pdf"
  32.     "udev"
  33.     "libusb-dev"
  34.     "libusb-1.0-0-dev"
  35.     "linux-tools-virtual"
  36.     "hwdata"
  37. )
  38.  
  39. # Install required packages
  40. for package in "${packages[@]}"; do
  41.     if ! is_installed "$package"; then
  42.         echo "Installing $package..."
  43.         sudo apt-get install -y "$package"
  44.     else
  45.         echo "$package is already installed."
  46.     fi
  47. done
  48.  
  49. # Run winetricks with proper WINEPREFIX
  50. WINEPREFIX="$HOME/.cxoffice/$BOTTLE_NAME" winetricks allfonts corefonts
  51.  
  52. # Add user to plugdev if not already a member
  53. if ! groups $USER | grep -q "\bplugdev\b"; then
  54.     sudo usermod -aG plugdev $USER
  55.     echo "Added $USER to plugdev group."
  56. fi
  57.  
  58. # Create or update udev rules for USB access
  59. UDEV_RULE_FILE="/etc/udev/rules.d/99-usb.rules"
  60.  
  61. if [ ! -f "$UDEV_RULE_FILE" ]; then
  62.     echo 'SUBSYSTEM=="usb", MODE="0666"' | sudo tee "$UDEV_RULE_FILE"
  63.     echo "Created $UDEV_RULE_FILE with USB rule."
  64. else
  65.     echo "Udev rule file already exists. Appending USB rule."
  66.     echo 'SUBSYSTEM=="usb", MODE="0666"' | sudo tee -a "$UDEV_RULE_FILE"
  67. fi
  68.  
  69. # Reload udev rules
  70. sudo udevadm control --reload-rules
  71.  
  72. # Restore CrossOver archive
  73. echo "Restoring bottle from archive..."
  74. cxrestore --archive="$BOTTLE_NAME.cxarchive" --bottle="$BOTTLE_NAME"
  75.  
  76. # Link virtual printer output and USB COM port
  77. BOTTLE_PATH="$HOME/.cxoffice/$BOTTLE_NAME"
  78. ln -sf "/var/spool/cups-pdf/$USER" "$BOTTLE_PATH/dosdevices/c:"
  79. ln -sf "/dev/ttyACM0" "$BOTTLE_PATH/dosdevices/com1"
  80.  
  81. echo "CrossOver bottle installation and configuration completed."
  82. exit 0
  83.  
  84. : '
  85. OG process notes:
  86.  
  87. Installing WindLDR in wine, or crossover:
  88. before making your bottle, install cups, cups-pdf before making the WindLDR bottle
  89. make sure cups is running.
  90. else WindLDR isnt smart enough to find a virtual printer.
  91.  
  92. $ln-s /var/spool/cups-pdf/$USER ~/.cxoffice/[YOUR_BOTTLE]/dosdevices/c:
  93.  
  94. this takes care of the inability to print.
  95. WindLDR is the only component of the suite with this issue.
  96.  
  97.  
  98. sudo apt install ttf-mscorefonts-installer
  99. sudo apt install winetricks
  100. $ winetricks corefonts
  101. $ winetricks allfonts
  102.  
  103. how to use wintricks in crossover:
  104. Enviornmental Variable:
  105. WINEPREFIX=~/.cxoffice/YOUR_BOTTLE_NAME winetricks
  106.  
  107. This (should ) take care of various issues related to missing fonts.
  108. most notable: Veranda is the default, although we are using Western.
  109.  
  110. sudo apt install libusb-dev libusb-1.0-0-dev
  111. sudo apt install linux-tools-virtual hwdata
  112.  
  113. add user to plugdev if not previously there:
  114. $sudo usermod -aG plugdev $USER
  115.  
  116. Write a udev rule:
  117. /etc/udev/rules.d/99-usb.rules
  118. SUBSYSTEM=="usb", MODE="0666"
  119.  
  120. Save file, reload udev rules:
  121. $sudo udevadm control --reload-rules
  122.  
  123.  
  124. ## WHY 99-rules file? NN-device-rules, NN sets priority, 99 is a low priority.
  125.  
  126.  
  127.  
  128. link the device to com1 in wine or crossover:
  129. $ ln -s /dev/ttyACM0 ~/.cxoffice/[YOUR_BOTTLE]/dosdevices/com1
  130.  
  131.  
  132. previus error was like USB port not found:
  133. (IT basic instructions)
  134.  
  135. Current error:
  136. lol none fixed it.
  137. '
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement