Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows: Remove an existing task as part of fixDaemonTaskInstalled
This patch should resolve following flow - User installed crc-2.1.0 version and during setup task installed with version 2.1.0 - New version 2.2.0 arrive and user try to do setup then it fails with following error ``` DEBU expected crcDaemon task to be on version '2.1.0' but got '2.0.1 ' INFO Installing the daemon task failed to register crcDaemon task, exit status 1: Register-ScheduledTask : Cannot create a file when that file already exists. At line:1 char:43 + ... yContinue'; Register-ScheduledTask -Xml '<?xml version="1.0" encoding ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceExists: (PS_ScheduledTask:Root/Microsoft/...S_ScheduledTask) [Register-ScheduledTask], CimException + FullyQualifiedErrorId : HRESULT 0x800700b7,Register-ScheduledTask ``` This patch make sure if the older version is running and matches with errOlderVersion then remove the existing task.
- Loading branch information