mirror of
https://github.com/cyberarm/w3d_hub_linux_launcher.git
synced 2025-12-16 09:12:35 +00:00
Interim Apex can now be installed and launched (on Windows)
This commit is contained in:
@@ -5,6 +5,8 @@ class W3DHub
|
||||
language: Gosu.user_languages.first.split("_").first,
|
||||
app_install_dir: default_app_install_dir,
|
||||
package_cache_dir: default_package_cache_dir,
|
||||
wine_command: "wine",
|
||||
create_wine_prefixes: true,
|
||||
allow_diagnostic_reports: false,
|
||||
server_list_username: nil,
|
||||
account: {},
|
||||
@@ -14,45 +16,29 @@ class W3DHub
|
||||
end
|
||||
|
||||
def self.default_app_install_dir
|
||||
if windows?
|
||||
"#{home_directory}/#{W3DHub::DIR_NAME}"
|
||||
elsif linux?
|
||||
"#{home_directory}/.local/share/#{W3DHub::DIR_NAME}"
|
||||
elsif mac?
|
||||
"#{home_directory}/.local/share/#{W3DHub::DIR_NAME}"
|
||||
if W3DHub.windows?
|
||||
"#{W3DHub.home_directory}/#{W3DHub::DIR_NAME}"
|
||||
elsif W3DHub.linux?
|
||||
"#{W3DHub.home_directory}/.local/share/#{W3DHub::DIR_NAME}"
|
||||
elsif W3DHub.mac?
|
||||
"#{W3DHub.home_directory}/.local/share/#{W3DHub::DIR_NAME}"
|
||||
else
|
||||
raise "Unknown platform: #{RbConfig::CONFIG["host_os"]}"
|
||||
end
|
||||
end
|
||||
|
||||
def self.default_package_cache_dir
|
||||
if windows?
|
||||
"#{home_directory}/#{W3DHub::DIR_NAME}/Launcher/package-cache"
|
||||
elsif linux?
|
||||
"#{home_directory}/.local/share/#{W3DHub::DIR_NAME}/package-cache"
|
||||
elsif mac?
|
||||
"#{home_directory}/.local/share/#{W3DHub::DIR_NAME}/package-cache"
|
||||
if W3DHub.windows?
|
||||
"#{W3DHub.home_directory}/#{W3DHub::DIR_NAME}/Launcher/package-cache"
|
||||
elsif W3DHub.linux?
|
||||
"#{W3DHub.home_directory}/.local/share/#{W3DHub::DIR_NAME}/package-cache"
|
||||
elsif W3DHub.mac?
|
||||
"#{W3DHub.home_directory}/.local/share/#{W3DHub::DIR_NAME}/package-cache"
|
||||
else
|
||||
raise "Unknown platform: #{RbConfig::CONFIG["host_os"]}"
|
||||
end
|
||||
end
|
||||
|
||||
def self.windows?
|
||||
RbConfig::CONFIG["host_os"] =~ /(mingw|mswin|windows)/i
|
||||
end
|
||||
|
||||
def self.mac?
|
||||
RbConfig::CONFIG["host_os"] =~ /(darwin|mac os)/i
|
||||
end
|
||||
|
||||
def self.linux?
|
||||
RbConfig::CONFIG["host_os"] =~ /(linux|bsd|aix|solaris)/i
|
||||
end
|
||||
|
||||
def self.home_directory
|
||||
File.expand_path("~")
|
||||
end
|
||||
|
||||
def initialize
|
||||
unless File.exist?(SETTINGS_FILE_PATH)
|
||||
@settings = Settings.defaults
|
||||
|
||||
Reference in New Issue
Block a user