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