RUN_ONLY_IF_LOGGED_ON flag

This forum is designated to discuss SiComponents Scheduling Agent.
Post Reply
rm.ramiro
Posts: 7
Joined: Wed Apr 20, 2011 11:25 am

RUN_ONLY_IF_LOGGED_ON flag

Post by rm.ramiro »

When creating a task is marked RUN_ONLY_IF_LOGGED_ON flag from trying to clear the flag properties but to return to view the properties, this continued strong.
s.o: Windows7 development system: Delphi7.
We have seen in forums that existed in the past problems with this flag.
-----------------------------------------------------------------------------------
I'm using VistaFlags Scheduler.RunningVistaOrLater property and function to detect the operating system is running the application, but no way to uncheck RUN_ONLY_IF_LOGGED_ON flag.
Please need help with this, so far the component has been functioning very well.
Thanks.
Ramiro Hernandez
p.d: I have version 2.0.5.0 Component

rm.ramiro
Posts: 7
Joined: Wed Apr 20, 2011 11:25 am

Post by rm.ramiro »

in saTask.pas

function TTaskItem.GetVistaFlags: TTaskVistaFlags;
begin
if not FTaskManager.RunningVistaOrLater then
Exit;
if not Assigned(FTaskDefinition) then
Error(sTaskNotActivated, [Name]);
begin
Result := [];
if FTaskDefinition.Settings.AllowDemandStart then
Include(Result, tfvAllowDemandStart);
if FTaskDefinition.Settings.AllowHardTerminate then
Include(Result, tfvAllowHardTerminate);
if FTaskDefinition.Settings.DisallowStartIfOnBatteries then
Include(Result, tfvDisallowStartIfOnBatteries);
if FTaskDefinition.Settings.StopIfGoingOnBatteries then
Include(Result, tfvStopIfGoingOnBatteries);
if FTaskDefinition.Settings.Enabled then
Include(Result, tfvEnabled);
if FTaskDefinition.Settings.Hidden then
Include(Result, tfvHidden);
if FTaskDefinition.Settings.RunOnlyIfIdle then
Include(Result, tfvRunOnlyIfIdle);
if FTaskDefinition.Settings.IdleSettings.StopOnIdleEnd then
Include(Result, tfvStopOnIdleEnd);
if FTaskDefinition.Settings.IdleSettings.RestartOnIdle then
Include(Result, tfvRestartOnIdle);
if FTaskDefinition.Settings.RunOnlyIfNetworkAvailable then
Include(Result, tfvRunOnlyIfNetworkAvailable);
if FTaskDefinition.Settings.StartWhenAvailable then
Include(Result, tfvStartWhenAvailable);
if FTaskDefinition.Settings.WakeToRun then
Include(Result, tfvWakeToRun);
if FTaskDefinition.Principal.LogonType = TASK_LOGON_INTERACTIVE_TOKEN then
Include(Result, tfvNeedLogon);
end;
end;

procedure TTaskItem.SetVistaFlags(const Value: TTaskVistaFlags);
var
tf: TTaskVistaFlag;
begin
if not FTaskManager.RunningVistaOrLater then
Exit;

begin
for tf := Low(TTaskVistaFlag) to High(TTaskVistaFlag) do
begin
case tf of
tfvAllowDemandStart: FTaskDefinition.Settings.AllowDemandStart := tf in
Value;
tfvDisallowStartIfOnBatteries:
FTaskDefinition.Settings.DisallowStartIfOnBatteries := tf in Value;
tfvStopIfGoingOnBatteries:
FTaskDefinition.Settings.StopIfGoingOnBatteries := tf in Value;
tfvEnabled: FTaskDefinition.Settings.Enabled := tf in Value;
tfvHidden: FTaskDefinition.Settings.Hidden := tf in Value;
tfvRunOnlyIfIdle: FTaskDefinition.Settings.RunOnlyIfIdle := tf in Value;
tfvStopOnIdleEnd: FTaskDefinition.Settings.IdleSettings.StopOnIdleEnd :=
tf in Value;
tfvRestartOnIdle: FTaskDefinition.Settings.IdleSettings.RestartOnIdle :=
tf in Value;
tfvRunOnlyIfNetworkAvailable:
FTaskDefinition.Settings.RunOnlyIfNetworkAvailable := tf in Value;
tfvStartWhenAvailable: FTaskDefinition.Settings.StartWhenAvailable := tf
in Value;
tfvWakeToRun: FTaskDefinition.Settings.WakeToRun := tf in Value;
end;
end;
end;

end;

In procedure SetVistaFlags is not present tfvNeedLogon is that correct??
Tanks

isiticov
Site Admin
Posts: 2270
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Thank you for reporting this. We're working now under this issue.
Best regards,
Igor Sitikov.

isiticov
Site Admin
Posts: 2270
Joined: Thu Nov 21, 2002 3:17 pm

Post by isiticov »

Hello,

Just published new version should fix this issue. Thank you again for reporting this.
Best regards,
Igor Sitikov.

Post Reply