Error During Installation Caused by Invalid Scheduled Task in Windows

Description

C:\ProgramData\eWay-CRM\SetupLog.txt contains the following error:

--- 2017-10-12 16:29:04,993 [1] ERROR [OL: 16.0.8431.2107] [WIN: Microsoft Windows NT 10.0.14393.0] ---
Unable to create scheduled tasks
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
  at Microsoft.Win32.TaskScheduler.V2Interop.IRegisteredTask.get_Xml()
  at Microsoft.Win32.TaskScheduler.Task.GetV2Definition(TaskService svc, IRegisteredTask iTask, Boolean throwError)
  at Microsoft.Win32.TaskScheduler.Task.CreateTask(TaskService svc, IRegisteredTask iTask, Boolean throwError)
  at Microsoft.Win32.TaskScheduler.TaskCollection.V2TaskEnumerator.get_Current()
  at Microsoft.Win32.TaskScheduler.TaskFolder.d__0.MoveNext()
  at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
  at ManagedCustomActions.TaskScheduler.CreateDatabaseMaintenanceTask()
  at ManagedCustomActions.CustomAction.CreateScheduledTasks(Session session)
--- END TRACE --- 

Versions

All versions of eWay-CRM

Difficulty

High

Resolution

The error is caused by invalid scheduled task in Windows. To find out the invalid task and delete it, please, follow these steps:

  1. Click Start in Microsoft Windows and type taskschd.msc.
  2. Press Enter Tasks Scheduler will be opened.
  3. If there is any invalid task, you will see this error dialog:

  1. As you see in the picture above, the name of the incorrect task was "WRU", but in your case it may be different. Remember the name of your incorrect task.
  2. Open Windows Registry and go to:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree
  3. Delete the incorrect task from the step 3.