Class: Factorix::Runtime::Windows

Inherits:
Base
  • Object
show all
Defined in:
lib/factorix/runtime/windows.rb

Overview

Windows runtime environment

This implementation uses Windows environment variables (APPDATA, LOCALAPPDATA) to locate Factorio directories. It assumes Factorio is installed via Steam. For other installation methods (GOG, itch.io, standalone), users should configure the installation path in the Factorix configuration file.

Direct Known Subclasses

WSL

Defined Under Namespace

Classes: WindowsPath

Instance Method Summary collapse

Methods inherited from Base

#current_log_path, #factorix_cache_dir, #factorix_config_path, #factorix_log_path, inherited, #launch, #lock_path, #mod_dir, #mod_list_path, #mod_settings_path, #player_data_path, #previous_log_path, #running?, #save_dir, #script_output_dir, #xdg_cache_home_dir, #xdg_config_home_dir, #xdg_data_home_dir, #xdg_state_home_dir

Constructor Details

#initialize(path: WindowsPath.new) ⇒ Windows

Initialize Windows runtime environment

Parameters:

  • path (WindowsPath) (defaults to: WindowsPath.new)

    the path provider (for dependency injection)



15
16
17
18
# File 'lib/factorix/runtime/windows.rb', line 15

def initialize(path: WindowsPath.new)
  super()
  @path = path
end

Instance Method Details

#data_dirPathname

Get the Factorio data directory path

This directory contains the base game data and built-in expansion MODs.

Returns:

  • (Pathname)

    the Factorio data directory



37
# File 'lib/factorix/runtime/windows.rb', line 37

def data_dir = path.program_files_x86.join("Steam/steamapps/common/Factorio/data")

#executable_pathPathname

Get the Factorio executable path

Returns the default Steam installation path on Windows.

Returns:

  • (Pathname)

    the Factorio executable path



25
# File 'lib/factorix/runtime/windows.rb', line 25

def executable_path = path.program_files_x86.join("Steam/steamapps/common/Factorio/bin/x64/factorio.exe")

#user_dirPathname

Get the Factorio user directory path

Returns:

  • (Pathname)

    the Factorio user directory



30
# File 'lib/factorix/runtime/windows.rb', line 30

def user_dir = path.app_data.join("Factorio")