Refactor InstallPageViewModel and add CLI installer#590
Refactor InstallPageViewModel and add CLI installer#590SticksDev wants to merge 8 commits intowpilibsuite:mainfrom
Conversation
|
Adding onto this, to help with review, here’s a quick overview of the larger structural changes and what each new service is responsible for.
Overall, the goal was to make the install flow easier to follow, test, and extend without re-growing the ViewModel. |
|
After some debate in Discord, we decided to split the installer into separate projects to better separate shared logic from GUI and CLI entry points and allow independent distribution. Before After
|
This PR restructures the installer to reduce complexity and improve maintainability, and introduces a new CLI-based installer.
The previously large
InstallPageViewModel(1,112 lines) has been split into focused service classes responsible for archive extraction, tool setup, VS Code installation, and shortcut creation. These services are registered via DI and shared across entry points, resulting in clearer separation of concerns and improved testability.A new CLI installer has been added that reuses the same services as the GUI. It supports multiple installation modes via
--install-mode:The CLI also supports offline VS Code installation. If a download fails, it automatically searches for a local VS Code archive and continues with a warning if the hash does not match.
Additional improvements include:
IProgress<InstallProgress>--helpdocumentation with usage examplesOverall, this change makes the installer easier to understand, test, and extend, while enabling scripted and offline installations through the new CLI.