Hello Scott,
I've tested the scenario and replicated the behavior. This happens because the setup package set execute rights for the created scheduled task only for the user account you configured your setup project. Therefore any other user account will try to run the task will fail because it does not have execute rights.
To avoid this limitation you can develop your own custom action which wills set execute permissions on your created task for all admin accounts. For instnace you can proceed like this:
1. create a BAT file (e.g. taskExecuteRights.bat) with the following content:
Code: Select all
echo y|cacls "C:\Windows\System32\Tasks\<yourTaskName>" /g Administrators:F
2. add the taskExecuteRights.bat as a temporary file in "Files and Folders" page of your setup project
3. go to "Custom Actions" page and add a "Launch file" custom action with sequence scheduled as
deferred after "Install Execution Stage -> Add Resources" action group like this:
- File to launch: [&taskExecuteRights.bat]
Command line:
Working directory: [System64Folder]
Hide program's window: checked
Use 64-bit Launcher: checked
Run under the LocalSystem account with full privileges (no impersonation): checked
4. configure the custom action condition to run only on install
5. rebuild the setup project and test the scenario again
Let us know if this helped.
All the best,
Daniel