From e0acdc90a70947bb37e56867f3abbad41cbd2e12 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Tue, 24 May 2022 09:34:07 -0500 Subject: [PATCH] Improved win32 auto importer by switching to using InstallDir key instead of InstallPath since InstallPath isn't updated when importing moved games --- lib/application_manager.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/application_manager.rb b/lib/application_manager.rb index 7416196..b81c697 100644 --- a/lib/application_manager.rb +++ b/lib/application_manager.rb @@ -243,15 +243,17 @@ class W3DHub begin reg_constant.open(registry_path, reg_type) do |reg| - if (install_path = reg["InstallPath"]) - if File.exist?(install_path) || (app_id == "ecw" && File.exist?("#{File.dirname(install_path)}/game750.exe")) + if (install_path = reg["InstallDir"]) + exe_path = app_id == "ecw" ? "#{File.dirname(install_path)}/game750.exe" : "#{File.dirname(install_path)}/game.exe" + + if File.exist?(exe_path) install_path.gsub!("\\", "/") installed_version = reg["InstalledVersion"] unless app_id == "ren" application_data = { install_directory: File.dirname(install_path), installed_version: app_id == "ren" ? "1.0.0.0" : installed_version, - install_path: app_id == "ecw" ? "#{File.dirname(install_path)}/game750.exe" : install_path, + install_path: exe_path, wine_prefix: nil }