This repository was archived by the owner on Jun 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStandalone_Installer.sh
More file actions
executable file
·139 lines (118 loc) · 5.1 KB
/
Standalone_Installer.sh
File metadata and controls
executable file
·139 lines (118 loc) · 5.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/bin/bash
## FusionFall Retro install script for Linux
## Authors: Wolfizen
## Contributors: Stellarspace
## Environment setup and variables.
TEMP_DIR=/tmp/FusionFall_Retro_Installer
LAUNCHER_URL='https://cdn.fusionfalluniverse.com/launcher/ULInstaller.exe'
LAUNCHER_DL_NAME="${LAUNCHER_URL##*/}"
[ -z "$WINEPREFIX" ] && export WINEPREFIX=$HOME/.wine_fusionfall
export WINEARCH=win32
export WINEDEBUG=-all
rm -rf $TEMP_DIR
mkdir -p $TEMP_DIR
cd $TEMP_DIR
## Argument parsing.
dxvk_enable=-1
while [[ "$#" -gt 0 ]]; do case "$1" in
+dxvk) dxvk_enable=1;;
-dxvk) dxvk_enable=0;;
*) echo "Unknown parameter passed: $1"; exit 1;;
esac; shift; done
## Dependency checks
echo '* Checking dependencies...'
{ command -v wine >/dev/null 2>&1; } && { wine --version | grep -q "Staging"; } && echo 'wine staging OK' || { echo >&2 "! wine-staging is required. Please install it via your distribution's package manager."; exit 1; }
{ command -v winetricks >/dev/null 2>&1; } && echo 'winetricks OK' || { echo >&2 "! winetricks is required. Please install it via your distribution's package manager."; exit 1; }
if { command -v setup_dxvk >/dev/null 2>&1; }; then
if [ $dxvk_enable = -1 ] || [ $dxvk_enable = 1 ]; then
echo 'dxvk OK'
dxvk_enable=1
else
echo 'dxvk OK, IGNORED'
fi
else
if [ $dxvk_enable = -1 ] || [ $dxvk_enable = 0 ]; then
echo 'dxvk ABSENT (optional)'
dxvk_enable=0
else
echo 'dxvk ABSENT, FORCED'
fi
fi
echo -e '**\n** Welcome to the FusionFall Retro Linux Installer!\n** Authors: Wolfizen, Stellarspace\n**'
## Check for clean Wine prefix.
if [ -e "$WINEPREFIX" ]; then
echo '! WARNING: This installer must run on a CLEAN wineprefix. A non-empty prefix was detected.'
echo ' If you want to handle this yourself, CTRL+C or type "N" at the next prompt.'
read -p "DELETE the wineprefix located at '$WINEPREFIX'? [y/N] " -n 1 -r
echo ''
if [[ $REPLY =~ ^[Yy]$ ]]; then
rm -rf $WINEPREFIX || { echo >&2 '! rm failed'; exit 1; }
echo '* wineprefix cleaned.'
else
echo '! Installation canceled.'
exit 1
fi
else
echo '* Clean wineprefix detected.'
fi
## Install libraries
echo -e '* Setting up wineprefix...\n'
wineboot --init || { echo >&2 "! wineboot failed"; exit 1; }
sleep 6 # Required to make sure wineboot finished its setup.
winetricks -q vcrun2017 || { echo >&2 '! Library 'vcrun2017' failed to install :('; exit 1; }
if [ $dxvk_enable = 1 ]; then
# d3d libraries are not needed with DXVK. In fact, I don't think they're required at all
# but I leave them in just incase.
setup_dxvk install || { echo >&2 '! Library 'dxvk' failed to install :('; exit 1; }
else
winetricks -q d3dcompiler_47 || { echo >&2 '! Library 'd3dcompiler_47' failed to install :('; exit 1; }
winetricks -q d3dx11_43 || { echo >&2 '! Library 'd3dx11_43' failed to install :('; exit 1; }
fi
## Run the installer
winetricks win7
cat <<- EOS
! ATTENTION! In order for this game to install successfully, the launcher needs to be run a single time to download extra required files.
Steps:
* At the end of the following installer, check the box to "Run FusionFall Universe".
* Log in to your FusionFall Universe account.
* Press "Play Now" in the launcher.
* The game will start, and then exit with an error. This is expected.
* Close the launcher.
EOS
echo -e '\n* Downloading FFR Installer...'
wget -nv ${LAUNCHER_URL} -O ${TEMP_DIR}/$LAUNCHER_DL_NAME
echo -e '* Running FFR Installer...\n'
wine $TEMP_DIR/$LAUNCHER_DL_NAME
read -p 'Press ENTER when you have finished the steps above, or CTRL+C to abort: '
## Fix Unity Web Player location
WEBPLAYER_SRC="$WINEPREFIX/dosdevices/c:/users/$USER/Application Data/FusionFall Universe/Games/Retro/WebPlayer"
UNITY_LIVE="$WINEPREFIX/dosdevices/c:/users/$USER/AppData/LocalLow/Unity"
echo '* Fixing Unity Web Player location...'
[ -e "$WEBPLAYER_SRC" ] || { echo >&2 '! WebPlayer directory missing. Did you follow the steps above?'; exit 1; }
rm -rf "$UNITY_LIVE"
mkdir -p "$UNITY_LIVE"
ln -s "$WEBPLAYER_SRC" "$UNITY_LIVE/WebPlayer" || { echo >&2 '! ln failed'; exit 1; }
echo -e '**\n** Installation complete!\n**'
## Export desktop file and script for running FFR
cat > $TEMP_DIR/FusionFall_Universe.desktop <<- EOS
[Desktop Entry]
Name=FusionFall Universe
Exec=env WINEPREFIX="$WINEPREFIX" /usr/bin/wine "C:\\\\Program Files\\\\FusionFall Universe\\\\UniverseLauncher.exe"
Type=Application
StartupNotify=true
Path=$WINEPREFIX/dosdevices/c:/Program Files/FusionFall Universe/
Icon=1DD3_UniverseLauncher.0
StartupWMClass=universelauncher.exe
EOS
chmod +x $TEMP_DIR/FusionFall_Universe.desktop
echo "* Desktop file written to '$TEMP_DIR/FusionFall_Universe.desktop'"
cat > $TEMP_DIR/fusionfall_universe.sh <<- EOS
#!/bin/sh
# Automaticaly generated by $0 on $(date)
cd "$WINEPREFIX/dosdevices/c:/Program Files/FusionFall Universe/"
env WINEPREFIX="$WINEPREFIX" /usr/bin/wine C:\\\\Program\\ Files\\\\FusionFall\\ Universe\\\\UniverseLauncher.exe
EOS
chmod +x $TEMP_DIR/fusionfall_universe.sh
echo "* Launch script written to '$TEMP_DIR/fusionfall_universe.sh'"
## Done!
exit 0