Fixed Issue 64.
authormoel.mich
Sat, 29 May 2010 13:49:20 +0000
changeset 129efb1b414d33e
parent 128 cea5477b4d72
child 130 80065ab20b84
Fixed Issue 64.
GUI/StartupManager.cs
     1.1 --- a/GUI/StartupManager.cs	Tue May 25 22:33:03 2010 +0000
     1.2 +++ b/GUI/StartupManager.cs	Sat May 29 13:49:20 2010 +0000
     1.3 @@ -75,7 +75,17 @@
     1.4            try {
     1.5              ITaskFolder folder = scheduler.GetFolder("\\Open Hardware Monitor");
     1.6              IRegisteredTask task = folder.GetTask("Startup");
     1.7 -            startup = task != null;
     1.8 +            startup = (task != null) && 
     1.9 +              (task.Definition.Triggers.Count > 0) &&
    1.10 +              (task.Definition.Triggers[1].Type == 
    1.11 +                TASK_TRIGGER_TYPE2.TASK_TRIGGER_LOGON) &&
    1.12 +              (task.Definition.Actions.Count > 0) &&
    1.13 +              (task.Definition.Actions[1].Type ==
    1.14 +                TASK_ACTION_TYPE.TASK_ACTION_EXEC) &&
    1.15 +              (task.Definition.Actions[1] as IExecAction != null) &&
    1.16 +              ((task.Definition.Actions[1] as IExecAction).Path ==
    1.17 +                Application.ExecutablePath);
    1.18 +              
    1.19            } catch (IOException) {
    1.20              startup = false;
    1.21            } catch (UnauthorizedAccessException) {