diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-09-23 21:49:41 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-09-23 21:49:41 -0400 |
| commit | 2bdb40c5d0049142a1dd3ee6c2c4307cdd51a4dc (patch) | |
| tree | ada98101c5d7000c3166b9da4f3bcc9dcb32a732 | |
| parent | 92cfcdf5c5b700dfb8507e879d481cd810006f9c (diff) | |
| download | Decky-Framegen-2bdb40c5d0049142a1dd3ee6c2c4307cdd51a4dc.tar.gz Decky-Framegen-2bdb40c5d0049142a1dd3ee6c2c4307cdd51a4dc.zip | |
feat: add optipatcher bin, fgmod plugin path, install and uninstall logic for extended spoofingv0.12.3
| -rwxr-xr-x | defaults/assets/fgmod-uninstaller.sh | 4 | ||||
| -rwxr-xr-x | defaults/assets/fgmod.sh | 9 | ||||
| -rw-r--r-- | main.py | 42 | ||||
| -rw-r--r-- | package.json | 7 |
4 files changed, 55 insertions, 7 deletions
diff --git a/defaults/assets/fgmod-uninstaller.sh b/defaults/assets/fgmod-uninstaller.sh index 1b2b854..5934da2 100755 --- a/defaults/assets/fgmod-uninstaller.sh +++ b/defaults/assets/fgmod-uninstaller.sh @@ -121,6 +121,10 @@ rm -f "amd_fidelityfx_dx12.dll" "amd_fidelityfx_framegeneration_dx12.dll" "amd_f echo "๐งน Removing frame generation mod files..." rm -f "dlssg_to_fsr3_amd_is_better.dll" "dlssg_to_fsr3.ini" "fakenvapi.ini" "nvapi64.dll" +# === Remove ASI Plugins === +echo "๐งน Removing ASI plugins directory..." +rm -rf "plugins" + # === Remove Legacy Files === echo "๐งน Removing legacy files..." rm -f "dlss-enabler.dll" "dlss-enabler-upscaler.dll" "dlss-enabler.log" diff --git a/defaults/assets/fgmod.sh b/defaults/assets/fgmod.sh index f61a70a..7cd9590 100755 --- a/defaults/assets/fgmod.sh +++ b/defaults/assets/fgmod.sh @@ -123,6 +123,15 @@ else logger -t fgmod "๐ OptiScaler.ini installed to $exe_folder_path" fi +# === ASI Plugins Directory === +if [[ -d "$fgmod_path/plugins" ]]; then + echo "๐ Installing ASI plugins directory" + cp -r "$fgmod_path/plugins" "$exe_folder_path/" || true + logger -t fgmod "๐ ASI plugins directory installed to $exe_folder_path" +else + echo "โ ๏ธ No plugins directory found in fgmod" +fi + # === Supporting Libraries === cp -f "$fgmod_path/libxess.dll" "$exe_folder_path/" || true cp -f "$fgmod_path/libxess_dx11.dll" "$exe_folder_path/" || true @@ -71,7 +71,7 @@ class Plugin: return False def _modify_optiscaler_ini(self, ini_file): - """Modify OptiScaler.ini to set FGType=nukems and Fsr4Update=true""" + """Modify OptiScaler.ini to set FGType=nukems, Fsr4Update=true, and ASI plugin settings""" try: if ini_file.exists(): with open(ini_file, 'r') as f: @@ -83,10 +83,16 @@ class Plugin: # Replace Fsr4Update=auto with Fsr4Update=true updated_content = re.sub(r'Fsr4Update\s*=\s*auto', 'Fsr4Update=true', updated_content) + # Replace LoadAsiPlugins=auto with LoadAsiPlugins=true + updated_content = re.sub(r'LoadAsiPlugins\s*=\s*auto', 'LoadAsiPlugins=true', updated_content) + + # Replace Path=auto with Path=plugins + updated_content = re.sub(r'Path\s*=\s*auto', 'Path=plugins', updated_content) + with open(ini_file, 'w') as f: f.write(updated_content) - decky.logger.info("Modified OptiScaler.ini to set FGType=nukems") + decky.logger.info("Modified OptiScaler.ini to set FGType=nukems, Fsr4Update=true, LoadAsiPlugins=true, Path=plugins") return True else: decky.logger.warning(f"OptiScaler.ini not found at {ini_file}") @@ -182,10 +188,8 @@ class Plugin: # Note: v0.9.0-pre4 includes dlssg_to_fsr3_amd_is_better.dll, fakenvapi.dll, and fakenvapi.ini in the 7z # Only copy files that aren't already in the archive or need to be updated additional_files = [ - # "dlssg_to_fsr3_amd_is_better.dll", - # "fakenvapi.ini", - # "nvapi64.dll", - "nvngx.dll" # nuvidiuh dll from streamline sdk, not bundled in opti + "nvngx.dll", # nvidia dll from streamline sdk, not bundled in opti + "OptiPatcher_v0.30.asi" # ASI plugin for OptiScaler spoofing ] decky.logger.info("Starting additional files copy") @@ -215,6 +219,25 @@ class Plugin: assets_dir = Path(decky.DECKY_PLUGIN_DIR) / "assets" self._copy_launcher_scripts(assets_dir, extract_path) + decky.logger.info("Setting up ASI plugins directory") + # Create plugins directory and copy OptiPatcher ASI file + try: + plugins_dir = extract_path / "plugins" + plugins_dir.mkdir(exist_ok=True) + decky.logger.info(f"Created plugins directory: {plugins_dir}") + + # Copy OptiPatcher ASI file to plugins directory + asi_src = bin_path / "OptiPatcher_v0.30.asi" + asi_dst = plugins_dir / "OptiPatcher.asi" # Rename to generic name + + if asi_src.exists(): + shutil.copy2(asi_src, asi_dst) + decky.logger.info(f"Copied OptiPatcher ASI to plugins directory: {asi_dst}") + else: + decky.logger.warning("OptiPatcher ASI file not found in bin directory") + except Exception as e: + decky.logger.error(f"Failed to setup ASI plugins directory: {e}") + decky.logger.info("Starting upscaler DLL overwrite check") # Optionally overwrite amd_fidelityfx_upscaler_dx12.dll with a newer static binary # Toggle via env DECKY_SKIP_UPSCALER_OVERWRITE=true to skip. @@ -341,9 +364,16 @@ class Plugin: ] if path.exists(): + # Check required files for file_name in required_files: if not path.joinpath(file_name).exists(): return {"exists": False} + + # Check plugins directory and OptiPatcher ASI + plugins_dir = path / "plugins" + if not plugins_dir.exists() or not (plugins_dir / "OptiPatcher.asi").exists(): + return {"exists": False} + return {"exists": True} else: return {"exists": False} diff --git a/package.json b/package.json index 0476dc9..ff8a998 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-framegen", - "version": "0.12.2", + "version": "0.12.3", "description": "This plugin installs and manages OptiScaler, a tool that enhances upscaling and enables frame generation in a range of DirectX 12 games.", "type": "module", "scripts": { @@ -63,6 +63,11 @@ "name": "amd_fidelityfx_upscaler_dx12.dll" }, { + "sha256hash": "c4afb71d179894ac68874d48295e101fedb0dd8e10bcec29163760465706267c", + "url": "https://github.com/optiscaler/OptiPatcher/releases/download/v0.30/OptiPatcher_v0.30.asi", + "name": "OptiPatcher_v0.30.asi" + }, + { "sha256hash": "f4c9e3d35510f2c8b14a41e47721487d3f6663b85441e1be574c45d906b95f06", "url": "https://github.com/xXJSONDeruloXx/OptiScaler-Bleeding-Edge/releases/download/OptiScaler_v0.7.8-pre0_20250816_unsigned_dll-13b2b5d0/nvapi64.dll", "name": "nvapi64.dll" |
