Creating a scheduled task

Adding a scheduled task to the system allows us to perform some action, such as running an executable, at a specific time each hour, day, or month. It might be to clean up old log files, check for software updates, or process a batch file. With WiX, we can add a scheduled task at the time of installation and remove it when our software is uninstalled.

In this recipe, we'll add a simple task that calls the calculator program once per day. We'll also include markup to remove the task if the installation should fail, or if the user decides to uninstall our software.

Getting ready

To prepare for this recipe, perform the following steps:

  1. Create a new setup project and call it ScheduledTaskInstaller.
  2. For an installer to succeed, ...

Get WiX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.