diff --git a/internal/runners/clean/run_win.go b/internal/runners/clean/run_win.go index 0df2a1fa8b..a2e4c53e85 100644 --- a/internal/runners/clean/run_win.go +++ b/internal/runners/clean/run_win.go @@ -13,6 +13,7 @@ import ( svcApp "github.com/ActiveState/cli/cmd/state-svc/app" "github.com/ActiveState/cli/internal/assets" "github.com/ActiveState/cli/internal/config" + "github.com/ActiveState/cli/internal/constants" "github.com/ActiveState/cli/internal/errs" "github.com/ActiveState/cli/internal/installation" "github.com/ActiveState/cli/internal/installation/storage" @@ -120,7 +121,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.InstallPathForBranch(constants.BranchName) + if err != nil { + return errs.Wrap(err, "Unable to determine branch directory to remove") + } paths := []string{stateExec, branchDir} if params.All { paths = append(paths, cfg.ConfigPath()) // also remove the config directory