Skip to content

Disabling the startup task leaves an orphaned task.bat behind #62

Description

@potpiemuncher

Small one, from a downstream fork. Confirmed against main (cca03a1).

StartupMethods.WriteTaskEntry() writes a task.bat next to the executable and points the RunDS4Windows logon task at it. DeleteTaskEntry() removes the task but not the file:

public static void DeleteTaskEntry()
{
    TaskService ts = new TaskService();
    Task tasker = ts.FindTask("RunDS4Windows");
    if (tasker != null)
    {
        ts.RootFolder.DeleteTask("RunDS4Windows");
    }
}

So turning run-at-startup off, or switching from the task option to the shortcut option, leaves an orphaned task.bat in the install folder. Observed downstream as exactly that: task gone, shortcut gone, task.bat still present.

Harmless where it sits, but it is an executable launcher that outlives the feature the user just switched off, and it is one of the files a clean uninstall would want to account for.

Fix is a couple of lines: delete the file in DeleteTaskEntry() when it exists, tolerating failure (it may be locked or already gone — this runs on the disable path and must not throw).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions