ChrisGue
Posts: 116
Joined: Tue Feb 03, 2009 7:26 pm

add scheduled task when not logged in but without password

I use AI 19.9 corporate
I need to add a winwdows scheduler task with these settings:

run whether user is loggen on or not
do not store password...
run with highest privileges

I AI there is no option for 'do not store password...'
And when I import such task from an exml file, duri9ng installation an error occurs saying error in the xml file when creating that task.

Is there a way to solve that?
E.g. by editing the AI file

thanks, Chris
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: add scheduled task when not logged in but without password

Hello Chris,

I have checked this and can indeed confirm the option to not store the password is not currently available.

I will create a task so that this will be added in a future version of Advanced Installer.

Until then, the solution we are left with is creating the scheduled task via a custom action (e.g. a PowerShell script).

Let me know if you'd require any assistance creating this script and I will gladly assist.

After creating the script in your project, make sure the custom action has the following options:

1. "Execution Time" --> "When the system is being modified (deferred)"

2. "Execution options" --> "Run under the LocalSystem account with full privileges (no impersonation)"

Optional: uncheck "Uninstall" and "Maintenance" from under "Execution Stage Condition"

This should ensure the custom action runs elevated and that it can create the scheduled task.

Additionally, we might need to create another custom action for uninstall, so that we can remove it.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ChrisGue
Posts: 116
Joined: Tue Feb 03, 2009 7:26 pm

Re: add scheduled task when not logged in but without password

Thanks for the reply.

I already had an exe being started by the installation to add that task (by importing an xml file), which works fine, when starting manually, but not when started by the installation, (since several updates?)
And in the sandbox that is used to validate the installation for github it fails. (Took me several days to find out that the task was one problem)

I need to investigte further here on my side.
Catalin
Posts: 7845
Joined: Wed Jun 13, 2018 7:49 am

Re: add scheduled task when not logged in but without password

Hello Chris,

Sure thing!

Let me know if there is anything else I can help you with and I will gladly assist. :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”