-
Notifications
You must be signed in to change notification settings - Fork 5
/
Maliks_Roblox_Wrapper.sh
executable file
·479 lines (386 loc) · 16.5 KB
/
Maliks_Roblox_Wrapper.sh
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
#!/bin/bash
#text colours
Green='\033[1;32m'
Red='\033[1;31m'
Yellow='\033[1;33m'
Blue='\033[1;34m'
Reset='\033[m'
# check if cpu supports avx
if ! lscpu | grep avx > /dev/null;
then
echo -e "${Red} Warning: Your CPU does not support AVX it may not work with Roblox. Press return to continue.${Reset}"
read -p " "
fi
# check glibc is 2.31 or newer
if ldd --version | grep "2\\.30]\|2\\.2" > /dev/null;
then
echo -e "${Red} Error: Your system is unsupported. Please update to glibc 2.31 or greater. Press return to continue.${Reset}"
read -p " "
exit
fi
# function to try to download files
downloader()
{
DL_NAME=$1
DL_PATH=$2
DL_URL=$3
DL_MD5=$4
for i in {1..5}
do
if [ $i == 5 ]; # tried 5 times now give up!
then
echo "error: failed to download $DL_NAME now aboting"
exit
fi
if [ ! -f $DL_PATH ];
then
wget --no-check-certificate $DL_URL -O $DL_PATH
fi
if md5sum $DL_PATH | grep -i $DL_MD5 > /dev/null;
then
cd
tar -xf $DL_PATH -C "$HOME/.wine-roblox-malik"
break
else
rm $DL_PATH
fi
done
}
#################################################################################
######################## FULL_SETUP #####################################
#################################################################################
full_setup ()
{
# install "lib32-gnutls" if missing.
if [ $distro_guess = "Arch" ] && ! $distro_check lib32-gnutls > /dev/null ;
then
sudo $distro_install lib32-gnutls;
fi
# install "lib32-alsa-plugins" if missing.
if [ $distro_guess = "Arch" ] && ! $distro_check lib32-alsa-plugins > /dev/null ;
then
sudo $distro_install lib32-alsa-plugins;
fi
# install "lib32-libpulse" if missing.
if [ $distro_guess = "Arch" ] && ! $distro_check lib32-libpulse > /dev/null ;
then
sudo $distro_install lib32-libpulse;
fi
# install "lib32-openal" if missing.
if [ $distro_guess = "Arch" ] && ! $distro_check lib32-openal > /dev/null ;
then
sudo $distro_install lib32-openal;
fi
# install "xdg-utils" if missing.
if ! $distro_check xdg-utils > /dev/null ;
then
sudo $distro_install xdg-utils;
fi
# install "git" if missing.
if ! $distro_check git > /dev/null ;
then
sudo $distro_install git;
fi
# install "wine" if missing.
if ! $distro_check wine > /dev/null ;
then
sudo $distro_install wine;
fi
# install "wget" if missing.
if ! $distro_check wget > /dev/null ;
then
sudo $distro_install wget;
fi
# install "unzip" if missing.
if ! $distro_check unzip > /dev/null ;
then
sudo $distro_install unzip;
fi
# install "unzip" if missing.
if ! $distro_check zenity > /dev/null ;
then
sudo $distro_install zenity;
fi
# remove any other roblox launchers.
if [ -f "$HOME/.config/mimeapps.list" ];
then
sed -i '/roblox/d' "$HOME/.config/mimeapps.list"
fi
# remove any other roblox launchers for flatpaks. and install.
if [ -f "$HOME/.local/share/applications/mimeinfo.cache" ];
then
chmod 777 "$HOME/.local/share/applications/mimeinfo.cache"
sed -i '/roblox/d' "$HOME/.local/share/applications/mimeinfo.cache"
echo -e "x-scheme-handler/roblox-player=roblox-malik.desktop" >> "$HOME/.local/share/applications/mimeinfo.cache"
else
echo -e "[MIME Cache]\nx-scheme-handler/roblox-player=roblox-malik.desktop" > "$HOME/.local/share/applications/mimeinfo.cache"
fi
#make the file read only
chmod 444 "$HOME/.local/share/applications/mimeinfo.cache"
# add my roblox launcher to xdg list.
xdg-mime default "roblox-malik.desktop" x-scheme-handler/roblox-player
# make custom directory if missing
if [ ! -d "$HOME/.wine-roblox-malik" ];
then
cd "$HOME/"
mkdir .wine-roblox-malik
fi
# set custom directory as default for wine to use
export WINEPREFIX="$HOME/.wine-roblox-malik"
export WINEDEBUG=-all
# download and extract custom wine if needed.
if [ ! -d "$HOME/.wine-roblox-malik/$WINE_NAME" ];
then
downloader $WINE_NAME "$HOME/.wine-roblox-malik/$WINE_NAME.tar.xz" $WINE_URL $WINE_MD5
fi
# Download and Install Roblox if missing.
if [ ! -f "$HOME/.wine-roblox-malik/RobloxPlayerLauncher.exe" ];
then
#first lets block edge webview2 install
mkdir -p "$HOME/.wine-roblox-malik/drive_c/Program Files (x86)/Microsoft"
chmod 000 "$HOME/.wine-roblox-malik/drive_c/Program Files (x86)/Microsoft"
#download and install roblox player
wget -O "$HOME/.wine-roblox-malik/RobloxPlayerLauncher.exe" https://setup.rbxcdn.com/RobloxPlayerLauncher.exe
$WINE_RUN "$HOME/.wine-roblox-malik/RobloxPlayerLauncher.exe"
clear
echo -e "${Yellow}When setup has completed, press return to key to continue.${Reset}"
read -p " "
if [ ! -d "$HOME/.wine-roblox-malik/drive_c/Program Files (x86)/Roblox" ];
then
clear
echo -e "${Red}Error setup failed to install Roblox please uninstall and install again!${Reset}"
main_menu
fi
find $(xdg-user-dir DESKTOP) -name "*Roblox*" -not -name "*Malik*" -name "*.lnk" -delete
wget https://i.postimg.cc/63pLwnmf/Roblox-Player-Launcher.png -O "$HOME/.wine-roblox-malik/Roblox-Player-Launcher.png"
wget https://i.postimg.cc/d1NR0DMP/Roblox-Studio-Beta.png -O "$HOME/.wine-roblox-malik/Roblox-Studio-Beta.png"
echo " "
fi
# make desktop entry for roblox player.
desktop="$HOME/.local/share/applications/roblox-malik.desktop"
echo -e "[Desktop Entry]\nVersion=1.0\nName=roblox-player-malik\nExec=bash -c \" find \\\"$(xdg-user-dir DESKTOP)\\\" -name \\\"*Roblox*\\\" -not -name \\\"*Malik*\\\" -name \\\"*.lnk\\\" -delete && find \\\"$(xdg-user-dir DESKTOP)\\\" -name \\\"*Roblox*\\\" -not -name \\\"*Malik*\\\" -name \\\"*.desktop\\\" -delete && cd \\\"\$(find \\\"$HOME/.wine-roblox-malik/drive_c\\\" -name 'RobloxPlayerBeta.exe' -not -path '*/Temp/*' -exec dirname {} ';' )\\\" && cp -r \\\"$HOME/.wine-roblox-malik/ClientSettings\\\" \\\"./\\\" && export MESA_GL_VERSION_OVERRIDE=\\\"4.4\\\" && export WINEPREFIX=\\\"$HOME/.wine-roblox-malik\\\" && export WINEESYNC=1 && export WINEFSYNC=1 && \\\"$WINE_RUN\\\" \\\"./RobloxPlayerLauncher.exe\\\" %U \"\nType=Application\nIcon=$HOME/.wine-roblox-malik/Roblox-Player-Launcher.png\nTerminal=false\n" > "$desktop"
chmod +x "$desktop"
# make desktop app loader for users who cant load games through the website.
# echo -e "[Desktop Entry]\nVersion=1.0\nName=Roblox App Malik\nExec=bash -c \" find \\\"$(xdg-user-dir DESKTOP)\\\" -name \\\"*Roblox*\\\" -not -name \\\"*Malik*\\\" -name \\\"*.desktop\\\" -name \\\"*.lnk\\\" -delete && cp -r \\\"$HOME/.wine-roblox-malik/ClientSettings\\\" \\\"\$(find \\\"$HOME/.wine-roblox-malik/drive_c\\\" -name 'RobloxPlayerLauncher.exe' -not -path '*/Temp/*' -exec dirname {} ';' )\\\" && export MESA_GL_VERSION_OVERRIDE=\\\"4.4\\\" && export WINEPREFIX=\\\"$HOME/.wine-roblox-malik\\\" && export WINEESYNC=1 && export WINEFSYNC=1 && \\\"$WINE_RUN\\\" \\\"\$(find \\\"$HOME/.wine-roblox-malik/drive_c\\\" -name 'RobloxPlayerLauncher.exe' -not -path '*/Temp/*')\\\" -app \"\nType=Application\nIcon=$HOME/.wine-roblox-malik/Roblox-Player-Launcher.png\nTerminal=false\n" > "$(xdg-user-dir DESKTOP)/Roblox App Malik.desktop"
# chmod +x "$(xdg-user-dir DESKTOP)/Roblox App Malik.desktop"
#set and update fflag settings
PS3="Please select Graphics API (OpenGL Recommended):"
APIs=("Vulkan" "OpenGL" "DirectX11")
select fav in "${APIs[@]}"; do
case $fav in
"Vulkan")
api="{\"FFlagDebugGraphicsPreferVulkan\": true"
break
;;
"OpenGL")
api="{\"FFlagDebugGraphicsPreferOpenGL\": true"
break
;;
"DirectX11")
api="{\"FFlagDebugGraphicsPreferD3D11\": true"
break
;;
*) echo -e "${Red}Invalid selection $REPLY. Valid selections are 1, 2 and 3.${Reset}";;
esac
done
echo ""
read -p "Do you want boost FPS (y/n)?"
if [[ $REPLY =~ ^[Yy]$ ]]
then
api="$api, \"FFlagGraphicsGLTextureReduction\": true"
fi
echo ""
read -p "Do you want to unlock FPS (y/n)?"
if [[ $REPLY =~ ^[Yy]$ ]]
then
api="$api, \"DFIntTaskSchedulerTargetFps\": 300"
fi
if [ ! -d "$HOME/.wine-roblox-malik/ClientSettings" ]; then mkdir "$HOME/.wine-roblox-malik/ClientSettings"; fi
echo -e "$api}" > "$HOME/.wine-roblox-malik/ClientSettings/ClientAppSettings.json"
wineserver -k
# Install or uninstall DXVK
if [ $REPLY == "3" ] || [ $REPLY == "4" ];
then
DXVK="dxvk-1.10.3"
if [ -f "$HOME/.wine-roblox-malik/dosdevices/c:/windows/syswow64/d3d11.dll.old" ];
then
read -p "Do you want to uninstall DXVK (y/n)?"
if [[ $REPLY =~ ^[Yy]$ ]]
then
if [ ! -f "$HOME/.wine-roblox-malik/$DXVK/setup_dxvk.sh" ];
then
downloader $DXVK "$HOME/.wine-roblox-malik/$DXVK.tar.gz" "https://github.com/doitsujin/dxvk/releases/download/v1.10.3/dxvk-1.10.3.tar.gz" 1c07b9d70ecc5df6c3ba9d13efaa351e
fi
bash "$HOME/.wine-roblox-malik/$DXVK/setup_dxvk.sh" uninstall
else
echo "Skipping DXVK!"
fi
else
read -p "Do you want to install DXVK (y/n)?"
if [[ $REPLY =~ ^[Yy]$ ]]
then
if [ ! -f "$HOME/.wine-roblox-malik/$DXVK/setup_dxvk.sh" ];
then
downloader $DXVK "$HOME/.wine-roblox-malik/$DXVK.tar.gz" "https://github.com/doitsujin/dxvk/releases/download/v1.10.3/dxvk-1.10.3.tar.gz" 1c07b9d70ecc5df6c3ba9d13efaa351e
fi
bash "$HOME/.wine-roblox-malik/$DXVK/setup_dxvk.sh" install
else
echo "Skipping DXVK!"
fi
fi
fi
clear
# let user know their system has just been pimped :)
echo -e "${Green}Setup complete. Launch a game from the website then you will be logged into the app.${Reset}"
main_menu
}
#################################################################################
######################## MAIN MENU ######################################
#################################################################################
main_menu()
{
echo " "
which apt >/dev/null 2>&1
if [ $? -eq 0 ]
then
distro_guess="Debian"
distro_check="dpkg -l"
distro_install="apt install"
fi
which yum >/dev/null 2>&1
if [ $? -eq 0 ]
then
distro_guess="Fedora"
distro_check="rpm -q"
distro_install="yum install"
fi
which zypper >/dev/null 2>&1
if [ $? -eq 0 ]
then
distro_guess="OpenSUSE"
distro_check="zypper search -i"
distro_install="zypper install"
fi
if [ ! $distro_guess ]
then
which pacman >/dev/null 2>&1
if [ $? -eq 0 ]
then
distro_guess="Arch"
distro_check="pacman -Qs"
distro_install="pacman -S"
fi
fi
if test -z $distro_guess;
then
echo "${Red}This Linux distro is not supported sorry. Now aborting.${Reset}"
exit
fi
WINE_NAME="lutris-GE-Proton8-26-x86_64"
WINE_URL="https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton8-26/wine-lutris-GE-Proton8-26-x86_64.tar.xz"
WINE_MD5="309fb4d79e6467719345c293c8aa482c"
WINE_RUN="$HOME/.wine-roblox-malik/$WINE_NAME/bin/wine"
STUDIO_WINE_NAME="lutris-GE-Proton8-26-x86_64"
STUDIO_WINE_URL="https://github.com/GloriousEggroll/wine-ge-custom/releases/download/GE-Proton8-26/wine-lutris-GE-Proton8-26-x86_64.tar.xz"
STUDIO_WINE_MD5="309fb4d79e6467719345c293c8aa482c"
STUDIO_WINE_RUN="$HOME/.wine-roblox-malik/$STUDIO_WINE_NAME/bin/wine"
PS3='Please make a selection:'
distros=( "$(tput bold setaf 4)Install Roblox$(tput sgr0)" "$(tput bold setaf 4)Install Roblox Studio$(tput sgr0)" "$(tput bold setaf 4)Uninstall Roblox$(tput sgr0)" "$(tput bold setaf 4)Exit$(tput sgr0)")
select fav in "${distros[@]}"; do
case $fav in
#################################################################################
######################## Install Roblox #############################
#################################################################################
"$(tput bold setaf 4)Install Roblox$(tput sgr0)")
full_setup
clear
echo -e "${Green}Setup complete.${Reset}"
main_menu
;;
#################################################################################
######################## Install Roblox Studio ######################
#################################################################################
"$(tput bold setaf 4)Install Roblox Studio$(tput sgr0)")
#check if Roblox installed
if [ ! -f "$HOME/.wine-roblox-malik/drive_c/Program Files (x86)/Roblox/Versions/RobloxStudioLauncherBeta.exe" ];
then
clear
echo -e "${Red}Roblox installation missing install Roblox first! ${Reset}"
main_menu
fi
# download and extract custom wine if needed.
if [ ! -d "$HOME/.wine-roblox-malik/$STUDIO_WINE_NAME" ];
then
downloader $STUDIO_WINE_NAME "$HOME/.wine-roblox-malik/$STUDIO_WINE_NAME.tar.xz" $STUDIO_WINE_URL $STUDIO_WINE_MD5
fi
# add my roblox studio launcher to xdg list.
xdg-mime default "roblox-studio-malik.desktop" x-scheme-handler/roblox-studio
xdg-mime default "roblox-studio-auth-malik.desktop" x-scheme-handler/roblox-studio-auth
xdg-mime default "roblox-studio-malik.desktop" application/x-roblox-rbxl
xdg-mime default "roblox-studio-malik.desktop" application/x-roblox-rbxlx
#create studio and studio auth desktop files for xdg-open
echo -e "[Desktop Entry]\nVersion=1.0\nName=roblox-studio-malik\nExec=bash -c \"find \\\"$(xdg-user-dir DESKTOP)\\\" -name \\\"*Roblox*\\\" -not -name \\\"*Malik*\\\" -delete && export WINEPREFIX=\\\"$HOME/.wine-roblox-malik\\\" && export WINEESYNC=1 && export WINEFSYNC=1 && \\\"$STUDIO_WINE_RUN\\\" \\\"\$(find \\\"$HOME/.wine-roblox-malik/drive_c\\\" -name 'RobloxStudioLauncherBeta.exe' -not -path '*/Temp/*')\\\" %U\"\nIcon=$HOME/.wine-roblox-malik/Roblox-Studio-Beta.png\nMimeType=x-scheme-handler/roblox-studio;application/x-roblox-rbxl;application/x-roblox-rbxlx\nType=Application\nTerminal=false\n" > "$HOME/.local/share/applications/roblox-studio-malik.desktop"
chmod +x "$HOME/.local/share/applications/roblox-studio-malik.desktop"
echo -e "[Desktop Entry]\nVersion=1.0\nName=roblox-studio-auth-malik\nExec=bash -c \"export WINEPREFIX=\\\"$HOME/.wine-roblox-malik\\\" && export WINEESYNC=1 && export WINEFSYNC=1 && \\\"$STUDIO_WINE_RUN\\\" \\\"\$(find \\\"$HOME/.wine-roblox-malik/drive_c\\\" -name 'RobloxStudioBeta.exe' -not -path '*/Temp/*')\\\" %U\"\nIcon=$HOME/.wine-roblox-malik/Roblox-Studio-Beta.png\nMimeType=x-scheme-handler/roblox-studio-auth;application/x-roblox-rbxl;application/x-roblox-rbxlx\nType=Application\nTerminal=false\n" > "$HOME/.local/share/applications/roblox-studio-auth-malik.desktop"
chmod +x "$HOME/.local/share/applications/roblox-studio-auth-malik.desktop"
#install studio
WINEPREFIX="$HOME/.wine-roblox-malik" WINEDEBUG=-all WINEESYNC=1 WINEFSYNC=1 $STUDIO_WINE_RUN "$HOME/.wine-roblox-malik/drive_c/Program Files (x86)/Roblox/Versions/RobloxStudioLauncherBeta.exe"
find $(xdg-user-dir DESKTOP) -name "*Roblox*" -not -name "*Malik*" -name "*.lnk" -delete
echo -e "[Desktop Entry]\nVersion=1.0\nName=Roblox Studio Malik\nExec=bash -c \" zenity --info --text=\\\"Login to Roblox Player App for Studio to work!\\\" && export WINEPREFIX=\\\"$HOME/.wine-roblox-malik\\\" && export WINEESYNC=1 && export WINEFSYNC=1 && \\\"$STUDIO_WINE_RUN\\\" \\\"\$(find \\\"$HOME/.wine-roblox-malik/drive_c\\\" -name 'RobloxStudioBeta.exe' -not -path '*/Temp/*') \\\" -ide \"\nIcon=$HOME/.wine-roblox-malik/Roblox-Studio-Beta.png\nMimeType=x-scheme-handler/roblox-studio;application/x-roblox-rbxl;application/x-roblox-rbxlx\nType=Application\n" > "$(xdg-user-dir DESKTOP)/Roblox Studio Malik.desktop"
chmod +x "$(xdg-user-dir DESKTOP)/Roblox Studio Malik.desktop"
clear
echo -e "${Green}Roblox Studio setup complete. Make sure the app in logged in before running Studio.${Reset}"
main_menu
;;
#################################################################################
######################## Uninstall Roblox ###########################
#################################################################################
"$(tput bold setaf 4)Uninstall Roblox$(tput sgr0)")
find "$(xdg-user-dir DESKTOP)" -name "*Roblox*" -name "*.lnk" -delete
find "$(xdg-user-dir DESKTOP)" -name "*Roblox*" -name "*.desktop" -delete
if [ -f "$HOME/.local/share/applications/mimeinfo.cache" ];
then
rm -rf "$HOME/.local/share/applications/mimeinfo.cache"
fi
if [ -d "$HOME/.wine-roblox-malik" ];
then
rm -rf "$HOME/.wine-roblox-malik"
fi
if [ -f "$HOME/.local/share/applications/roblox-malik.desktop" ];
then
rm "$HOME/.local/share/applications/roblox-malik.desktop"
fi
if [ -f "$HOME/.local/share/applications/roblox-studio-malik.desktop" ];
then
rm "$HOME/.local/share/applications/roblox-studio-malik.desktop"
fi
if [ -f "$HOME/.local/share/applications/roblox-studio-auth-malik.desktop" ];
then
rm "$HOME/.local/share/applications/roblox-studio-auth-malik.desktop"
fi
if [ -f "$HOME/Desktop/Roblox Studio Malik.desktop" ];
then
rm "$HOME/Desktop/Roblox Studio Malik.desktop"
fi
if [ -f "$HOME/Desktop/Roblox App Malik.desktop" ];
then
rm "$HOME/Desktop/Roblox App Malik.desktop"
fi
if [ -f "$HOME/.config/mimeapps.list" ];
then
sed -i '/roblox/d' "$HOME/.config/mimeapps.list"
fi
clear
echo -e "${Green}Uninstall complete.${Reset}"
main_menu
#exit
;;
"$(tput bold setaf 4)Exit$(tput sgr0)")
exit
;;
*) echo -e "${Red}Invalid selection $REPLY. Valid selections are 1,2.3 and 4.${Reset}";;
esac
done
#exit
}
main_menu