2022-02-18 11:38:57 +01:00
#!/bin/bash
################################################################################
# Name: Autodesk Fusion 360 - Uninstall the software (Linux) #
# Description: With this file you delete Autodesk Fusion 360 on your system. #
# Author: Steve Zabka #
# Author URI: https://cryinkfly.com #
# License: MIT #
# Copyright (c) 2020-2022 #
2022-02-20 13:24:42 +01:00
# Time/Date: 13:30/20.02.2022 #
# Version: 0.5 #
2022-02-18 11:38:57 +01:00
################################################################################
# Path: /$HOME/.config/fusion-360/bin/uninstall.sh
###############################################################################################################################################################
# Window Title (Launcher)
program_name = "Autodesk Fusion 360 for Linux - Uninstall"
###############################################################################################################################################################
# ALL FUNCTIONS ARE ARRANGED HERE: #
2022-02-18 11:42:09 +01:00
###############################################################################################################################################################
2022-02-18 11:38:57 +01:00
2022-02-20 13:35:48 +01:00
2022-02-19 09:04:08 +01:00
# Get a file where the user can see the exits Wineprefixes of Autodesk Fusion 360 on the system.
function setupact-get-wineprefixes-log {
mkdir -p "/tmp/fusion-360/logs"
cp " $HOME /.config/fusion-360/logs/wineprefixes.log " "/tmp/fusion-360/logs"
mv "/tmp/fusion-360/logs/wineprefixes.log" "/tmp/fusion-360/logs/wineprefixes"
}
###############################################################################################################################################################
2022-02-20 13:35:48 +01:00
# Load the locale files for the setup wizard.
function load-locale-cs {
profile_locale = "cs-CZ"
. $HOME /.config/fusion-360/locale/cs-CZ/locale-cs.sh
}
function load-locale-de {
profile_locale = "de-DE"
. $HOME /.config/fusion-360/locale/de-DE/locale-de.sh
}
function load-locale-en {
profile_locale = "en-US"
. $HOME /.config/fusion-360/locale/en-US/locale-en.sh
}
function load-locale-es {
profile_locale = "es-ES"
. $HOME /.config/fusion-360/locale/es-ES/locale-es.sh
}
function load-locale-fr {
profile_locale = "fr-FR"
. $HOME /.config/fusion-360/locale/fr-FR/locale-fr.sh
}
function load-locale-it {
profile_locale = "it-IT"
. $HOME /.config/fusion-360/locale/it-IT/locale-it.sh
}
function load-locale-ja {
profile_locale = "ja-JP"
. $HOME /.config/fusion-360/locale/ja-JP/locale-ja.sh
}
function load-locale-ko {
profile_locale = "ko-KR"
. $HOME /.config/fusion-360/locale/ko-KR/locale-ko.sh
}
function load-locale-zh {
profile_locale = "zh-CN"
. $HOME /.config/fusion-360/locale/zh-CN/locale-zh.sh
}
###############################################################################################################################################################
2022-02-18 11:38:57 +01:00
# Remove a exist Wineprefix of Autodesk Fusion 360!
function setupact-uninstall {
2022-02-18 11:42:09 +01:00
setupact-select-wineprefix-info
setupact-select-wineprefix
rm -r " $wineprefix_directory "
setupact-uninstall-completed
2022-02-18 11:38:57 +01:00
}
###############################################################################################################################################################
# ALL DIALOGS ARE ARRANGED HERE: #
###############################################################################################################################################################
2022-02-20 13:35:48 +01:00
# Configure the locale for the Uninstall of Autodesk Fusion 360!
function setupact-uninstall-configure-locale {
select_locale = $( zenity --list \
--radiolist \
--title= " $program_name " \
--width= 700 \
--height= 500 \
--column= "Select:" --column= "Language:" \
TRUE "English (Standard)" \
FALSE "German" \
FALSE "Czech" \
FALSE "Spanish" \
FALSE "French" \
FALSE "Italian" \
FALSE "Japanese" \
FALSE "Korean" \
FALSE "Chinese" )
[ [ $select_locale = "English (Standard)" ] ] && load-locale-en && setupact-uninstall-question
[ [ $select_locale = "German" ] ] && load-locale-de && setupact-uninstall-question
[ [ $select_locale = "Czech" ] ] && load-locale-cs && setupact-uninstall-question
[ [ $select_locale = "Spanish" ] ] && load-locale-es && setupact-uninstall-question
[ [ $select_locale = "French" ] ] && load-locale-fr && setupact-uninstall-question
[ [ $select_locale = "Italian" ] ] && load-locale-it && setupact-uninstall-question
[ [ $select_locale = "Japanese" ] ] && load-locale-ja && setupact-uninstall-question
[ [ $select_locale = "Korean" ] ] && load-locale-ko && setupact-uninstall-question
[ [ $select_locale = "Chinese" ] ] && load-locale-zh && setupact-uninstall-question
[ [ " $select_locale " ] ] || setupact-configure-locale-abort
}
###############################################################################################################################################################
2022-02-18 11:38:57 +01:00
# The user will be asked if he wants to uninstall or not.
2022-02-20 13:27:05 +01:00
function setupact-uninstall-question {
2022-02-18 11:38:57 +01:00
zenity --question \
2022-02-19 08:42:46 +01:00
--title= " $program_name " \
--text= "Do you really want to uninstall Autodesk Fusion 360 from your system?" \
--width= 400 \
--height= 100
answer = $?
if [ " $answer " -eq 0 ] ; then
2022-02-18 11:38:57 +01:00
setupact-uninstall-dialog
elif [ " $answer " -eq 1 ] ; then
setupact-cancel-info
fi
}
###############################################################################################################################################################
# The user will be informed that he is skipping the update!
function setupact-cancel-info {
zenity --info \
2022-02-19 08:42:46 +01:00
--text= "The uninstallation was aborted!" \
--width= 400 \
--height= 100
2022-02-20 11:28:53 +01:00
if [ " $uninstall_standalone " -eq 0 ] ; then
exit;
else [ " $uninstall_standalone " -eq 1 ] ; then
echo "Go back"
2022-02-20 13:24:42 +01:00
program_name = "Autodesk Fusion 360 for Linux - Setup Wizard"
2022-02-20 11:28:53 +01:00
setupact-modify-f360
fi
2022-02-18 11:38:57 +01:00
}
###############################################################################################################################################################
# Deinstall a exist Wineprefix of Autodesk Fusion 360!
2022-02-19 09:04:08 +01:00
function setupact-uninstall-dialog {
2022-02-19 08:38:39 +01:00
file = /tmp/fusion-360/logs/wineprefixes
directory = ` zenity --text-info \
2022-02-19 08:42:46 +01:00
--title= " $program_name " \
--width= 700 \
--height= 500 \
--filename= $file \
--editable \
2022-02-19 09:04:08 +01:00
--checkbox= "I wrote down or copied the correct path from an existing Autodesk Fusion 360 installation and deleted this path then here!" `
2022-02-19 08:38:39 +01:00
case $? in
2022-02-20 11:28:53 +01:00
0)
zenity --question \
--title= " $program_name " \
--text= "Do you want to save your changes and deleting the correct existing Autodesk Fusion 360 installation?" \
--width= 400 \
--height= 100
answer = $?
if [ " $answer " -eq 0 ] ; then
echo " $directory " > $file
cp " $file " " $HOME /.config/fusion-360/logs "
mv " $HOME /.config/fusion-360/logs/wineprefixes " " $HOME /.config/fusion-360/logs/wineprefixes.log "
setupact-uninstall
elif [ " $answer " -eq 1 ] ; then
setupact-uninstall-dialog
fi
; ;
1)
echo "Go back"
setupact-update-question
; ;
-1)
zenity --error \
--text= "An unexpected error occurred!"
exit;
; ;
2022-02-19 08:38:39 +01:00
esac
2022-02-18 11:38:57 +01:00
}
###############################################################################################################################################################
# Select the Wineprefix-directory of your Autodesk Fusion 360 installation!
function setupact-select-wineprefix-info {
zenity --info \
2022-02-19 08:42:46 +01:00
--text= "Select the Wineprefix-directory of your Autodesk Fusion 360 installation, which you want to uninstall! For example: /home/user/.wineprefixes/fusion360" \
--width= 400 \
--height= 100
2022-02-18 11:38:57 +01:00
}
function setupact-select-wineprefix {
2022-02-18 11:42:09 +01:00
wineprefix_directory = ` zenity --file-selection --directory --title= "Select the Wineprefix-directory ..." `
2022-02-18 11:38:57 +01:00
}
###############################################################################################################################################################
# The uninstallation is complete and will be terminated.
function setupact-uninstall-completed {
zenity --info \
2022-02-19 08:42:46 +01:00
--width= 400 \
--height= 100 \
2022-02-19 09:04:08 +01:00
--text= "The deinstallation of Autodesk Fusion 360 is completed."
2022-02-18 11:38:57 +01:00
exit;
}
###############################################################################################################################################################
2022-02-18 11:45:00 +01:00
# THE PROGRAM IS STARTED HERE: #
2022-02-18 11:38:57 +01:00
###############################################################################################################################################################
2022-02-19 09:04:08 +01:00
setupact-get-wineprefixes-log
2022-02-20 13:35:48 +01:00
setupact-uninstall-configure-locale