summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-02-04 21:17:00 -0500
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-02-04 21:17:00 -0500
commit7a3d2c16d9ab11de00713961c257b62afd277282 (patch)
tree255b89e51e9d2e3f2501288b2d8b3324d07a1a6e
parent8b3e8d6df45b5dd5683c6e58cf70bb9edf2a92ed (diff)
downloadDecky-Framegen-7a3d2c16d9ab11de00713961c257b62afd277282.tar.gz
Decky-Framegen-7a3d2c16d9ab11de00713961c257b62afd277282.zip
feat: merge zip asset branch into main, Optiscaler 7 version now main standard
-rw-r--r--defaults/assets/fgmod-remover.sh3
-rwxr-xr-xdefaults/assets/fgmod.sh3
-rwxr-xr-xdefaults/assets/prepare copy.sh78
-rwxr-xr-xdefaults/assets/prepare.sh41
-rw-r--r--main.py32
-rw-r--r--package.json28
-rwxr-xr-xsrc/index.tsx27
7 files changed, 132 insertions, 80 deletions
diff --git a/defaults/assets/fgmod-remover.sh b/defaults/assets/fgmod-remover.sh
index 2d01b4b..4b3a08e 100644
--- a/defaults/assets/fgmod-remover.sh
+++ b/defaults/assets/fgmod-remover.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
+set -x # Enable debugging
+exec > >(tee -i /tmp/prepare.log) 2>&1 # Log output and errors
+
# Remove ~/fgmod directory if it exists
if [[ -d "$HOME/fgmod" ]]; then
rm -rf "$HOME/fgmod"
diff --git a/defaults/assets/fgmod.sh b/defaults/assets/fgmod.sh
index dad2a41..bc81f8c 100755
--- a/defaults/assets/fgmod.sh
+++ b/defaults/assets/fgmod.sh
@@ -1,5 +1,8 @@
#!/usr/bin/env bash
+set -x # Enable debugging
+exec > >(tee -i /tmp/prepare.log) 2>&1 # Log output and errors
+
error_exit() {
echo "$1"
if [[ -n $STEAM_ZENITY ]]; then
diff --git a/defaults/assets/prepare copy.sh b/defaults/assets/prepare copy.sh
new file mode 100755
index 0000000..888c4f3
--- /dev/null
+++ b/defaults/assets/prepare copy.sh
@@ -0,0 +1,78 @@
+#!/usr/bin/env bash
+
+set -x # Enable debugging
+exec > >(tee -i /tmp/prepare.log) 2>&1 # Log output and errors
+
+mod_path="$HOME/fgmod"
+bin_path="$(dirname "$(realpath "$0")")/../bin"
+assets_path="$(dirname "$(realpath "$0")")"
+
+nvidiaver="NVIDIA-Linux-x86_64-555.52.04.run"
+enablerver="dlss-enabler-setup-3.02.000.0.exe"
+fakenvapiver="fakenvapi.7z"
+standalone=1
+
+if [[ -d "$mod_path" ]] && [[ ! $mod_path == . ]]; then
+ rm -r "$mod_path"
+fi
+
+mkdir -p "$mod_path"
+cd "$mod_path" || exit 1
+
+# Copy required files from bin directory
+cp "$bin_path/$enablerver" .
+cp "$bin_path/$nvidiaver" .
+cp "$bin_path/d3dcompiler_47.dll" .
+cp "$bin_path/innoextract" .
+cp "$bin_path/$fakenvapiver" .
+
+# Copy fgmod.sh and fgmod-uninstaller.sh from defaults/assets
+cp "$assets_path/fgmod.sh" "$mod_path/fgmod" || exit 1
+cp "$assets_path/fgmod-uninstaller.sh" "$mod_path" || exit 1
+
+if [[ ! -f "$enablerver" || ! -f "$nvidiaver" || ! -f "d3dcompiler_47.dll" || ! -f "innoextract" || ! -f "$fakenvapiver" || ! -f "fgmod" || ! -f "fgmod-uninstaller.sh" ]]; then
+ echo "Missing one or more required files. Exiting."
+ exit 1
+fi
+
+# Extract files
+chmod +x "$nvidiaver"
+./"$nvidiaver" -x
+
+chmod +x innoextract
+./innoextract "$enablerver"
+
+# Prepare mod files
+mv app/* .
+rm -r app
+[[ -f "$(which 7z 2>/dev/null)" ]] && 7z -y x "$fakenvapiver"
+cp -f NVIDIA-Linux-x86_64-555.52.04/nvngx.dll _nvngx.dll
+cp -f NVIDIA-Linux-x86_64-555.52.04/LICENSE "licenses/LICENSE (NVIDIA driver)"
+chmod +r _nvngx.dll
+
+# Cleanup
+rm -rf innoextract NVIDIA-Linux-x86_64-555.52.04 dlss-enabler-setup-3.02.000.0.exe NVIDIA-Linux-x86_64-555.52.04.run fakenvapi.7z
+rm -rf plugins nvapi64-proxy.dll dlss-enabler-fsr.dll dlss-enabler-xess.dll dbghelp.dll version.dll winmm.dll nvngx.dll \
+ dlss-finder.exe dlss-enabler.log dlssg_to_fsr3.log fakenvapi.log "LICENSE (DLSSG to FSR3 mod).txt" \
+ "Readme (DLSS enabler).txt" "READ ME (DLSSG to FSR3 mod).txt" "XESS LICENSE.pdf"
+[[ -f "$(which nvidia-smi 2>/dev/null)" ]] && rm -rf nvapi64.dll fakenvapi.ini
+
+# Update paths in scripts
+sed -i 's|mod_path="/usr/share/fgmod"|mod_path="'"$mod_path"'"|g' fgmod
+chmod +x fgmod
+
+sed -i 's|mod_path="/usr/share/fgmod"|mod_path="'"$mod_path"'"|g' fgmod-uninstaller.sh
+chmod +x fgmod-uninstaller.sh
+
+echo ""
+
+# Flatpak compatibility
+if flatpak list | grep "com.valvesoftware.Steam" 1>/dev/null; then
+ echo "Flatpak version of Steam detected, adding access to fgmod's folder"
+ echo "Please restart Steam!"
+ flatpak override --user --filesystem="$mod_path" com.valvesoftware.Steam
+fi
+
+echo "For Steam, add this to the launch options: \"$mod_path/fgmod\" %COMMAND%"
+echo "For Heroic, add this as a new wrapper: \"$mod_path/fgmod\""
+echo "All done!" \ No newline at end of file
diff --git a/defaults/assets/prepare.sh b/defaults/assets/prepare.sh
index 888c4f3..755f8de 100755
--- a/defaults/assets/prepare.sh
+++ b/defaults/assets/prepare.sh
@@ -7,9 +7,6 @@ mod_path="$HOME/fgmod"
bin_path="$(dirname "$(realpath "$0")")/../bin"
assets_path="$(dirname "$(realpath "$0")")"
-nvidiaver="NVIDIA-Linux-x86_64-555.52.04.run"
-enablerver="dlss-enabler-setup-3.02.000.0.exe"
-fakenvapiver="fakenvapi.7z"
standalone=1
if [[ -d "$mod_path" ]] && [[ ! $mod_path == . ]]; then
@@ -19,44 +16,16 @@ fi
mkdir -p "$mod_path"
cd "$mod_path" || exit 1
-# Copy required files from bin directory
-cp "$bin_path/$enablerver" .
-cp "$bin_path/$nvidiaver" .
-cp "$bin_path/d3dcompiler_47.dll" .
-cp "$bin_path/innoextract" .
-cp "$bin_path/$fakenvapiver" .
+# Copy required files from bin directory into the current directory
+cp "$bin_path/assets.zip" .
+
+# Unzip assets.zip so that all files are in the modpath root, then remove the zip file
+unzip -j -o assets.zip && rm assets.zip
# Copy fgmod.sh and fgmod-uninstaller.sh from defaults/assets
cp "$assets_path/fgmod.sh" "$mod_path/fgmod" || exit 1
cp "$assets_path/fgmod-uninstaller.sh" "$mod_path" || exit 1
-if [[ ! -f "$enablerver" || ! -f "$nvidiaver" || ! -f "d3dcompiler_47.dll" || ! -f "innoextract" || ! -f "$fakenvapiver" || ! -f "fgmod" || ! -f "fgmod-uninstaller.sh" ]]; then
- echo "Missing one or more required files. Exiting."
- exit 1
-fi
-
-# Extract files
-chmod +x "$nvidiaver"
-./"$nvidiaver" -x
-
-chmod +x innoextract
-./innoextract "$enablerver"
-
-# Prepare mod files
-mv app/* .
-rm -r app
-[[ -f "$(which 7z 2>/dev/null)" ]] && 7z -y x "$fakenvapiver"
-cp -f NVIDIA-Linux-x86_64-555.52.04/nvngx.dll _nvngx.dll
-cp -f NVIDIA-Linux-x86_64-555.52.04/LICENSE "licenses/LICENSE (NVIDIA driver)"
-chmod +r _nvngx.dll
-
-# Cleanup
-rm -rf innoextract NVIDIA-Linux-x86_64-555.52.04 dlss-enabler-setup-3.02.000.0.exe NVIDIA-Linux-x86_64-555.52.04.run fakenvapi.7z
-rm -rf plugins nvapi64-proxy.dll dlss-enabler-fsr.dll dlss-enabler-xess.dll dbghelp.dll version.dll winmm.dll nvngx.dll \
- dlss-finder.exe dlss-enabler.log dlssg_to_fsr3.log fakenvapi.log "LICENSE (DLSSG to FSR3 mod).txt" \
- "Readme (DLSS enabler).txt" "READ ME (DLSSG to FSR3 mod).txt" "XESS LICENSE.pdf"
-[[ -f "$(which nvidia-smi 2>/dev/null)" ]] && rm -rf nvapi64.dll fakenvapi.ini
-
# Update paths in scripts
sed -i 's|mod_path="/usr/share/fgmod"|mod_path="'"$mod_path"'"|g' fgmod
chmod +x fgmod
diff --git a/main.py b/main.py
index 9ba8fa0..01b5134 100644
--- a/main.py
+++ b/main.py
@@ -86,7 +86,7 @@ class Plugin:
path = Path(decky.HOME) / "fgmod"
required_files = [
"amd_fidelityfx_dx12.dll", "dlssg_to_fsr3_amd_is_better.dll", "libxess.dll",
- "amd_fidelityfx_vk.dll", "dlssg_to_fsr3.ini", "licenses",
+ "amd_fidelityfx_vk.dll", "dlssg_to_fsr3.ini",
"d3dcompiler_47.dll", "dxgi.dll", "nvapi64.dll",
"DisableNvidiaSignatureChecks.reg", "dxvk.conf", "_nvngx.dll",
"dlss-enabler.dll", "fakenvapi.ini", "nvngx.ini",
@@ -102,7 +102,6 @@ class Plugin:
else:
return {"exists": False}
- # New method to list installed Steam games
async def list_installed_games(self) -> dict:
try:
steam_root = Path(decky.HOME) / ".steam" / "steam"
@@ -112,7 +111,7 @@ class Plugin:
return {"status": "error", "message": "libraryfolders.vdf not found"}
library_paths = []
- with open(library_file, "r", encoding="utf-8") as file:
+ with open(library_file, "r", encoding="utf-8", errors="replace") as file:
for line in file:
if '"path"' in line:
path = line.split('"path"')[1].strip().strip('"').replace("\\\\", "/")
@@ -125,16 +124,22 @@ class Plugin:
continue
for appmanifest in steamapps_path.glob("appmanifest_*.acf"):
- with open(appmanifest, "r", encoding="utf-8") as file:
- game_info = {"appid": None, "name": None}
- for line in file:
- if '"appid"' in line:
- game_info["appid"] = line.split('"appid"')[1].strip().strip('"')
- if '"name"' in line:
- game_info["name"] = line.split('"name"')[1].strip().strip('"')
-
- if game_info["appid"] and game_info["name"]:
- games.append(game_info)
+ game_info = {"appid": None, "name": None}
+
+ try:
+ with open(appmanifest, "r", encoding="utf-8") as file:
+ for line in file:
+ if '"appid"' in line:
+ game_info["appid"] = line.split('"appid"')[1].strip().strip('"')
+ if '"name"' in line:
+ game_info["name"] = line.split('"name"')[1].strip().strip('"')
+ except UnicodeDecodeError as e:
+ decky.logger.error(f"Skipping {appmanifest} due to encoding issue: {e}")
+ finally:
+ pass # Ensures loop continues even if an error occurs
+
+ if game_info["appid"] and game_info["name"]:
+ games.append(game_info)
# Filter out games whose name contains "Proton" or "Steam Linux Runtime"
filtered_games = [g for g in games if "Proton" not in g["name"] and "Steam Linux Runtime" not in g["name"]]
@@ -147,4 +152,3 @@ class Plugin:
async def log_error(self, error: str) -> None:
decky.logger.error(f"FRONTEND: {error}")
-
diff --git a/package.json b/package.json
index 0c71749..6ea3c44 100644
--- a/package.json
+++ b/package.json
@@ -49,32 +49,12 @@
]
}
},
- "remote_binary_bundling" : false,
+ "remote_binary_bundling" : true,
"remote_binary": [
{
- "name": "dlss-enabler-setup-3.02.000.0.exe",
- "url": "https://github.com/artur-graniszewski/DLSS-Enabler/releases/download/3.02.000.0/dlss-enabler-setup-3.02.000.0.exe",
- "sha256hash": "6f373a7c198ac0f7e9a6a4a5250783c265e8390059171cead5595b5a0801dc1f"
- },
- {
- "name": "NVIDIA-Linux-x86_64-555.52.04.run",
- "url": "https://download.nvidia.com/XFree86/Linux-x86_64/555.52.04/NVIDIA-Linux-x86_64-555.52.04.run",
- "sha256hash": "9d53ae6dbef32ae95786ec7d02bb944d5050c1c70516e6065ab5356626a44402"
- },
- {
- "name": "d3dcompiler_47.dll",
- "url": "https://raw.githubusercontent.com/mozilla/fxc2/9aba9b1/dll/d3dcompiler_47.dll",
- "sha256hash": "4432bbd1a390874f3f0a503d45cc48d346abc3a8c0213c289f4b615bf0ee84f3"
- },
- {
- "name": "innoextract",
- "url": "https://github.com/FakeMichau/innoextract/releases/download/6.3.0/innoextract",
- "sha256hash": "c1f2b7129709e26136e2abfad4093303103e6d55e6e20a362ca5c9d454987118"
- },
- {
- "name": "fakenvapi.7z",
- "url": "https://github.com/FakeMichau/fakenvapi/releases/download/v1.2.0/fakenvapi.7z",
- "sha256hash": "c33807e8763d7f996a59d9ca42e80fd6a170079802869a730c884779865c312b"
+ "name": "assets.zip",
+ "url": "https://github.com/xXJSONDeruloXx/Decky-Framegen/releases/download/DLSS-Enabler-3.03-trunk-Extraction/assets.zip",
+ "sha256hash": "6cbddbdc0c89d79ebba3e0afc7c21fa3a4b4366b3bf5cb18f18f2bb8cbba411b"
}
]
}
diff --git a/src/index.tsx b/src/index.tsx
index 74c43f1..47712dd 100755
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -169,7 +169,7 @@ function FGModInstallerSection() {
) : null}
<PanelSectionRow>
<div>
- Once installed, patch a games below to replace DLSS upscale and frame gen options with FSR 3 equivalents. * NON STEAM GAMES, GAMES WITH LAUNCHERS, AND DX11 OR BELOW NOT SUPPORTED.
+ Assign a back button to 'insert' keyboard key to use Optiscaler and enable FG in non FG games.
</div>
</PanelSectionRow>
</PanelSection>
@@ -247,15 +247,23 @@ function InstalledGamesSection() {
menuLabel="Installed Games"
/>
</PanelSectionRow>
+
+ {result ? (
+ <PanelSectionRow>
+ <div style={{
+ padding: '12px',
+ marginTop: '16px',
+ backgroundColor: 'var(--decky-selected-ui-bg)',
+ borderRadius: '4px'
+ }}>
+ {result}
+ </div>
+ </PanelSectionRow>
+ ) : null}
{selectedGame ? (
<>
<PanelSectionRow>
- <div style={{ fontWeight: 'bold', fontSize: '1.1em' }}>
- {selectedGame.name}
- </div>
- </PanelSectionRow>
- <PanelSectionRow>
<ButtonItem
layout="below"
onClick={handlePatchClick}
@@ -273,6 +281,7 @@ function InstalledGamesSection() {
</PanelSectionRow>
</>
) : null}
+<<<<<<< HEAD
{result ? (
<PanelSectionRow>
@@ -286,6 +295,8 @@ function InstalledGamesSection() {
</div>
</PanelSectionRow>
) : null}
+=======
+>>>>>>> zip-bundle-assets
</PanelSection>
);
}
@@ -304,4 +315,8 @@ export default definePlugin(() => ({
onDismount() {
console.log("Framegen Plugin unmounted");
},
+<<<<<<< HEAD
+}));
+=======
}));
+>>>>>>> zip-bundle-assets