diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ff632..865fcfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Automatically create symlinks for mounts (#110, thanks @xela1) +- Enable Wine Virtual Desktop mode by default ### Changed - Updated known-good Backblaze version to 9.0.1.763 diff --git a/Dockerfile.ubuntu18 b/Dockerfile.ubuntu18 index 334e528..1b68db8 100644 --- a/Dockerfile.ubuntu18 +++ b/Dockerfile.ubuntu18 @@ -28,6 +28,7 @@ ENV LANG en_US.UTF-8 ENV APP_NAME="Backblaze Personal Backup" ENV FORCE_LATEST_UPDATE="false" ENV DISABLE_AUTOUPDATE="false" +ENV DISABLE_VIRTUAL_DESKTOP="false" # Disable WINE Debug messages ENV WINEDEBUG -all diff --git a/Dockerfile.ubuntu20 b/Dockerfile.ubuntu20 index def79c5..9f17146 100644 --- a/Dockerfile.ubuntu20 +++ b/Dockerfile.ubuntu20 @@ -28,6 +28,7 @@ ENV LANG en_US.UTF-8 ENV APP_NAME="Backblaze Personal Backup" ENV FORCE_LATEST_UPDATE="false" ENV DISABLE_AUTOUPDATE="false" +ENV DISABLE_VIRTUAL_DESKTOP="false" # Disable WINE Debug messages ENV WINEDEBUG -all diff --git a/Dockerfile.ubuntu22 b/Dockerfile.ubuntu22 index cb31222..5254f97 100644 --- a/Dockerfile.ubuntu22 +++ b/Dockerfile.ubuntu22 @@ -28,6 +28,7 @@ ENV LANG en_US.UTF-8 ENV APP_NAME="Backblaze Personal Backup" ENV FORCE_LATEST_UPDATE="false" ENV DISABLE_AUTOUPDATE="false" +ENV DISABLE_VIRTUAL_DESKTOP="false" # Disable WINE Debug messages ENV WINEDEBUG -all diff --git a/README.md b/README.md index f601fb3..5d972e5 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ Environment variables can be set by adding one or more arguments `-e "==> "$log_file" +} + +# Pre-initialize Wine +if [ ! -f "${WINEPREFIX}system.reg" ]; then + echo "WINE: Wine not initialized, initializing" + wineboot -i + log_message "WINE: Initialization done" +fi + +#Configure Extra Mounts +for x in {d..z} +do + if test -d "/drive_${x}" && ! test -d "${WINEPREFIX}dosdevices/${x}:"; then + log_message "DRIVE: drive_${x} found but not mounted, mounting..." + ln -s "/drive_${x}/" "${WINEPREFIX}dosdevices/${x}:" + fi +done + +# Set Virtual Desktop +cd $WINEPREFIX +if [ "$DISABLE_VIRTUAL_DESKTOP" = "true" ]; then + log_message "WINE: DISABLE_VIRTUAL_DESKTOP=true - Virtual Desktop mode will be disabled" + winetricks vd=off +else + # Check if width and height are defined + if [ -n "$DISPLAY_WIDTH" ] && [ -n "$DISPLAY_HEIGHT" ]; then + log_message "WINE: Enabling Virtual Desktop mode with $DISPLAY_WIDTH:$DISPLAY_WIDTH aspect ratio" + winetricks vd="$DISPLAY_WIDTH"x"$DISPLAY_HEIGHT" + else + # Default aspect ratio + log_message "WINE: Enabling Virtual Desktop mode with recommended aspect ratio" + winetricks vd="900x700" + fi +fi # Disclaimer -disclaimer_updatemode() { # Check if auto-updates are disabled - if [ "$DISABLE_AUTOUPDATE" = "true" ]; then - echo "Auto-updates are disabled. Backblaze won't be updated." +if [ "$DISABLE_AUTOUPDATE" = "true" ]; then + echo "Auto-updates are disabled. Backblaze won't be updated." +else + # Check the status of FORCE_LATEST_UPDATE + if [ "$FORCE_LATEST_UPDATE" = "true" ]; then + echo "FORCE_LATEST_UPDATE is enabled which may brick your installation." else - # Check the status of FORCE_LATEST_UPDATE - if [ "$FORCE_LATEST_UPDATE" = "true" ]; then - echo "FORCE_LATEST_UPDATE is enabled which may brick your installation." - else - echo "FORCE_LATEST_UPDATE is disabled. Using known-good version of Backblaze." - fi + echo "FORCE_LATEST_UPDATE is disabled. Using known-good version of Backblaze." fi -} - -disclaimer_updatemode +fi -log_message() { - echo "$(date): $1" >> "$log_file" -} # Function to handle errors handle_error() { echo "Error: $1" >> "$log_file" @@ -62,24 +92,6 @@ start_app() { sleep infinity } -# Pre-initialize Wine -if [ ! -f "${WINEPREFIX}system.reg" ]; then - echo "WINE: Wine not initialized, initializing" - wineboot -i - log_message "WINE: Initialization done" -fi - -#Configure Extra Mounts - -for x in {d..z} -do - if test -d "/drive_${x}" && ! test -d "${WINEPREFIX}dosdevices/${x}:"; then - log_message "DRIVE: drive_${x} found but not mounted, mounting..." - ln -s "/drive_${x}/" "${WINEPREFIX}dosdevices/${x}:" - fi -done - - if [ -f "${WINEPREFIX}drive_c/Program Files (x86)/Backblaze/bzbui.exe" ]; then check_url_validity() { url="$1"