mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-15 16:52:34 +00:00
Fixes for linux (Interim Apex not installs and RUNS!)
This commit is contained in:
@@ -46,7 +46,7 @@ class W3DHub
|
||||
exe = "#{app_data[:install_directory]}/#{config_exe}"
|
||||
|
||||
if File.exist?(exe)
|
||||
Process.spawn("\"#{exe}\"")
|
||||
Process.spawn("#{wine_command(app_id, channel)}\"#{exe}\"")
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -86,9 +86,19 @@ class W3DHub
|
||||
end
|
||||
end
|
||||
|
||||
def wine_command(app_id, channel)
|
||||
return "" if W3DHub.windows?
|
||||
|
||||
if window.settings[:wine_prefix]
|
||||
"WINEPREFIX=\"#{window.settings[:wine_prefix]}\" \"#{window.settings[:wine_command]}\" "
|
||||
else
|
||||
"#{window.settings[:wine_command]} "
|
||||
end
|
||||
end
|
||||
|
||||
def run(app_id, channel, *args)
|
||||
if (app_data = installed?(app_id, channel))
|
||||
Process.spawn("\"#{app_data[:install_path]}\"", *args)
|
||||
Process.spawn("#{wine_command(app_id, channel)}\"#{app_data[:install_path]}\"", *args)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -98,12 +98,12 @@ class W3DHub
|
||||
# Quick checks before network and computational work starts
|
||||
def fail_fast
|
||||
# tar present?
|
||||
tar_present = system("tar --help")
|
||||
fail!("FAIL FAST: `tar --help` command failed, tar is not installed. Will be unable to unpack packages.") unless tar_present
|
||||
bsdtar_present = system("bsdtar --help")
|
||||
fail!("FAIL FAST: `bsdtar --help` command failed, bsdtar is not installed. Will be unable to unpack packages.") unless bsdtar_present
|
||||
|
||||
if W3DHub.unix?
|
||||
wine_present = system("which #{window.settings[:wine_command]}")
|
||||
fail!("FAIL FAST: `which wine` command failed, wine is not installed. Will be unable to create prefixes or launch games.") unless wine_prefix
|
||||
fail!("FAIL FAST: `which #{window.settings[:wine_command]}` command failed, wine is not installed. Will be unable to create prefixes or launch games.") unless wine_present
|
||||
end
|
||||
end
|
||||
|
||||
@@ -257,17 +257,19 @@ class W3DHub
|
||||
def unpack_packages(packages)
|
||||
path = Cache.install_path(@application, @channel)
|
||||
puts "Unpacking packages in '#{path}'..."
|
||||
Cache.create_directories(path)
|
||||
Cache.create_directories(path, true)
|
||||
|
||||
packages.each do |package|
|
||||
puts " #{package.name}:#{package.version}"
|
||||
package_path = Cache.package_path(package.category, package.subcategory, "#{package.name}.zip", package.version)
|
||||
|
||||
puts " Running tar command: #{"tar -xf #{package_path} -C #{path}"}"
|
||||
status = system("tar -xf #{package_path} -C #{path}")
|
||||
puts " Running bsdtar command: #{"bsdtar -xf #{package_path} -C #{path}"}"
|
||||
status = system("bsdtar -xf #{package_path} -C #{path}")
|
||||
if status
|
||||
else
|
||||
puts "COMMAND FAILED!"
|
||||
fail!("Failed to unpack #{package.name}")
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user