Write data/paths.ini file

This commit is contained in:
2024-09-11 16:54:21 -05:00
parent c9c5e18d70
commit 6736abc277
3 changed files with 26 additions and 0 deletions

View File

@@ -42,12 +42,19 @@ class W3DHub
cfg = @data[:"extended-data"].find { |h| h[:name] == "usesEngineCfg" }
@uses_engine_cfg = (cfg && cfg[:value].to_s.downcase.strip == "true") == true # explicit truthy compare to prevent return `nil`
cfg = @data[:"extended-data"].find { |h| h[:name] == "usesRenFolder" }
@uses_ren_folder = (cfg && cfg[:value].to_s.downcase.strip == "true") == true # explicit truthy compare to prevent return `nil`
end
def uses_engine_cfg?
@uses_engine_cfg
end
def uses_ren_folder?
@uses_ren_folder
end
class Channel
attr_reader :id, :name, :user_level, :current_version

View File

@@ -552,6 +552,22 @@ class W3DHub
@status.step = :install_dependencies
end
def write_paths_ini
path = Cache.install_path(@application, @channel)
File.open("#{path}/data/paths.ini", "w") do |file|
file.puts("[paths]")
file.puts("RegBase=W3D Hub")
file.puts("RegClient=#{@application.category}\\#{@application.id}-#{@channel.id}")
file.puts("RegFDS=#{@application.category}\\#{@application.id}-#{@channel.id}-server")
file.puts("FileBase=W3D Hub");
file.puts("FileClient=#{@application.category}\\#{@application.id}-#{@channel.id}")
file.puts("FileFDS=#{@application.category}\\#{@application.id}-#{@channel.id}-server")
file.puts("UseRenFolder=#{@application.uses_ren_folder?}")
end
end
def mark_application_installed
Store.application_manager.installed!(self)

View File

@@ -40,6 +40,9 @@ class W3DHub
install_dependencies
return false if failed?
write_paths_ini
return false if failed?
mark_application_installed
return false if failed?