From bee8717a43f7f029476df12c178b14e7b316104e Mon Sep 17 00:00:00 2001 From: mitchell Date: Mon, 11 Dec 2023 16:47:58 -0500 Subject: [PATCH] Use installation package for directory determination. --- internal/runners/clean/run_win.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/runners/clean/run_win.go b/internal/runners/clean/run_win.go index 0df2a1fa8b..af397f5bd4 100644 --- a/internal/runners/clean/run_win.go +++ b/internal/runners/clean/run_win.go @@ -120,7 +120,10 @@ func removeInstall(logFile string, params *UninstallParams, cfg *config.Instance // Schedule removal of the entire branch name directory. // This is because Windows often thinks the installation.InstallDirMarker and // constants.StateInstallerCmd files are still in use. - branchDir := filepath.Dir(filepath.Dir(stateExec)) + branchDir, err := installation.InstallPathFromExecPath() + if err != nil { + return errs.Wrap(err, "Could not get installation path") + } paths := []string{stateExec, branchDir} if params.All { paths = append(paths, cfg.ConfigPath()) // also remove the config directory