Update autodesk_fusion_installer.sh

This commit is contained in:
Steve Zabka
2024-08-04 12:56:36 +02:00
committed by GitHub
parent ee952daa3a
commit 1a1af63185

View File

@@ -11,25 +11,40 @@
# Version: 2.0.0 # # Version: 2.0.0 #
#################################################################################################### ####################################################################################################
########################################################################################
function deactivate_window_not_responding_dialog() { ###############################################################################################################################################################
# Check if desktop environment is GNOME # THE INITIALIZATION OF DEPENDENCIES STARTS HERE: #
if [ "$XDG_CURRENT_DESKTOP" = "GNOME" ]; then ###############################################################################################################################################################
# Disable the "Window not responding" Dialog in GNOME for 30 minutes:
gsettings set org.gnome.mutter check-alive-timeout 1800000
fi
}
function reset_window_not_responding_dialog() { # Get the current used Linux distribution and version without lsb_release
# Check if desktop environment is GNOME distribution=$(grep "^ID=" /etc/*-release | cut -d'=' -f2 | tr -d '"')
if [ "$XDG_CURRENT_DESKTOP" = "GNOME" ]; then version=$(grep "^VERSION_ID=" /etc/*-release | cut -d'=' -f2 | tr -d '"')
# Reset the "Window not responding" Dialog in GNOME echo "Linux distribution: $distribution"
gsettings reset org.gnome.mutter check-alive-timeout echo "Linux version: $version"
fi
}
######################################################################################## # Get the values of the passed arguments and assign them to variables
echo "$1"
echo "$2"
echo "$3"
selected_option="$1"
selected_directory="$2"
selected_extensions="$3"
echo "Selected option: $selected_option"
echo "Selected directory: $selected_directory"
echo "Selected extensions: $selected_extensions"
# URL to download winetricks
winetricks_url="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
# URL to download Fusion360Installer.exe files
#fusion360_installer_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20360%20Admin%20Install.exe" <-- Old Link!!!
fusion360_installer_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Admin%20Install.exe"
fusion360_installer_client_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Client%20Downloader.exe"
# URL to download Microsoft Edge WebView2.Exec
webview2_installer_url="https://github.com/aedancullen/webview2-evergreen-standalone-installer-archive/releases/download/109.0.1518.78/MicrosoftEdgeWebView2RuntimeInstallerX64.exe"
###############################################################################################################################################################
# Write a function to check which option is selected for example: f360-installer.sh $1 = "abort" $2 # Write a function to check which option is selected for example: f360-installer.sh $1 = "abort" $2
function check_option() { function check_option() {
@@ -73,7 +88,25 @@ function check_option() {
esac esac
} }
######################################################################################## ###############################################################################################################################################################
function deactivate_window_not_responding_dialog() {
# Check if desktop environment is GNOME
if [ "$XDG_CURRENT_DESKTOP" = "GNOME" ]; then
# Disable the "Window not responding" Dialog in GNOME for 30 minutes:
gsettings set org.gnome.mutter check-alive-timeout 1800000
fi
}
function reset_window_not_responding_dialog() {
# Check if desktop environment is GNOME
if [ "$XDG_CURRENT_DESKTOP" = "GNOME" ]; then
# Reset the "Window not responding" Dialog in GNOME
gsettings reset org.gnome.mutter check-alive-timeout
fi
}
###############################################################################################################################################################
function create_data_structure() { function create_data_structure() {
mkdir -p "$selected_directory/bin" \ mkdir -p "$selected_directory/bin" \
@@ -87,7 +120,7 @@ function create_data_structure() {
"$selected_directory/wineprefixes/default" "$selected_directory/wineprefixes/default"
# Download the newest winetricks version: # Download the newest winetricks version:
curl -o "$selected_directory/bin/winetricks" https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks curl -o "$selected_directory/bin/winetricks" "$winetricks_url"
chmod +x "$selected_directory/bin/winetricks" chmod +x "$selected_directory/bin/winetricks"
# Search for an existing installer of Autodesk Fusion 360 # Search for an existing installer of Autodesk Fusion 360
@@ -95,16 +128,12 @@ function create_data_structure() {
if [ -f "$fusion360_installer" ]; then if [ -f "$fusion360_installer" ]; then
echo "The Autodesk Fusion 360 installer exists!" echo "The Autodesk Fusion 360 installer exists!"
if find "$fusion360_installer" -mtime +7 | grep -q .; then if find "$fusion360_installer" -mtime +7 | grep -q .; then
fusion360_installer_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Admin%20Install.exe"
curl -L "$fusion360_installer_url" -o Fusion360installer.exe
rm -rf "$fusion360_installer" rm -rf "$fusion360_installer"
mv -f Fusion360installer.exe "$fusion360_installer" curl -L "$fusion360_installer_url" -o "$fusion360_installer"
fi fi
else else
echo "The Autodesk Fusion 360 installer doesn't exist and will be downloaded for you!" echo "The Autodesk Fusion 360 installer doesn't exist and will be downloaded for you!"
fusion360_installer_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Admin%20Install.exe"
curl -L "$fusion360_installer_url" -o "$fusion360_installer" curl -L "$fusion360_installer_url" -o "$fusion360_installer"
mv -f Fusion360installer.exe "$fusion360_installer"
fi fi
# Search for an existing installer of Autodesk Fusion 360 (Client) # Search for an existing installer of Autodesk Fusion 360 (Client)
@@ -112,16 +141,12 @@ function create_data_structure() {
if [ -f "$fusion360_installer_client" ]; then if [ -f "$fusion360_installer_client" ]; then
echo "The Autodesk Fusion 360 installer exists!" echo "The Autodesk Fusion 360 installer exists!"
if find "$fusion360_installer_client" -mtime +7 | grep -q .; then if find "$fusion360_installer_client" -mtime +7 | grep -q .; then
fusion360_installer_client_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Client%20Downloader.exe"
curl -L "$fusion360_installer_client_url" -o Fusion360Clientinstaller.exe
rm -rf "$fusion360_installer_client" rm -rf "$fusion360_installer_client"
mv -f Fusion360Clientinstaller.exe "$fusion360_installer_client" curl -L "$fusion360_installer_client_url" -o "$fusion360_installer_client"
fi fi
else else
echo "The Autodesk Fusion 360 installer doesn't exist and will be downloaded for you!" echo "The Autodesk Fusion 360 installer doesn't exist and will be downloaded for you!"
fusion360_installer_client_url="https://dl.appstreaming.autodesk.com/production/installers/Fusion%20Client%20Downloader.exe" curl -L "$fusion360_installer_client_url" -o "$fusion360_installer_client"
curl -L "$fusion360_installer_client_url" -o "$fusion360_installer"
mv -f Fusion360Clientinstaller.exe "$fusion360_installer_client"
fi fi
# Search for an existing installer of WEBVIEW2 # Search for an existing installer of WEBVIEW2
@@ -129,39 +154,33 @@ function create_data_structure() {
if [ -f "$webview2_installer" ]; then if [ -f "$webview2_installer" ]; then
echo "The WebView2installer installer exists!" echo "The WebView2installer installer exists!"
if find "$webview2_installer" -mtime +7 | grep -q .; then if find "$webview2_installer" -mtime +7 | grep -q .; then
webview2_installer_url="https://github.com/aedancullen/webview2-evergreen-standalone-installer-archive/releases/download/109.0.1518.78/MicrosoftEdgeWebView2RuntimeInstallerX64.exe"
curl -L "$webview2_installer_url" -o WebView2installer.exe
mv -f WebView2installer.exe "$webview2_installer"
rm -rf "$webview2_installer" rm -rf "$webview2_installer"
curl -L "$webview2_installer_url" -o "$webview2_installer"
fi fi
else else
echo "The WebView2installer installer doesn't exist and will be downloaded for you!" echo "The WebView2installer installer doesn't exist and will be downloaded for you!"
webview2_installer_url="https://github.com/aedancullen/webview2-evergreen-standalone-installer-archive/releases/download/109.0.1518.78/MicrosoftEdgeWebView2RuntimeInstallerX64.exe"
curl -L "$webview2_installer_url" -o "$webview2_installer" curl -L "$webview2_installer_url" -o "$webview2_installer"
mv -f WebView2installer.exe "$webview2_installer"
fi fi
# Download all tested extensions for Autodesk Fusion 360 on Linux # Download all tested extensions for Autodesk Fusion 360 on Linux
download_all_extensions download_all_extensions
} }
########################################################################################
# Download an extension if it doesn't exist or is older than 7 days # Download an extension if it doesn't exist or is older than 7 days
function download_all_extensions { function download_all_extensions {
download_extension_if_old "Ceska_lokalizace_pro_Autodesk_Fusion.exe" \ download_extension "Ceska_lokalizace_pro_Autodesk_Fusion.exe" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/Ceska_lokalizace_pro_Autodesk_Fusion.exe" "https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/Ceska_lokalizace_pro_Autodesk_Fusion.exe"
download_extension_if_old "HP_3DPrinters_for_Fusion360-win64.msi" \ download_extension "HP_3DPrinters_for_Fusion360-win64.msi" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/HP_3DPrinters_for_Fusion360-win64.msi" "https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/HP_3DPrinters_for_Fusion360-win64.msi"
download_extension_if_old "Markforged_for_Fusion360-win64.msi" \ download_extension "Markforged_for_Fusion360-win64.msi" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/Markforged_for_Fusion360-win64.msi" "https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/Markforged_for_Fusion360-win64.msi"
download_extension_if_old "OctoPrint_for_Fusion360-win64.msi" \ download_extension "OctoPrint_for_Fusion360-win64.msi" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/OctoPrint_for_Fusion360-win64.msi" "https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/OctoPrint_for_Fusion360-win64.msi"
download_extension_if_old "Ultimaker_Digital_Factory-win64.msi" \ download_extension "Ultimaker_Digital_Factory-win64.msi" \
"https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/Ultimaker_Digital_Factory-win64.msi" "https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extensions/Ultimaker_Digital_Factory-win64.msi"
} }
function download_extension_if_old { function download_extension {
local file_name="$1" local file_name="$1"
local file_url="$2" local file_url="$2"
local extension_path="$selected_directory/extensions/$file_name" local extension_path="$selected_directory/extensions/$file_name"
@@ -175,7 +194,7 @@ function download_extension_if_old {
fi fi
} }
######################################################################################## ###############################################################################################################################################################
# Check if Wine is installed or which version is installed and install it if it doesn't exist and install the required components # Check if Wine is installed or which version is installed and install it if it doesn't exist and install the required components
# Wine version 9.8 is required for Autodesk Fusion 360 # Wine version 9.8 is required for Autodesk Fusion 360
@@ -315,7 +334,7 @@ function check_and_install_wine() {
fi fi
} }
######################################################################################## ###############################################################################################################################################################
function check_gpu_driver() { function check_gpu_driver() {
# Check for Nvidia GPU # Check for Nvidia GPU
@@ -326,69 +345,33 @@ function check_gpu_driver() {
cat /proc/driver/nvidia/version cat /proc/driver/nvidia/version
gpu_driver="DXVK" gpu_driver="DXVK"
else else
echo "Nvidia driver not installed" echo "Nvidia GPU detected"
fi fi
else elif lspci | grep -i 'vga.*amd\|vga.*ati' &> /dev/null; then
echo "Nvidia GPU not detected"
fi
# Check for AMD GPU
if lspci | grep -i 'vga.*amd\|vga.*ati' &> /dev/null; then
echo "AMD GPU detected" echo "AMD GPU detected"
if lsmod | grep -i amdgpu &> /dev/null; then if lsmod | grep -i amdgpu &> /dev/null; then
echo "AMD driver installed" echo "AMD driver installed"
modinfo amdgpu | grep -i version modinfo amdgpu | grep -i version
gpu_driver="OpenGL" gpu_driver="OpenGL"
else else
echo "AMD driver not installed" echo "AMD GPU detected"
fi fi
else elif lspci | grep -i 'vga.*intel' &> /dev/null; then
echo "AMD GPU not detected"
fi
# Check for Intel GPU
if lspci | grep -i 'vga.*intel' &> /dev/null; then
echo "Intel GPU detected" echo "Intel GPU detected"
if lsmod | grep -i i915 &> /dev/null; then if lsmod | grep -i i915 &> /dev/null; then
echo "Intel driver installed" echo "Intel driver installed"
modinfo i915 | grep -i version modinfo i915 | grep -i version
gpu_driver="OpenGL" gpu_driver="OpenGL"
else else
echo "Intel driver not installed" echo "Intel GPU detected"
fi fi
else else
echo "Intel GPU not detected" echo "No supported GPU detected"
gpu_driver="OpenGL"
fi fi
} }
######################################################################################## ###############################################################################################################################################################
function dxvk_opengl_1 {
if [[ $gpu_driver = "DXVK" ]]; then
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q dxvk
curl -o DXVK.reg https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/setup/resource/video_driver/dxvk/DXVK.reg
# Add the "return"-option. Here you can read more about it -> https://github.com/koalaman/shellcheck/issues/592
WINEPREFIX="$selected_directory/wineprefixes/default" wine regedit.exe DXVK.reg
fi
}
function dxvk_opengl_2 {
if [[ $gpu_driver = "DXVK" ]]; then
curl -o NMachineSpecificOptions.xml https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/setup/resource/video_driver/dxvk/NMachineSpecificOptions.xml
else
curl -o NMachineSpecificOptions.xml https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/setup/resource/video_driver/opengl/NMachineSpecificOptions.xml
fi
}
########################################################################################
# Execute the installation of Autodesk Fusion 360
function fusion360_install_update {
WINEPREFIX="$selected_directory/wineprefixes/default" timeout -k 2m 1m wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
WINEPREFIX="$selected_directory/wineprefixes/default" timeout -k 2m 1m wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360Clientinstaller.exe"
}
########################################################################################
# Helper function for the following function. The AdskIdentityManager.exe can be installed # Helper function for the following function. The AdskIdentityManager.exe can be installed
# into a variable alphanumeric folder. # into a variable alphanumeric folder.
@@ -408,7 +391,7 @@ function fusion360_shortcuts_load {
# Create a .desktop file (launcher.sh) for Autodesk Fusion 360! # Create a .desktop file (launcher.sh) for Autodesk Fusion 360!
wget -Nc -P "$selected_directory/graphics" https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/resource/graphics/autodesk_fusion.svg wget -Nc -P "$selected_directory/graphics" https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/resource/graphics/autodesk_fusion.svg
rm "$HOME/.local/share/applications/wine/Programs/Autodesk/Autodesk Fusion 360.desktop" rm "$HOME/.local/share/applications/wine/Programs/Autodesk/Autodesk Fusion 360.desktop"
cat >> "$HOME/.local/share/applications/wine/Programs/Autodesk/Fusion360/fusion360.desktop" << EOF cat >> "$HOME/.local/share/applications/wine/Programs/Autodesk/Fusion360/Autodesk Fusion 360.desktop" << EOF
[Desktop Entry] [Desktop Entry]
Name=Autodesk Fusion 360 Name=Autodesk Fusion 360
GenericName=CAD Application GenericName=CAD Application
@@ -455,19 +438,42 @@ EOL
xdg-mime default adskidmgr-opener.desktop x-scheme-handler/adskidmgr xdg-mime default adskidmgr-opener.desktop x-scheme-handler/adskidmgr
#Disable Debug messages on regular runs, we dont have a terminal, so speed up the system by not wasting time prining them into the Void #Disable Debug messages on regular runs, we dont have a terminal, so speed up the system by not wasting time prining them into the Void
sed -i 's/=env WINEPREFIX=/=env WINEDEBUG=-all env WINEPREFIX=/g' "$HOME/.local/share/applications/wine/Programs/Autodesk/Fusion360/fusion360.desktop" sed -i 's/=env WINEPREFIX=/=env WINEDEBUG=-all env WINEPREFIX=/g' "$HOME/.local/share/applications/wine/Programs/Autodesk/Fusion360/Autodesk Fusion 360.desktop"
# Download some script files for Autodesk Fusion 360! # Download some script files for Autodesk Fusion 360!
wget -NP "$selected_directory/bin" https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/data/autodesk_fusion_launcher.sh wget -NP "$selected_directory/bin" https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/data/autodesk_fusion_launcher.sh
chmod +x "$selected_directory/bin/autodesk_fusion_launcher.sh" chmod +x "$selected_directory/bin/autodesk_fusion_launcher.sh"
} }
######################################################################################## ###############################################################################################################################################################
function logfile_wineprefix() { function dxvk_opengl_1 {
# Log the Wineprefixes if [[ $gpu_driver = "DXVK" ]]; then
echo "$gpu_driver" >> "$selected_directory/logs/wineprefixes.log" WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q dxvk
echo "$selected_directory/wineprefixes/default" >> "$selected_directory/logs/wineprefixes.log" curl -o DXVK.reg https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/resource/video_driver/dxvk/DXVK.reg -o "$selected_directory/drive_c/users/$USER/Downloads"
# Add the "return"-option. Here you can read more about it -> https://github.com/koalaman/shellcheck/issues/592
cd "$selected_directory/drive_c/users/$USER/Downloads" || return
WINEPREFIX="$selected_directory/wineprefixes/default" wine regedit.exe DXVK.reg
fi
}
function dxvk_opengl_2 {
if [[ $gpu_driver = "DXVK" ]]; then
curl -o NMachineSpecificOptions.xml https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/resource/video_driver/dxvk/NMachineSpecificOptions.xml
else
curl -o NMachineSpecificOptions.xml https://raw.githubusercontent.com/cryinkfly/Autodesk-Fusion-360-for-Linux/main/files/setup/resource/video_driver/opengl/NMachineSpecificOptions.xml
fi
}
###############################################################################################################################################################
# Execute the installation of Autodesk Fusion 360
function autodesk_fusion_install {
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads"
#WINEPREFIX="$selected_directory/wineprefixes/default" timeout -k 5m 1m wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360Clientinstaller.exe" --quiet
WINEPREFIX="$selected_directory/wineprefixes/default" timeout -k 2m 1m wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
sleep 5s
WINEPREFIX="$selected_directory/wineprefixes/default" timeout -k 2m 1m wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360installer.exe" --quiet
} }
############################################################################################################################################################### ###############################################################################################################################################################
@@ -479,47 +485,53 @@ function wine_fusion360_config() {
# But it still ensures that wine, for example, no longer has access permissions to Home! # But it still ensures that wine, for example, no longer has access permissions to Home!
# For this reason, the EXE files must be located directly in the Wineprefix folder! # For this reason, the EXE files must be located directly in the Wineprefix folder!
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads" && mkdir -p "$selected_directory/wineprefixes/default"
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads" cd "$selected_directory/wineprefixes/default" || return
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q sandbox && WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q sandbox
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q sandbox && sleep 5s
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q sandbox
sleep 5s
# We must install some packages! # We must install some packages!
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q atmlib gdiplus arial corefonts cjkfonts dotnet452 msxml4 msxml6 vcrun2017 fontsmooth=rgb winhttp win10 && WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q atmlib gdiplus arial corefonts cjkfonts dotnet452 msxml4 msxml6 vcrun2017 fontsmooth=rgb winhttp win10
# We must install cjkfonts again then sometimes it doesn't work in the first time! # We must install cjkfonts again then sometimes it doesn't work in the first time!
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q cjkfonts && sleep 5s
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q cjkfonts
# We must set to Windows 10 or 11 again because some other winetricks sometimes set it back to Windows XP! # We must set to Windows 10 or 11 again because some other winetricks sometimes set it back to Windows XP!
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q win11 && sleep 5s
WINEPREFIX="$selected_directory/wineprefixes/default" sh "$selected_directory/bin/winetricks" -q win11
# Remove tracking metrics/calling home # Remove tracking metrics/calling home
WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "adpclientservice.exe" /t REG_SZ /d "" /f && sleep 5s
WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "adpclientservice.exe" /t REG_SZ /d "" /f
# Navigation bar does not work well with anything other than the wine builtin DX9 # Navigation bar does not work well with anything other than the wine builtin DX9
WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "AdCefWebBrowser.exe" /t REG_SZ /d builtin /f && WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "AdCefWebBrowser.exe" /t REG_SZ /d builtin /f
# Use Visual Studio Redist that is bundled with the application # Use Visual Studio Redist that is bundled with the application
WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "msvcp140" /t REG_SZ /d native /f && WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "msvcp140" /t REG_SZ /d native /f
WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "mfc140u" /t REG_SZ /d native /f && WINEPREFIX="$selected_directory/wineprefixes/default" wine REG ADD "HKCU\Software\Wine\DllOverrides" /v "mfc140u" /t REG_SZ /d native /f
# Fixed the problem with the bcp47langs issue and now the login works again! # Fixed the problem with the bcp47langs issue and now the login works again!
WINEPREFIX="$selected_directory/wineprefixes/default" wine reg add "HKCU\Software\Wine\DllOverrides" /v "bcp47langs" /t REG_SZ /d "" /f && WINEPREFIX="$selected_directory/wineprefixes/default" wine reg add "HKCU\Software\Wine\DllOverrides" /v "bcp47langs" /t REG_SZ /d "" /f
# Download and install WebView2 to handle Login attempts, required even though we redirect to your default browser # Download and install WebView2 to handle Login attempts, required even though we redirect to your default browser
cp "$selected_directory/downloads/WebView2installer.exe" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/WebView2installer.exe" && sleep 5s
WINEPREFIX="$selected_directory/wineprefixes/default" wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/WebView2installer.exe" /install && cp "$selected_directory/downloads/WebView2installer.exe" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/WebView2installer.exe"
WINEPREFIX="$selected_directory/wineprefixes/default" wine "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/WebView2installer.exe" /silent /install
# Pre-create shortcut directory for latest re-branding Microsoft Edge WebView2 # Pre-create shortcut directory for latest re-branding Microsoft Edge WebView2
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/User Pinned/" && mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Roaming/Microsoft/Internet Explorer/Quick Launch/User Pinned/"
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads" && dxvk_opengl_1
dxvk_opengl_1 && cp "$selected_directory/downloads/Fusion360installer.exe" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads"
cp "$selected_directory/downloads/Fusion360installer.exe" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360installer.exe" && cp "$selected_directory/downloads/Fusion360Clientinstaller.exe" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads"
cp "$selected_directory/downloads/Fusion360Clientinstaller.exe" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads/Fusion360Clientinstaller.exe" && autodesk_fusion_install
fusion360_install_update && mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Roaming/Autodesk/Neutron Platform/Options"
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Roaming/Autodesk/Neutron Platform/Options" && cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Roaming/Autodesk/Neutron Platform/Options" || return
mv "NMachineSpecificOptions.xml" "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Roaming/Autodesk/Neutron Platform/Options" &&
dxvk_opengl_2 &&
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Local/Autodesk/Neutron Platform/Options" &&
mv "NMachineSpecificOptions.xml" "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Local/Autodesk/Neutron Platform/Options" &&
dxvk_opengl_2 &&
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/Application Data/Autodesk/Neutron Platform/Options" &&
mv "NMachineSpecificOptions.xml" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Application Data/Autodesk/Neutron Platform/Options" &&
dxvk_opengl_2 dxvk_opengl_2
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Local/Autodesk/Neutron Platform/Options"
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/AppData/Local/Autodesk/Neutron Platform/Options" || return
dxvk_opengl_2
mkdir -p "$selected_directory/wineprefixes/default/drive_c/users/$USER/Application Data/Autodesk/Neutron Platform/Options"
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/Application Data/Autodesk/Neutron Platform/Options" || return
dxvk_opengl_2
cd "$selected_directory/bin" || return
} }
######################################################################################## ###############################################################################################################################################################
# Check and install the selected extensions # Check and install the selected extensions
function check_and_install_extensions() { function check_and_install_extensions() {
@@ -564,32 +576,24 @@ function install_extension {
local extension_file="$1" local extension_file="$1"
cp "$selected_directory/extensions/$extension_file" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads" cp "$selected_directory/extensions/$extension_file" "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads"
if [[ "$extension_file" == *.msi ]]; then if [[ "$extension_file" == *.msi ]]; then
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads" || return
WINEPREFIX="$selected_directory/wineprefixes/default" wine msiexec /i "$extension_file" WINEPREFIX="$selected_directory/wineprefixes/default" wine msiexec /i "$extension_file"
else else
cd "$selected_directory/wineprefixes/default/drive_c/users/$USER/Downloads" || return
WINEPREFIX="$selected_directory/wineprefixes/default" wine "$extension_file" WINEPREFIX="$selected_directory/wineprefixes/default" wine "$extension_file"
fi fi
} }
###############################################################################################################################################################
function logfile_wineprefix() {
# Log the Wineprefixes
echo "$gpu_driver" >> "$selected_directory/logs/wineprefixes.log"
echo "$selected_directory/wineprefixes/default" >> "$selected_directory/logs/wineprefixes.log"
}
######################################################################################## ########################################################################################
######################################################################################## ########################################################################################
# Get the current used Linux distribution and version without lsb_release
distribution=$(grep "^ID=" /etc/*-release | cut -d'=' -f2 | tr -d '"')
version=$(grep "^VERSION_ID=" /etc/*-release | cut -d'=' -f2 | tr -d '"')
echo "Linux distribution: $distribution"
echo "Linux version: $version"
# Get the values of the passed arguments and assign them to variables
echo "$1"
echo "$2"
echo "$3"
selected_option="$1"
selected_directory="$2"
selected_extensions="$3"
echo "Selected option: $selected_option"
echo "Selected directory: $selected_directory"
echo "Selected extensions: $selected_extensions"
# Check which option is selected and execute the corresponding function # Check which option is selected and execute the corresponding function
check_option "$selected_option"
check_option "$1" check_option "$1"