Skip to content

feat: implement ActionSet orchestration framework and GenPatcher tool integration#242

Open
undead2146 wants to merge 12 commits into
community-outpost:developmentfrom
undead2146:feat/genpatcher
Open

feat: implement ActionSet orchestration framework and GenPatcher tool integration#242
undead2146 wants to merge 12 commits into
community-outpost:developmentfrom
undead2146:feat/genpatcher

Conversation

@undead2146
Copy link
Copy Markdown
Member

@undead2146 undead2146 commented Jan 5, 2026

This PR adds a new Tool under the tools tab that applies all the core fixes which GenPatcher applies aswell.

Greptile Summary

This PR introduces a comprehensive ActionSet orchestration framework that ports GenPatcher functionality into GenHub as a new tool. The implementation adds 36+ automated fixes for Command & Conquer Generals/Zero Hour, including registry fixes, file system operations, DirectX/VC++ redistributable installers, and game configuration optimizations.

Key Changes:

  • Added IActionSet interface and BaseActionSet abstract class for extensible fix implementation
  • Implemented ActionSetOrchestrator to manage sequential fix application with crucial fix handling
  • Created GenPatcherTool plugin with UI (GenPatcherViewModel) for fix management
  • Added 36+ individual fixes covering registry patches, system compatibility, network optimization, and game configuration
  • Integrated IHttpClientFactory for downloading patches and redistributables (now properly registered in DI)
  • Centralized constants in ActionSetConstants, RegistryConstants, ExternalUrls, and GameSettingsConstants

Architecture Strengths:

  • Clean separation between core logic (GenHub.Core) and Windows-specific implementations
  • Proper dependency injection with all services registered
  • Parallel status checks prevent UI blocking
  • Admin privilege validation before applying registry-based fixes
  • Comprehensive logging with structured log codes for troubleshooting

Critical Issues Previously Addressed:

  • IHttpClientFactory registration added to WindowsServicesModule.cs:36
  • NahimicFix process checking logic corrected
  • Most path construction and error handling issues have been addressed in previous review rounds

Remaining Concerns:

  • Several fixes have logic issues documented in previous threads that should be verified as resolved
  • Documentation in docs/features/actionsets.md contains duplicate sections
  • Some fixes like RemoveReadOnlyFix have marker file logic inconsistencies
  • Path escaping vulnerabilities exist in PowerShell command execution

Build Status:

  • ✓ No compiler warnings or errors detected
  • ✓ All dependencies properly registered
  • ✓ Follows conventional commit format in PR title

Confidence Score: 4/5

  • This PR is generally safe to merge with careful monitoring of reported issues
  • Score reflects clean build with zero warnings, proper architecture, and comprehensive functionality. However, multiple logic concerns from previous review threads remain documented (serial key handling, path construction issues, PowerShell escaping vulnerabilities, marker file inconsistencies). The core framework is solid but individual fixes need verification that previous feedback was addressed.
  • Pay close attention to EAAppRegistryFix.cs (serial key logic), OptionsINIFix.cs (resolution reporting), RemoveReadOnlyFix.cs (marker file logic), DirectXRuntimeFix.cs (argument assignment), and OneDriveFix.cs (folder merge handling)

Important Files Changed

Filename Overview
GenHub/GenHub.Core/Features/ActionSets/ActionSetOrchestrator.cs Core orchestrator for applying action sets sequentially with crucial fix handling and error recovery
GenHub/GenHub.Windows/Features/ActionSets/UI/GenPatcherViewModel.cs ViewModel for GenPatcher UI with parallel status checks, admin validation, and batch fix application
GenHub/GenHub.Windows/Features/ActionSets/Fixes/EAAppRegistryFix.cs Registry fix for EA app compatibility, serial key handling needs verification
GenHub/GenHub.Windows/Features/ActionSets/Fixes/OptionsINIFix.cs Game settings optimizer with resolution and audio fixes, has reporting logic concerns
GenHub/GenHub.Windows/Features/ActionSets/Fixes/DirectXRuntimeFix.cs DirectX runtime installer with download logic, has argument assignment issue
GenHub/GenHub.Windows/Features/ActionSets/Fixes/OneDriveFix.cs OneDrive folder redirection with symlinks, folder merge scenario needs handling
GenHub/GenHub.Windows/Features/ActionSets/Fixes/RemoveReadOnlyFix.cs PowerShell-based read-only removal, path escaping vulnerability and marker file logic issues
docs/features/actionsets.md Comprehensive documentation with duplicate sections and categorization inconsistencies

Sequence Diagram

sequenceDiagram
    participant User
    participant GenPatcherViewModel
    participant ActionSetOrchestrator
    participant IActionSet
    participant RegistryService
    participant FileSystem
    participant HttpClient

    User->>GenPatcherViewModel: Open GenPatcher Tool
    GenPatcherViewModel->>GenPatcherViewModel: Check Admin Privileges
    GenPatcherViewModel->>ActionSetOrchestrator: GetAllActionSets()
    ActionSetOrchestrator-->>GenPatcherViewModel: List of ActionSets
    
    loop For each ActionSet
        GenPatcherViewModel->>IActionSet: IsApplicableAsync(installation)
        IActionSet-->>GenPatcherViewModel: bool
        GenPatcherViewModel->>IActionSet: IsAppliedAsync(installation)
        IActionSet-->>GenPatcherViewModel: bool
    end
    
    GenPatcherViewModel-->>User: Display ActionSets with Status
    
    User->>GenPatcherViewModel: Apply All Fixes
    GenPatcherViewModel->>RegistryService: IsRunningAsAdministrator()
    alt Not Admin
        GenPatcherViewModel-->>User: Show Error (Admin Required)
    else Is Admin
        loop For each unapplied fix
            GenPatcherViewModel->>IActionSet: ApplyAsync(installation)
            
            alt Registry Fix
                IActionSet->>RegistryService: SetStringValue/SetIntValue
                RegistryService-->>IActionSet: Success/Failure
            else File System Fix
                IActionSet->>FileSystem: Copy/Move/Create Files
                FileSystem-->>IActionSet: Success/Failure
            else Download Fix
                IActionSet->>HttpClient: Download Patch
                HttpClient-->>IActionSet: Patch File
                IActionSet->>FileSystem: Extract & Install
                FileSystem-->>IActionSet: Success/Failure
            end
            
            IActionSet-->>GenPatcherViewModel: ActionSetResult
            
            alt Crucial Fix Failed
                GenPatcherViewModel-->>User: Abort & Show Error
            else Non-Crucial Fix Failed
                GenPatcherViewModel-->>User: Continue & Log Warning
            else Fix Succeeded
                GenPatcherViewModel->>IActionSet: IsAppliedAsync(installation)
                IActionSet-->>GenPatcherViewModel: bool
                GenPatcherViewModel-->>User: Show Success
            end
        end
        
        GenPatcherViewModel-->>User: Show Final Summary
    end
Loading

Context used (3)

  • Rule from dashboard - What: All compiler warnings and linter warnings across the entire codebase must be resolved before m... (source)
  • Context from dashboard - Custom context (source)
  • Context from dashboard - Use dedicated constants classes instead of hardcoding constants string, integers or variables in ser... (source)

greptile-apps[bot]

This comment was marked as resolved.

@undead2146 undead2146 force-pushed the feat/genpatcher branch 2 times, most recently from 7e78ca0 to c2e6cbd Compare January 5, 2026 10:10
@undead2146

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as outdated.

@undead2146

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

@undead2146

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

@undead2146 undead2146 force-pushed the feat/genpatcher branch 3 times, most recently from 5f39e03 to b82a6db Compare January 8, 2026 19:45
greptile-apps[bot]

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

- Refactored DirectXRuntimeFix and D3D8XDLLCheck to use core retail DLL detection (d3d8.dll, d3dx9_43.dll) instead of skippable legacy helpers.
- Enhanced StartMenuFix to search both Common and User program folders and handle naming variations (& vs and).
- Disabled redundant fixes (Patch104Fix, Patch108Fix, ZeroHourExecutableFix) as they are handled by the Downloads system.
- Refactored GenPatcherViewModel to accurately calculate summary counts based on applicable fixes only.
- Removed marker-based persistence hacks in favor of reliable system-state checks.
- Updated ExternalUrls.cs with corrected download links for DirectX and game patches.
- Improved logging and error handling across the ActionSet infrastructure.
greptile-apps[bot]

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
greptile-apps[bot]

This comment was marked as resolved.

greptile-apps[bot]

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant