Add a new function (Select Wine version)

Now you can select the stable or staging version of wine!
This commit is contained in:
Steve Zabka
2021-11-28 11:50:37 +01:00
committed by GitHub
parent 3fcc7d1f40
commit 9df34da078

View File

@@ -7,8 +7,8 @@
# Author URI: https://cryinkfly.com # # Author URI: https://cryinkfly.com #
# License: MIT # # License: MIT #
# Copyright (c) 2020-2021 # # Copyright (c) 2020-2021 #
# Time/Date: 18:00/27.11.2021 # # Time/Date: 11:45/28.11.2021 #
# Version: 1.6.3 # # Version: 1.6.4 #
#################################################################################################### ####################################################################################################
############################################################################################################################################################### ###############################################################################################################################################################
@@ -33,6 +33,9 @@ driver_used=0
# Reset the logfile-value for the installation of Autodesk Fusion 360! # Reset the logfile-value for the installation of Autodesk Fusion 360!
f360path_log=0 f360path_log=0
# Reset the wine-value for the installation of Autodesk Fusion 360!
wine_version_used=0
############################################################################################################################################################### ###############################################################################################################################################################
# ALL LOG-FUNCTIONS ARE ARRANGED HERE: # # ALL LOG-FUNCTIONS ARE ARRANGED HERE: #
############################################################################################################################################################### ###############################################################################################################################################################
@@ -164,7 +167,7 @@ function setupact-load-f360exe {
############################################################################################################################################################### ###############################################################################################################################################################
function setupact-dxvk-opengl-1 { function setupact-dxvk-opengl-1 {
if [ $driver_used -eq 2 ]; then if [ $driver_used -eq 1 ]; then
WINEPREFIX=$wineprefixname sh data/winetricks/winetricks -q dxvk WINEPREFIX=$wineprefixname sh data/winetricks/winetricks -q dxvk
wget -N https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extras/opengl_dxvk/DXVK.reg wget -N https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extras/opengl_dxvk/DXVK.reg
WINEPREFIX=$wineprefixname wine regedit.exe DXVK.reg WINEPREFIX=$wineprefixname wine regedit.exe DXVK.reg
@@ -172,7 +175,7 @@ function setupact-dxvk-opengl-1 {
} }
function setupact-dxvk-opengl-2 { function setupact-dxvk-opengl-2 {
if [ $driver_used -eq 2 ]; then if [ $driver_used -eq 1 ]; then
wget -N https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extras/opengl_dxvk/DXVK.xml wget -N https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extras/opengl_dxvk/DXVK.xml
mv DXVK.xml NMachineSpecificOptions.xml mv DXVK.xml NMachineSpecificOptions.xml
else else
@@ -182,7 +185,7 @@ if [ $driver_used -eq 2 ]; then
} }
function setupact-dxvk-opengl-3 { function setupact-dxvk-opengl-3 {
if [ $driver_used -eq 2 ]; then if [ $driver_used -eq 1 ]; then
wget -N https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extras/opengl_dxvk/DXVK.xml wget -N https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux/raw/main/files/extras/opengl_dxvk/DXVK.xml
mv DXVK.xml NMachineSpecificOptions.xml mv DXVK.xml NMachineSpecificOptions.xml
else else
@@ -246,13 +249,13 @@ function archlinux {
if archlinux-verify-multilib ; then if archlinux-verify-multilib ; then
echo "multilib found. Continuing..." echo "multilib found. Continuing..."
sudo pacman -Sy --needed wine wine-mono wine_gecko winetricks p7zip curl cabextract samba ppp sudo pacman -Sy --needed wine wine-mono wine_gecko winetricks p7zip curl cabextract samba ppp
setupact-f360install setupact-f360install
else else
echo "Enabling multilib..." echo "Enabling multilib..."
echo "[multilib]" | sudo tee -a /etc/pacman.conf echo "[multilib]" | sudo tee -a /etc/pacman.conf
echo "Include = /etc/pacman.d/mirrorlist" | sudo tee -a /etc/pacman.conf echo "Include = /etc/pacman.d/mirrorlist" | sudo tee -a /etc/pacman.conf
sudo pacman -Sy --needed wine wine-mono wine_gecko winetricks p7zip curl cabextract samba ppp sudo pacman -Sy --needed wine wine-mono wine_gecko winetricks p7zip curl cabextract samba ppp
setupact-f360install setupact-f360install
fi fi
} }
@@ -266,7 +269,6 @@ function archlinux-verify-multilib {
function debian-based-1 { function debian-based-1 {
sudo apt-get update sudo apt-get update
sudo apt-get upgrade
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
wget -nc https://dl.winehq.org/wine-builds/winehq.key wget -nc https://dl.winehq.org/wine-builds/winehq.key
sudo apt-key add winehq.key sudo apt-key add winehq.key
@@ -274,66 +276,33 @@ function debian-based-1 {
function debian-based-2 { function debian-based-2 {
sudo apt-get update sudo apt-get update
sudo apt-get upgrade
sudo apt-get install p7zip p7zip-full p7zip-rar curl winbind cabextract wget sudo apt-get install p7zip p7zip-full p7zip-rar curl winbind cabextract wget
sudo apt-get install --install-recommends winehq-staging if [ $wine_version_used -eq 1 ]; then
sudo apt-get install --install-recommends winehq-staging
else
sudo apt-get install --install-recommends winehq-stable
fi
setupact-f360install setupact-f360install
} }
function ubuntu18 { function ubuntu18 {
sudo apt-add-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main'
wget -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/Release.key -O Release.key -O- | sudo apt-key add -
sudo apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/ ./'
} }
function ubuntu20 { function ubuntu20 {
sudo add-apt-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main' sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
wget -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04/Release.key -O Release.key -O- | sudo apt-key add -
sudo apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.04/ ./'
} }
function ubuntu20_10 { function ubuntu20_10 {
sudo add-apt-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ groovy main' sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ groovy main'
wget -q https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.10/Release.key -O Release.key -O- | sudo apt-key add -
sudo apt-add-repository 'deb https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_20.10/ ./'
} }
function ubuntu21 { function ubuntu21 {
# Note: This installs the public key to trusted.gpg.d - While this is "acceptable" behaviour it is not best practice. sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ hirsute main'
# It is infinitely better than using apt-key add though.
# For more information and for instructions to utalise best practices, see:
# https://askubuntu.com/questions/1286545/what-commands-exactly-should-replace-the-deprecated-apt-key
sudo apt-get update
sudo apt-get upgrade
sudo dpkg --add-architecture i386
mkdir -p /tmp/360 && cd /tmp/360
wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_21.04/Release.key
wget https://dl.winehq.org/wine-builds/winehq.key
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import Release.key
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output opensuse-wine.gpg && rm temp-keyring.gpg
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import winehq.key
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output winehq.gpg && rm temp-keyring.gpg
sudo mv *.gpg /etc/apt/trusted.gpg.d/ && cd /tmp && sudo rm -rf 360
echo "deb [signed-by=/etc/apt/trusted.gpg.d/opensuse-wine.gpg] https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_21.04/ ./" | sudo tee -a /etc/apt/sources.list.d/opensuse-wine.list
sudo add-apt-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ hirsute main'
cd "$HOME/.wineprefixes/fusion360/INSTALLDIR"
} }
function ubuntu21_10 { function ubuntu21_10 {
# Note: See the description in the function ubuntu21! sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ impish main'
sudo apt-get update
sudo apt-get upgrade
sudo dpkg --add-architecture i386
mkdir -p /tmp/360 && cd /tmp/360
wget https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_21.04/Release.key
wget https://dl.winehq.org/wine-builds/winehq.key
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import Release.key
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output opensuse-wine.gpg && rm temp-keyring.gpg
gpg --no-default-keyring --keyring ./temp-keyring.gpg --import winehq.key
gpg --no-default-keyring --keyring ./temp-keyring.gpg --export --output winehq.gpg && rm temp-keyring.gpg
sudo mv *.gpg /etc/apt/trusted.gpg.d/ && cd /tmp && sudo rm -rf 360
echo "deb [signed-by=/etc/apt/trusted.gpg.d/opensuse-wine.gpg] https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_21.10/ ./" | sudo tee -a /etc/apt/sources.list.d/opensuse-wine.list
sudo add-apt-repository -r 'deb https://dl.winehq.org/wine-builds/ubuntu/ impish main'
} }
function fedora-based-1 { function fedora-based-1 {
@@ -857,7 +826,7 @@ function setupact-select-f360-path {
############################################################################################################################################################### ###############################################################################################################################################################
# Autodesk Fusion 360 will be installed from scratch on this system! # Select driver version for Autodesk Fusion 360!
function setupact-select-opengl_dxvk { function setupact-select-opengl_dxvk {
select_driver=$(zenity --list \ select_driver=$(zenity --list \
--radiolist \ --radiolist \
@@ -868,15 +837,35 @@ function setupact-select-opengl_dxvk {
TRUE "$text_driver_opengl" \ TRUE "$text_driver_opengl" \
FALSE "$text_driver_dxvk") FALSE "$text_driver_dxvk")
[[ $select_driver = "$text_driver_opengl" ]] && driver_used=1 && setupact-select-os [[ $select_driver = "$text_driver_opengl" ]] && driver_used=0 && setupact-select-wine_version
[[ $select_driver = "$text_driver_dxvk" ]] && driver_used=2 && setupact-select-os [[ $select_driver = "$text_driver_dxvk" ]] && driver_used=1 && setupact-select-wine_version
[[ "$select_driver" ]] || echo "Go back" && setupact-select-f360-path [[ "$select_driver" ]] || echo "Go back" && setupact-select-f360-path
} }
############################################################################################################################################################### ###############################################################################################################################################################
# Autodesk Fusion 360 will be installed from scratch on this system!
function setupact-select-wine_version {
select_wine_version=$(zenity --list \
--radiolist \
--title="$program_name" \
--width=700 \
--height=500 \
--column="$text_select" --column="Wine Version" \
TRUE "Wine Version (Stable)" \
FALSE "Wine Version (Staging)")
[[ $select_wine_version = "Wine Version (Stable)" ]] && wine_version_used=0 && setupact-select-os
[[ $select_wine_version = "Wine Version (Staging)" ]] && wine_version_used=1 && setupact-select-os
[[ "$select_wine_version" ]] || echo "Go back" && setupact-select-opengl_dxvk
}
###############################################################################################################################################################
# Create & Select a directory for your Autodesk Fusion 360! # Create & Select a directory for your Autodesk Fusion 360!
function setupact-f360-path { function setupact-f360-path {
wineprefixname=`zenity --file-selection --directory --title="$text_select_location_custom"` wineprefixname=`zenity --file-selection --directory --title="$text_select_location_custom"`