Denali/Mt. McKinley and Brown Bear Software logo
Calcium Documentation - SendReminders as a Windows Service
Horizontal Line

You can run the SendReminders script as an Windows Service; this way, it can be configured to automatically start whenever the machine is rebooted. It requires the use of the Microsoft `srvany' program, and is a little complicated; follow the instructions carefully.

These instructions assume you are comfortable using 'regedit' to edit the Windows registry.

You need to have the programs srvany.exe and instsrv.exe. These are part of the Microsoft NT Resource Kit; if you don't have them, you can download these programs from Microsoft.

To install the Calcium SendReminders script as an NT/2000/XP Service:

  1. Modify the SendReminders script, and verify that it works from the command line.
    You need to edit the SendReminders script to specify the interval that you want it to wait when checking for new reminders. To do this, use an ASCII editor (e.g. Notepad), and insert a line like this at line #70 or so - above the "my $error;" line:

        $interval = 15;
        my $error;
    The interval is specified in minutes; this example would cause the reminder script to check every 15 minutes.

    Also, make sure that the full path to your Calcium installation is specified in the BEGIN line, as explained at the bottom of the Email Reminder Process info page.

    Then, try running the script from the command line:

        c:> \perl\bin\perl SendReminders
    if you see a "Can't locate..." error message, it means the BEGIN line specifying the path is wrong. If nothing is printed and nothing seems to happen, it means things are ok; press Control-C to interrupt the program. See the last item, Verify, below to make sure it worked.

  2. Install the srvany entry.
    From a command shell, run:

          c:> instsrv CalciumReminders c:\winnt\srvany.exe
    If "srvany.exe" on your system is not in the "c:\winnt" directory, specify the correct path. "CalciumReminders" is the name used to refer to the service; you can use anything you like.

  3. Edit the Registry to specify parameters for the new service.
    Run regedit, and:

    • browse to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CalciumReminders entry.
    • Create a new key here, and name it "Parameters"; it should appear as a new "folder" inside the CalciumReminders entry.
    • Create a new value in the "Parameters" folder, and name it "Application".
    • Modify the data of the new "Application" value, setting it to be the full path to the Perl executable; normally this is c:\perl\bin\perl.exe
    • Create another new value in the "Parameters" folder, and name it "AppParameters"
    • Modify the data of the "AppParameters" value to be the full path to the SendReminders script; e.g. something like C:\www-root\cgi-bin\Calcium39Dir\SendReminders
    • Exit regedit.

  4. Start the service.
    Open the Services Control Panel, (under "Administrative Tools" on XP), and open the Properties window for the new CalciumReminders service. Set the Startup type to "Automatic", so the service will start every time the system is rebooted. Then, click "Start" to start it.

  5. Verify that it's running.
    The Service manager will report that the service is running. However, since the Reminder process is really being run by the "srvany" program, this just tells you that the "srvany" program is running, not that the SendReminders process is working.

    To check that the SendReminders process is actually going, you can check the timestamp that it writes to the data file. This file is called reminders, and is in the data/Master directory of your Calcium installation. When the reminder process runs, it writes a timestamp to the very first line of this file. So, type out this file, and see if the timestamp is being updated.

Back to the Email Reminder Process page.