Skip to content

Commit c087349

Browse files
jacderidaclaude
andcommitted
fix: use non-virtualized path for winsw.exe in launchpad
When node-launchpad is installed via MSIX on Windows, the `%APPDATA%` path is virtualized by the MSIX filesystem, redirecting file writes to a package-specific location. The service management code then cannot find `winsw.exe` at the expected standard path, causing node addition to fail with "Failed to resolve full path of the current executable". This changes `configure_winsw()` to place `winsw.exe` at `C:\ProgramData\antctl\winsw.exe` (via `get_node_manager_path()`) instead of the launchpad data directory (via `dirs_next::data_dir()`). The `C:\ProgramData` path is not subject to MSIX virtualization, so it works for both MSIX and standalone installations. Test results: - All 23 node-launchpad unit tests pass - Clippy clean with no warnings - Change is Windows-only (#[cfg(windows)]), no impact on other platforms Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 1f528cf commit c087349

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

node-launchpad/src/config.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,19 @@ pub fn get_config_dir() -> Result<PathBuf> {
9999
Ok(config_dir)
100100
}
101101

102+
/// Download and configure WinSW for Windows service management.
103+
///
104+
/// WinSW is placed at `C:\ProgramData\antctl\winsw.exe` (via `get_node_manager_path`) rather than
105+
/// the launchpad's own data directory. This is necessary because when the launchpad is installed via
106+
/// MSIX, Windows virtualizes `%APPDATA%` paths, redirecting file writes to an MSIX-specific
107+
/// location. The service management code then cannot find `winsw.exe` at the expected standard
108+
/// path. Using `C:\ProgramData\antctl` avoids this problem since it is not subject to MSIX
109+
/// filesystem virtualization.
102110
#[cfg(windows)]
103111
pub async fn configure_winsw() -> Result<()> {
104-
let data_dir_path = get_launchpad_data_dir_path()?;
112+
let winsw_path = ant_node_manager::config::get_node_manager_path()?.join("winsw.exe");
105113
ant_node_manager::helpers::configure_winsw(
106-
&data_dir_path.join("winsw.exe"),
114+
&winsw_path,
107115
ant_node_manager::VerbosityLevel::Minimal,
108116
)
109117
.await?;

0 commit comments

Comments
 (0)