Since windows 2000 does not have the schtasks.exe tool, I'm forced to use alternative methods. No, I do NOT want to use the AT command, since then it wouldn't visable to the user. I'm trying to use the CreateTask stuff which is found in the System plugin. Seems though when the installer is in the portion of the script were it creates the scheduled task, the whole installer crashes. This is all I get in the eventlog:
The application, , generated an application error The error occurred on 07/23/2006 @ 00:05:47.237 The exception generated was c0000005 at address 01141519 (Store)I know it has something to do with the system plugin and the scheduled task, but not sure what I'm doing wrong. I can see the scheduled task does get created... but the entire installer crashes, so doesn't do me any good.
Here is what I've got going:
;Create scheduled task
${If} $OS != 'Windows2000'
ExecDos::exec /NOUNLOAD /TIMEOUT=2000 '"$SYSDIR\schtasks.exe" /create /RU SYSTEM /SC MINUTE /MO 5 /TN Cacti /TR "php $INSTDIR\inetpub\wwwroot\cacti\poller.php" /ST 01:00:00' "" "$INSTDIR\Inetpub\wwwroot\cacti\log\schtasks.log"
${Else}
MessageBox MB_OK "Creating win2k task"
push "Cacti"
push "Invokes the Cacti poller"
push "php"
push "$INSTDIR\inetpub\wwwroot\cacti\"
push "$INSTDIR\inetpub\wwwroot\cacti\poller.php"
push "*(&l2, &i2 0, &i2 2006, &i2 1, &i2 1, &i2 0, &i2 0, &i2 0, &i2 9, &i2 0, i 1440, i 5, i 0, i 1, &i2 1, i 0, i 0, &i2 0) i.s"
Call CreateTask
Pop $0
MessageBox MB_OK "CreateTask result: $0"
${EndIf}