mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 17:22:35 +00:00
Auto import any game installed by the official launcher at start up, should also pick up updated version strings now that it is run for 'installed' games.
This commit is contained in:
@@ -189,25 +189,19 @@ class W3DHub
|
|||||||
def auto_import
|
def auto_import
|
||||||
return unless W3DHub.windows?
|
return unless W3DHub.windows?
|
||||||
|
|
||||||
# Renegade
|
Store.applications.games.each do |game|
|
||||||
auto_import_win32_registry("ren", "release", 'SOFTWARE\Westwood\Renegade')
|
game.channels.each do |channel|
|
||||||
|
if game.id == "ren" && channel.id == "release"
|
||||||
# Red Alert: A Path Beyond
|
auto_import_win32_registry(game.id, channel.id, 'SOFTWARE\Westwood\Renegade')
|
||||||
auto_import_win32_registry("apb", "release")
|
else
|
||||||
|
auto_import_win32_registry(game.id, channel.id)
|
||||||
# Expansive Civilian Warfare
|
end
|
||||||
auto_import_win32_registry("ecw", "release")
|
end
|
||||||
|
end
|
||||||
# Interim Apex
|
|
||||||
auto_import_win32_registry("ia", "release")
|
|
||||||
|
|
||||||
# Tiberian Sun: Reborn
|
|
||||||
auto_import_win32_registry("tsr", "release")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def auto_import_win32_registry(app_id, channel_id, registry_path = nil)
|
def auto_import_win32_registry(app_id, channel_id, registry_path = nil)
|
||||||
return unless W3DHub.windows?
|
return unless W3DHub.windows?
|
||||||
return if installed?(app_id, channel_id)
|
|
||||||
|
|
||||||
puts "Importing: #{app_id}-#{channel_id}"
|
puts "Importing: #{app_id}-#{channel_id}"
|
||||||
|
|
||||||
@@ -239,7 +233,8 @@ class W3DHub
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
rescue => e
|
rescue => e
|
||||||
puts e.message, e.backtrace
|
# puts e.class, e.message, e.backtrace
|
||||||
|
puts " Failed to import #{app_id}-#{channel_id}" if e.is_a?(Win32::Registry::Error)
|
||||||
|
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user