mirror of
https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux.git
synced 2025-11-06 21:36:06 +01:00
Update autodesk_fusion_launcher.sh
This commit is contained in:
@@ -7,8 +7,8 @@
|
|||||||
# Author URI: https://cryinkfly.com #
|
# Author URI: https://cryinkfly.com #
|
||||||
# License: MIT #
|
# License: MIT #
|
||||||
# Copyright (c) 2020-2024 #
|
# Copyright (c) 2020-2024 #
|
||||||
# Time/Date: 22:50/31.07.2024 #
|
# Time/Date: xx:xx/xx.xx.2024 #
|
||||||
# Version: 1.9.3 #
|
# Version: 2.0.0 #
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
# Path: SELECTED__INSTALLATION_PATH/bin/autodesk_fusion_launcher.sh
|
# Path: SELECTED__INSTALLATION_PATH/bin/autodesk_fusion_launcher.sh
|
||||||
@@ -22,24 +22,23 @@
|
|||||||
###############################################################################################################################################################
|
###############################################################################################################################################################
|
||||||
|
|
||||||
# Check in which directory the autodesk_fusion_launcher.sh file is located.
|
# Check in which directory the autodesk_fusion_launcher.sh file is located.
|
||||||
echo "The current working directory is: $PWD"
|
WINEPREFIX_LOG_FILE=$HOME/.autodesk_fusion/logs/wineprefixes.log
|
||||||
launcher_root_path=$(cd .. && echo "$PWD")
|
AUTODESK_ROOT_DIRECTORY=$(awk 'NR == 2' "$WINEPREFIX_LOG_FILE")
|
||||||
wineprefix_log_file=$launcher_root_path/logs/wineprefixes.log
|
WINEPREFIX_DIRECTORY=$(awk 'NR == 3' "$WINEPREFIX_LOG_FILE")
|
||||||
wineprefix=$(cat "$wineprefix_log_file")
|
|
||||||
|
|
||||||
# This feature will check if there is a new version of Autodesk Fusion 360.
|
# This feature will check if there is a new version of Autodesk Fusion 360.
|
||||||
function check_autodesk_fusion_online_versions {
|
function check_autodesk_fusion_online_versions {
|
||||||
curl -o ../logs/version.txt -L https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/builds/stable-branch/bin/build-version.txt
|
curl -o $HOME/.autodesk_fusion/logs/version.txt -L https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/builds/stable-branch/bin/build-version.txt
|
||||||
online_build_version=$(awk 'NR == 1' ../logs/version.txt)
|
ONLINE_BUILD_VERSION=$(awk 'NR == 1' $AUTODESK_ROOT_DIRECTORY/logs/version.txt)
|
||||||
online_insider_build_version=$(awk 'NR == 2' ../logs/version.txt)
|
ONLINE_INSIDER_BUILD_VERSION=$(awk 'NR == 2' $AUTODESK_ROOT_DIRECTORY/logs/version.txt)
|
||||||
echo "Online Build-Version: $online_build_version"
|
echo "Online Build-Version: $ONLINE_BUILD_VERSION"
|
||||||
echo "Online Insider-Build-Version: $online_insider_build_version"
|
echo "Online Insider-Build-Version: $ONLINE_INSIDER_BUILD_VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_version_file {
|
function check_version_file {
|
||||||
# Find the newest version.txt file from the Autodesk Fusion 360 installation.
|
# Find the newest version.txt file from the Autodesk Fusion 360 installation.
|
||||||
autodesk_fusion_api_version=$(find "$wineprefix" -name fusion_version.txt -printf "%T+ %p\n" | sort -r 2>&1 | head -n 1 | sed -r 's/.+0000000000 (.+)/\1/')
|
AUTODESK_FUSION_API_VERSION=$(find "$WINEPREFIX_DIRECTORY" -name fusion_version.txt -printf "%T+ %p\n" | sort -r 2>&1 | head -n 1 | sed -r 's/.+0000000000 (.+)/\1/')
|
||||||
if [ -f "$autodesk_fusion_api_version" ]; then
|
if [ -f "$AUTODESK_FUSION_API_VERSION" ]; then
|
||||||
echo "The version.txt file exists!"
|
echo "The version.txt file exists!"
|
||||||
check_versions
|
check_versions
|
||||||
else
|
else
|
||||||
@@ -50,9 +49,9 @@ function check_version_file {
|
|||||||
|
|
||||||
function check_versions {
|
function check_versions {
|
||||||
# Get the string from the version.txt file from FUSION360_API_VERSION
|
# Get the string from the version.txt file from FUSION360_API_VERSION
|
||||||
system_build_version=$(cat "$autodesk_fusion_api_version")
|
SYSTEM_BUILD_VERSION=$(cat "$AUTODESK_FUSION_API_VERSION")
|
||||||
echo "System Build-Version: $system_build_version"
|
echo "System Build-Version: $SYSTEM_BUILD_VERSION"
|
||||||
if [ "$online_build_version" = "$system_build_version" ] || [ "$online_insider_build_version" = "$system_build_version" ]; then
|
if [ "$ONLINE_BUILD_VERSION" = "$SYSTEM_BUILD_VERSION" ] || [ "$ONLINE_INSIDER_BUILD_VERSION" = "$SYSTEM_BUILD_VERSION" ]; then
|
||||||
echo "Do nothing!"
|
echo "Do nothing!"
|
||||||
run_autodesk_fusion
|
run_autodesk_fusion
|
||||||
else
|
else
|
||||||
@@ -65,27 +64,26 @@ function backup_old_version {
|
|||||||
# Backup the old version of the Autodesk Fusion 360
|
# Backup the old version of the Autodesk Fusion 360
|
||||||
echo "Backup the old version of the Autodesk Fusion 360!"
|
echo "Backup the old version of the Autodesk Fusion 360!"
|
||||||
# Copy $wineprefix to $wineprefix-backup-$SYSTEM_BUILD_VERSION
|
# Copy $wineprefix to $wineprefix-backup-$SYSTEM_BUILD_VERSION
|
||||||
cp -r "$wineprefix" "$wineprefix-backup-$system_build_version"
|
cp -r "$WINEPREFIX_DIRECTORY" "$WINEPREFIX_DIRECTORY-backup-$SYSTEM_BUILD_VERSION"
|
||||||
}
|
}
|
||||||
|
|
||||||
function update {
|
function update {
|
||||||
echo "Update the Autodesk Fusion 360 version!"
|
echo "Update the Autodesk Fusion 360 version!"
|
||||||
# Download the newest version of the Autodesk Fusion 360
|
# Download the newest version of the Autodesk Fusion 360
|
||||||
fusion360_installer="$launcher_root_path/downloads/Fusion360installer.exe"
|
AUTODESK_FUSION_INSTALLER="$AUTODESK_ROOT_DIRECTORY/downloads/Fusion360ClientInstaller.exe"
|
||||||
fusion360_installer_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Client%20Downloader.exe"
|
fusion360_installer_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Client%20Downloader.exe"
|
||||||
curl -L "$fusion360_installer_url" -o Fusion360installer.exe
|
curl -L "$fusion360_installer_url" -o $AUTODESK_FUSION_INSTALLER
|
||||||
rm -rf "$fusion360_installer"
|
cp "$AUTODESK_ROOT_DIRECTORY/downloads/Fusion360ClientInstaller.exe" "$SELECTED_DIRECTORY/wineprefixes/default/drive_c/users/$USER/Downloads"
|
||||||
mv -f Fusion360installer.exe "$fusion360_installer"
|
|
||||||
cp "Fusion360installer.exe" "$wineprefix/drive_c/users/$USER/Downloads/Fusion360installer.exe"
|
|
||||||
# Install the newest version of the Autodesk Fusion 360
|
# Install the newest version of the Autodesk Fusion 360
|
||||||
WINEPREFIX="$wineprefix" timeout -k 2m 1m wine "$wineprefix/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
|
WINEPREFIX="$WINEPREFIX_DIRECTORY" timeout -k 2m 1m wine "$WINEPREFIX_DIRECTORY/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
|
||||||
WINEPREFIX="$wineprefix" timeout -k 2m 1m wine "$wineprefix/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
|
WINEPREFIX="$WINEPREFIX_DIRECTORY" timeout -k 2m 1m wine "$WINEPREFIX_DIRECTORY/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
|
||||||
run_autodesk_fusion
|
run_autodesk_fusion
|
||||||
}
|
}
|
||||||
|
|
||||||
# You must change the first part ($HOME/.wineprefixes/fusion360) and the last part (WINEPREFIX="$HOME/.wineprefixes/fusion360") when you have installed Autodesk Fusion 360 into another directory!
|
# You must change the first part ($HOME/.wineprefixes/fusion360) and the last part (WINEPREFIX="$HOME/.wineprefixes/fusion360") when you have installed Autodesk Fusion 360 into another directory!
|
||||||
function run_autodesk_fusion {
|
function run_autodesk_fusion {
|
||||||
launcher="$(find "$wineprefix" -name Fusion360.exe -printf "%T+ %p\n" | sort -r 2>&1 | head -n 1 | sed -r 's/.+0000000000 (.+)/\1/')" && echo $LAUNCHER && WINEPREFIX="$wineprefix" wine "$launcher"
|
LAUNCHER="$(find "$WINEPREFIX_DIRECTORY" -name Fusion360.exe -printf "%T+ %p\n" | sort -r 2>&1 | head -n 1 | sed -r 's/.+0000000000 (.+)/\1/')" && echo $LAUNCHER && WINEPREFIX="$WINEPREFIX_DIRECTORY" WINEDEBUG=-all WINEDEBUG=-d3d wine "$LAUNCHER" &&
|
||||||
|
exit;
|
||||||
# WINEDEBUG=-all = Logs everything, probably gives too much information in most cases, but may come in handy for subtle issues
|
# WINEDEBUG=-all = Logs everything, probably gives too much information in most cases, but may come in handy for subtle issues
|
||||||
# WINEDEBUG=-d3d = Will turn off all d3d messages, and additionally disable checking for GL errors after operations. This may improve performance.
|
# WINEDEBUG=-d3d = Will turn off all d3d messages, and additionally disable checking for GL errors after operations. This may improve performance.
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user