eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Issue with task scheduler power options

Hi,
I want to run my application during system startup. For this i placed it in startup folder. But is is not working. I think it might be issue with admin privileges. My application run in admin mode.
So i chosen "scheduled tasks" for this. Now i am able to launch my application at system logon but the problem is by default task properties set to ""start the task if the computer AC power is on" (See attachment). How to disable this option from advanced installer.

Regards,
Shiva
Attachments
Task_scheduler.jpg
Task_scheduler.jpg (83.85 KiB) Viewed 13414 times
eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Re: Issue with task scheduler power options

And also please let me know how to set multiple trigger points and how to set delay time for the scheduled task.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Issue with task scheduler power options

Hello Shiva,
I want to run my application during system startup. For this i placed it in startup folder. But is is not working. I think it might be issue with admin privileges. My application run in admin mode.
In order to achieve that you can take a look on create startup for my application thread which debates a similar subject.
So i chosen "scheduled tasks" for this. Now i am able to launch my application at system logon but the problem is by default task properties set to ""start the task if the computer AC power is on" (See attachment). How to disable this option from advanced installer.
Unfortunately, we don't have a predefined support for this. Also, if you try the above approach then you don't have to do a Schedule Task.

Let us know if that helped otherwise give us more details.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Re: Issue with task scheduler power options

Hi Dan,
In order to achieve that you can take a look on create startup for my application thread which debates a similar subject.
I tried both the ways already so i switched to task scheduler. As my application runs as a administrator, placing in the startup folder is not working. You please try to create a shortcut in startup folder and set check box of "Run as administrator" and test it. It is not working. Using registry also.

Regards,
Shiva
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Issue with task scheduler power options

Hello,

First of all I apologize because I wasn't aware of your “Run as admin” specific scenario.
Unfortunately, we don't have predefined support for this, to change the “start the task only if the computer is on AC power” option from a schedule task. Also, I have added this improvement on our TODO list and it will be available in a future version of Advanced Installer. Thank you for your suggestion.

However, you can implement this behavior yourself from within a custom action. When a schedule task is created in the “Task Scheduler” list, it is added in the C:\Windows\System32\Tasks folder and has a .xml format. You can change the true attribute from DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> with the false attribute.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Re: Issue with task scheduler power options

UAC_Dialog.jpg
UAC_Dialog.jpg (839.32 KiB) Viewed 13378 times
Hi,
However, you can implement this behavior yourself from within a custom action. When a schedule task is created in the “Task Scheduler” list, it is added in the C:\Windows\System32\Tasks folder and has a .xml format. You can change the true attribute from DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> with the false attribute.
Thanks for suggestion. Can i have a custom action for modifying this .xml file from the installer. I need to deliver this installer to customers.

And also i want to add a custom message to "action text" on progress dialog like "Creating a system restore point" when installation progress bar starts. How can i set this?
And one more thing is after signing the msi file (doing externally) while installing this msi, it shows program name wrongly. (See the attachment). How to remove this name and show the actual msi file name here?

Regards,
Shiva
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Issue with task scheduler power options

Hi Shiva,
However, you can implement this behavior yourself from within a custom action. When a schedule task is created in the “Task Scheduler” list, it is added in the C:\Windows\System32\Tasks folder and has a .xml format. You can change the true attribute from DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries> with the false attribute.
Thanks for suggestion. Can i have a custom action for modifying this .xml file from the installer. I need to deliver this installer to customers.
Unfortunately we don't have any custom actions examples which implements this functionality. You can take a look on Task Scheduler Interfaces article and also you can find out more about DisallowStartIfOnBatteries element of the Task Scheduler schema.
And also i want to add a custom message to "action text" on progress dialog like "Creating a system restore point" when installation progress bar starts. How can i set this?
The ActionText static text on the ProgressDlg usually shows the description of the currently running action. On the Custom Actions page, select your custom action and press the "Action Text" button. Please keep in mind that Action Text can only be used with a custom action that runs with Deferred execution option.
And one more thing is after signing the msi file (doing externally) while installing this msi, it shows program name wrongly. (See the attachment). How to remove this name and show the actual msi file name here?
You can take a look on our FAQ's Why does the security prompt show a random name for my package although I specified one in Media page? article.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
eshiva
Posts: 23
Joined: Tue Jul 09, 2013 12:35 pm

Re: Issue with task scheduler power options

Hi,
I created a entry in Task scheduler using "Advanced Installer". It is working fine but when i uninstall my product installer is not removing the task scheduler entry. How to do this.

Regards,
Shiva
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Issue with task scheduler power options

Hello Shiva,

I'm not sure why you encountered this behavior.
Can you please send us the .AIP (project file) to support at advancedinstaller dot com so we can investigate it? If it contains confidential information you can send us a small test project which replicate this behavior.

Also can you please tell us the version of Advanced Installer and the Operating System you have on your machine?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Issue with task scheduler power options

Hello Shiva,
Now i am able to launch my application at system logon but the problem is by default task properties set to ""start the task if the computer AC power is on" (See attachment). How to disable this option from advanced installer.
This improvement is available starting with version 10.6 of Advanced Installer released on September 30, 2013.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”