Hello Jan,
Unfortunately, our
"Scheduled Tasks" support does not support this. However, this can be achieved through a custom action (e.g. PowerShell script). Here is the little script which does that:
Code: Select all
$action = New-ScheduledTaskAction -Execute 'notepad.exe'
$trigger = New-ScheduledTaskTrigger -Once -At (Get-Date) -RepetitionInterval (New-TimeSpan -Minutes 3)
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName "TestTask" -Description "This is a test task. Its job is to start notepad every 3 minutes."
As you can see in the above script, the scheduled task will launch Notepad every 3 minutes. You may want to modify these options in order to match your needs.
Now, in order to configure this in your Advanced Installer project, please proceed as it follows:
- open your project and go to
"Custom Actions" page
- add a
"PowerShellInlineScript" with sequence. In order to do so, please press the
"Add custom action with sequence" button which is placed to the right side of the custom action's name.
- copy paste the above script under the "Your code goes here." comment.
- the custom action should be scheduled
after the
"Add resources" action group and it should be configured as it follows:
Execution time: When the system is being modified (deferred)
The rest is default. Also, you may want to only trigger the custom action during the install. To do so, untick the "Uninstall" and "Maintenance" boxes from under the "Execution Stage Condition" section.
Also, one thing too keep in mind is the fact that, in order to create and register a scheduled task,
you need elevated rights. With that being said, to avoid any unwanted behavior, please check the
"Run as administrator" option from under the
"Installation Options" section ->
"Install Parameters" page.
Also, for your reference, I have attached a sample project to this thread:
Hope this helps.
All the best,
Catalin