summarylogtreecommitdiffstats
path: root/start-flashpoint.patch
blob: 40b4b81935b5e351a50384a74d1f4b59f6ab2528 (plain)
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
--- a/start-flashpoint.sh
+++ b/start-flashpoint.sh
@@ -1,20 +1,20 @@
-#!/usr/bin/env sh
+#!/usr/bin/env bash
 
 # This script starts Flashpoint with the correct parameters for users who can't run desktop entries.
 # Stop if shell has root privilege.
-[ `id -u` -eq 0 ] && exit 1
+[ $(id -u) -eq 0 ] && exit 1
 
-# Change to script's directory. Resolve symlinks & hyphens. Stop on fail.
-cd -P -- "`dirname "$0"`" || exit 1
-
-# Add some variables if libraries are installed.
-# TODO: Find a better way to check this.
-# (Not just checking all files individually, psycho.)
-[ -f Libraries/libgtk-3.so.0 ] && export GDK_PIXBUF_MODULE_FILE="$PWD/Libraries/loader.cache" GSETTINGS_SCHEMA_DIR="$PWD/Libraries" LD_LIBRARY_PATH="$PWD/Libraries" LIBGL_DRIVERS_PATH="$PWD/Libraries" PATH="$PWD/Libraries:$PATH"
+# Change to script's directory.
+flashpoint_directory="/opt/Flashpoint/"
+cd "$flashpoint_directory"
 
 # Set the Wine prefix, so it doesn't potentially mess with the default one.
-export WINEPREFIX="$PWD/FPSoftware/Wine"
+export WINEPREFIX="$flashpoint_directory/FPSoftware/Wine"
 
 # Run launcher. Optimize for low RAM usage without affecting stability or security.
 cd Launcher
-./flashpoint-launcher --js-flags=--lite_mode --ozone-platform-hint=auto --process-per-tab &
\ No newline at end of file
+if [[ "$(stat -c %U \/opt\/Flashpoint)" != "$USER" ]]; then
+        echo -e "WARNING: Flashpoint directory is not owned by current user! Expect issues. 
+Run \"sudo USER=\$USER chown -R \$USER $flashpoint_directory\" to correct this."
+fi
+./flashpoint-launcher --js-flags=--lite_mode --ozone-platform-hint=auto --process-per-tab &