Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Bash] Development of a Script to Install Lutris with winehq-staging to run Origin Games in Debian Bullseye

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
andrethiagolanzer
Posts: 3
Joined: 2023-07-09 19:05

[Bash] Development of a Script to Install Lutris with winehq-staging to run Origin Games in Debian Bullseye

#1 Post by andrethiagolanzer »

Hello everybody !

Here I place a Script I developed to automatize the procedure of installing an application (Lutris with wineqh-staging) for my child to play in my PC (Debian Bullseye with Kernel 5.10.0-23 64-bits). The Script is self-explanatory and may be used to simplify the task in Lan-Houses also, reducing this way their costs with licenses from other OSes. It may work in Ubuntu and in other versions of Debian, but I didn't tested that. I hope you enjoy it. It's on the attached file.



Have fun !
Attachments
InstallLutrisEn.zip
Install Lutris script
(2.58 KiB) Downloaded 20 times
Screen with Lutris and EA
Screen with Lutris and EA
Screen with Origin configuration
Screen with Origin configuration
Screen with Lutris and Winehq configuration
Screen with Lutris and Winehq configuration
Last edited by andrethiagolanzer on 2023-07-15 20:34, edited 1 time in total.

andrethiagolanzer
Posts: 3
Joined: 2023-07-09 19:05

Re: [Bash] Development of a Script to Install Lutris with winehq-staging to run Origin Games in Debian Bullseye

#2 Post by andrethiagolanzer »

For further analysis and use, it follows the latest version of the Script in its entire content:

---------------------------------------------------------------------------------------------------------------------

Code: Select all

#!/bin/bash

if [[ $(type -t StartProcedures) == function ]]; then
unset -f StartProcedures
fi

export CURRENT_USER="$(whoami)"

function StartProcedures {

echo
echo "Starting Procedures..."

echo
echo "Performing previous install operations... Wait a moment please..."
apt install -y wget
apt install -y dpkg

echo
echo "Should I perform a full installation or you want to do it step-by-step ?"
read -p "(Y for full installation / N for step-by-step installation)" YesOrNo

case $YesOrNo in

Y|y )

	# Cleaning Lutris

	echo
	echo "Cleaning Lutris for User $CURRENT_USER as User $(whoami)"

	apt purge -y lutris

	rm -f -r /home/$CURRENT_USER/Games/origin
	rm -f -r /home/$CURRENT_USER/.config/lutris
	rm -f -r /home/$CURRENT_USER/.local/share/lutris
	rm -f -r /home/$CURRENT_USER/.cache/lutris
	find /home/$CURRENT_USER/.local/share/. -name "lutris*.*" -print0 | xargs -0 rm
	find /usr/* -name "lutris*.*" -print0 | xargs -0 rm
	find /etc/* -name "lutris*.*" -print0 | xargs -0 rm
	find /var/* -name "lutris*.*" -print0 | xargs -0 rm
	find /tmp/* -name "lutris*.*" -print0 | xargs -0 rm

	echo "Success !"

	# Cleaning Wine

	echo
	echo "Cleaning Wine for User $CURRENT_USER as User $(whoami)"

	apt purge -y wine wine-binfmt wine-devel wine-devel-amd64 wine-devel-dbg wine-devel-dev
	apt purge -y wine-stable wine-stable-amd64 wine-stable-dbg wine-stable-dev
	apt purge -y wine-staging wine-staging-amd64 wine-staging-dbg wine-staging-dev wine-staging-i386:i386
	apt purge -y wine32-preloader:i386 wine32:i386 wine64 wine64-preloader wine64-tools
	apt purge -y winehq-devel winehq-stable winehq-staging
	apt purge -y libwine libwine-dev libwine:i386
	apt purge -y fonts-wine gnome-wine-icon-theme

	echo
	echo "Success !"


	# Configure Repository

	echo
	echo "Configuring repository"

	yes | add-apt-repository -r -n "deb https://dl.winehq.org/wine-builds/debian/ bullseye main"
	yes | dpkg --add-architecture i386
	apt update -y

	# Configure WgetAndKeys

	echo
	echo "Configuring Keys"

	mkdir -pm755 /etc/apt/keyrings
	cd /etc/apt/keyrings
	wget -nc https://dl.winehq.org/wine-builds/winehq.key
	yes | apt-key add winehq.key
	wget -nc https://dl.winehq.org/wine-builds/winehq-archive.key
	yes | apt-key add winehq-archive.key

	# Download, Install and Configure

	echo
	echo "Downloading, Installing and Configuring"

	apt install -y software-properties-common
	cd /tmp
	wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bullseye/winehq-bullseye.sources
	apt install -y --install-recommends winehq-staging
	apt install -y wine64 wine64-preloader wine32-preloader:i386
	apt purge -y winehq-devel

	# Installing Winetricks

	echo
	echo "Installing winetricks-20230212"
	apt install -y winetricks

	apt-get autoremove -y
	apt-get update -y
	apt-get upgrade -y

	# Install Lutris

	echo
	echo "Installing Lutris"

	echo "deb https://download.opensuse.org/repositories/home:/strycore/Debian_11/ ./" |  tee /etc/apt/sources.list.d/lutris.list
	wget -q https://download.opensuse.org/repositories/home:/strycore/Debian_11/Release.key -O- |  tee /etc/apt/trusted.gpg.d/lutris.asc
	apt update -y
	apt install -y lutris

	# Downloading and Installing Origin

	echo
	echo "Downloading Origin File"
	cd /home/$CURRENT_USER/Games
	wget https://download.dm.origin.com/origin/live/OriginThinSetup.exe
	printf "In /home/%s/Games is the installation file of Origin.\n" $CURRENT_USER
	echo "Use it in Lutris setup."

	;;

* )

	echo
	read -p "Should I perform a previous cleanup ? (Y/N)" yn

	case $yn in

	Y|y )

		# Cleaning Lutris

		echo "Cleaning Lutris as User $(whoami)"

		apt purge lutris

		rm -f -r /home/$CURRENT_USER/Games/origin
		rm -f -r /home/$CURRENT_USER/.config/lutris
		rm -f -r /home/$CURRENT_USER/.local/share/lutris
		rm -f -r /home/$CURRENT_USER/.cache/lutris
		find /home/$CURRENT_USER/.local/share/. -name "lutris*.*" -print0 | xargs -0 rm
		find /usr/* -name "lutris*.*" -print0 | xargs -0 rm
		find /etc/* -name "lutris*.*" -print0 | xargs -0 rm
		find /var/* -name "lutris*.*" -print0 | xargs -0 rm
		find /tmp/* -name "lutris*.*" -print0 | xargs -0 rm

		echo
		echo "Success !"

		# Cleaning Wine

		echo
		echo "Cleaning Wine as User $(whoami)"

		apt purge wine wine-binfmt wine-devel wine-devel-amd64 wine-devel-dbg wine-devel-dev
		apt purge wine-stable wine-stable-amd64 wine-stable-dbg wine-stable-dev
		apt purge wine-staging wine-staging-amd64 wine-staging-dbg wine-staging-dev wine-staging-i386:i386
		apt purge wine32-preloader:i386 wine32:i386 wine64 wine64-preloader wine64-tools
		apt purge winehq-devel winehq-stable winehq-staging
		apt purge libwine libwine-dev libwine:i386
		apt purge fonts-wine gnome-wine-icon-theme

		echo
		echo "Success !"

		;;

	* ) echo; echo "Previous cleanup aborted !";;

	esac

	# Configure Repository

	echo
	read -p "Do you want to add-apt-repository and i386 architecture ? (Y/N)" yn

	case $yn in

		Y|y )  add-apt-repository -r -n "deb https://dl.winehq.org/wine-builds/debian/ bullseye main";  dpkg --add-architecture i386;  apt update;;

		* ) echo; echo "Adding Repository and i386 architecture aborted !";;

	esac

	# Configure WgetAndKeys

	echo
	read -p "Should I run wget and apt-key add keys ? (Y/N)" yn

	case $yn in

		Y|y )  mkdir -pm755 /etc/apt/keyrings; cd /etc/apt/keyrings; wget -nc https://dl.winehq.org/wine-builds/winehq.key;  apt-key add winehq.key; wget -nc https://dl.winehq.org/wine-builds/winehq-archive.key;  apt-key add winehq-archive.key;;

		* ) echo; echo "Keys installation aborted !";;

	esac

	# Download, Install and Configure

	echo
	read -p "Now I will download packages, install and configure winehq-staging. Is it ok to proceed ? (Y/N)" yn

	case $yn in

		Y|y )  apt install software-properties-common; cd /tmp; wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bullseye/winehq-bullseye.sources;  apt install --install-recommends winehq-staging; apt install wine64 wine64-preloader wine32-preloader:i386; apt purge winehq-devel;;

		* ) echo; echo "Downloading, installing and configuring winehq-staging aborted !";;

	esac

	# Install Winetricks

	echo
	read -p "Should I Install winetricks for Debian ? (Y/N)" yn;

	case $yn in
	
		Y|y ) echo; echo "Installing winetricks"; apt install -y winetricks;;
	
		* ) echo; echo "Winetricks installation aborted ! Look for the respective winetricks of your Distro.";;
	
	esac

	# Install Lutris

	echo
	read -p "Should I install Lutris ? (Y/N)" yn

	case $yn in

		Y|y )  echo "deb https://download.opensuse.org/repositories/home:/strycore/Debian_11/ ./" |  tee /etc/apt/sources.list.d/lutris.list; wget -q https://download.opensuse.org/repositories/home:/strycore/Debian_11/Release.key -O- |  tee /etc/apt/trusted.gpg.d/lutris.asc;  apt update;  apt install lutris;;

		* ) echo; echo "Lutris installation aborted !";;

	esac

	# Install Origin

	echo
	read -p "Should I Download Origin installation file ? (Y/N)" yn;

	case $yn in

		Y|y ) echo "Downloading Origin file"; cd /home/$CURRENT_USER/Games; wget https://download.dm.origin.com/origin/live/OriginThinSetup.exe; printf "In /home/%s/Games is the installation file of Origin.\n" $CURRENT_USER ; echo "Use it in Lutris setup.";;

		* ) echo; echo "Origin file download aborted !";;

	esac

	apt-get autoremove
	apt-get update
	apt-get upgrade
	
esac

echo
echo "Choose HQ Staging in Wine Configurations in Lutris and use"
echo "OriginThinSetup.exe to install Origin. If you downloaded it, look in the folder"
echo "/home/$CURRENT_USER/Games."
echo
echo "After updating Origin to EA App, configure Origin in Lutris to start"
echo "EADesktop.exe in folder:"
echo "/home/$CURRENT_USER/Games/origin/drive_c/Program Files/Electronic Arts."
echo
echo "Otherwise, you won't be able to play formerly Origin Games."
echo
echo "This option is in the side of the button play Origin, below, in Configuration."
echo "Look for the path and name of the executable, which is set to Origin.exe."
echo "Must be the path and file of EADesktop.exe."
echo
echo "Have Fun !"
echo

}

clear

echo "This script was developed in Debian 11 - Bullseye (Kernel 5.10.0-23) - 07/08/23"
echo "It may work in other versions of Debian and possibly Ubuntu as well (need tests)"
echo
echo "The script was developed in a 64 bit processor."
echo
echo "The difference relies on the VCRuntime of Windows, that is one for 64 bits and"
echo "another for 32 bits. If you plan to install it, the VCRuntime should be"
echo "downloaded from Microsoft and installed on an Windows OS, as Hiren's boot CD,"
echo "for instance. Burn it into a USB stick. Later, it should be copied into:"
printf "\home\%s\Games\origin\windows\system32\n" $CURRENT_USER
echo

read -p "Ready to start playing Lutris with WineHQ-Staging ? (Y/N)" yn

case $yn in

Y|y )

echo "Please enter your root password for [su]..."; su root -c bash -c "$(declare -f StartProcedures); StartProcedures";;

* ) echo "Maybe another time...";;

esac

if [[ $(type -t StartProcedures) == function ]]; then
unset -f StartProcedures
fi

exit
Last edited by andrethiagolanzer on 2023-07-15 20:33, edited 2 times in total.

User avatar
sunrat
Administrator
Administrator
Posts: 6511
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 119 times
Been thanked: 489 times

Re: [Bash] Development of a Script to Install Lutris with winehq-staging to run Origin Games in Debian Bullseye

#3 Post by sunrat »

Please edit your post to use code tags for code.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!


Post Reply