The HKLM\Environment Key

My celib.dll uses the registry to store environment variables. They are stored in HKEY_LOCAL_MACHINE\Environment. This key does not exist by default.

There are at least two ways to create this key and set values in it:

  • Get the registry editor from Microsoft's Powertoys for CE, use the registry editor that comes with EVC or get a third-party registry editor.
  • Get my "desktop-tools" and use the cereg.exe command-line program. This program is started on your PC and uses RAPI to manipulate the registry on your device. An ActiveSync connection must be established.

    The entries could be set by setup programs, but I am too lazy to write these setups.

    The cereg.exe program

    cereg.exe is in the "desktoptools" archive. It can be called from batchfiles. The syntax is:
    cereg -k <keyname> -n <valname> -v <value>
    

    Example:

    cereg -k "HKLM\Environment" -n "PATH" -v "\Storage Card\bin;\windows"
    

    Currently used variables

    Note: Numbers must be entered as string values, not as DWORDs!

    UNIXROOTDIRDirectory containing standard Unix files/directories, like 'etc', 'dev'. Usually this is set to /storage card. This is used only for some special files. It's not expanded in ordinary filename generation.
    PATHSearchpath for the process creating functions in celib.dll. Paths are seperated by semicolon (/bin;/storage card/bin;/windows). This path *is not used* for dlls and programs you start with the StartMenu or cmd.exe. It's *not used* by normal wince programs.
    HOMEHome diretory (/storage card/nobody).
    ROWSRows for the console. Must be string.
    COLSColumns for the console. Must be string.
    CONSOLEFONTSIZEFontsize for console.
    PWDUsed for passing the parent pwd to child processes. Very bad. Not used anymore. It is passed internally now using shared memory. Delete it if you still have it. Can still be useful to pass a PWD from MFC apps to celib.dll programs. Currently still used with TeXEd.
    TMPDirectory for temp files (/tmp).
    TEMPDirectory for temp files (/tmp).
    TMPDIRDirectory for temp files (/tmp).
    TEMPDIRDirectory for temp files (/tmp).
    USERUsername (nobody).
    SHELLShell. Currently only used for the limited shell for inferior Emacs sub-processes. There is still no real shell for WinCE (xsh).
    TERMTerminal type. Currently used by readline (console), telnet and ssh. You should use the termcap file that comes with console and set it TERM to wince.
    TERMCAPPath to the termcap file.
    XCE_TRACEDebugging. Normally not set. Setting this to 1 gives minimal debugging output, setting it to 255 gives max. When XCE_TRACE_FILE is not set or empty, debug output goes to the debugger port, else to the file in XCE_TRACE_FILE.
    XCE_TRACE_FILEFile for tracing. Normally not set.
    CELIBSTDLOGDIRDirectory for stdin/stdout/stderr files. Since 3.11.

    Sample registry file from my J720