#
Environment Variables Unit
ReadMe

## Description

This unit provides a static class for reading and modifying the environment variables available to the current process, along with a class that can be used to enumerate environment variable names.

The unit also contains a component and a set of routines that duplicate some of the features provided by the static class. These are now deprecated and are provided for backward compatibility reasons only: they should no longer be used in new code.

More information is available on the Environment Variables Unit Home Page.

### Compatibility

The Environment Variables Unit has been tested on all Delphi versions from 7 to XE4, excluding Delphi 2005. The unit is thought to be compilable with versions of Delphi back to version 4, but this has not been tested.

The unit is compatible with both the Windows 32- and 64-bit Delphi compilers and the VCL and FireMonkey frameworks (tested with FireMonkey 2 only).

.NET and non-Windows platforms are not supported.

## Installation

The Environment Variables Unit and documentation are supplied in a zip file. Before installing you need to extract all the files from the zip file. The following files will be extracted:

- `PJEnvVars.pas` – The Environment Variables Unit. Contains all source code, including the deprecated component, but excluding the component registration code.
- `PJEnvVars.dcr` – Component palette glyph for the deprecated component.
- `PJEnvVarsDsgn.pas` – Registration code for the deprecated component.
- `ReadMe.htm` – This read-me file.
- `ChangeLog.txt` – The project change log.
- `MPL-2.txt` – The Mozilla Public License v2.0.
- `Documentation.url` – Short-cut to the unit's online documentation.

In addition to the above files you will find the source code for various demo projects in the `Demos` directory.

There are three possible ways to use the unit:

1. The simplest way is the add a copy of `PJEnvVas.pas` to your projects whenever the unit is needed.
2. To make the unit easier to re-use you can either copy it to a folder on your Delphi search path, or add the folder containing the unit to the Delphi Search path. You then simply use the unit as required without needing to add it to your project.
3. For maximum portability you can add `PJEnvVars.pas` to a Delphi package.

NOTE: None of the above methods will install the deprecated component into the Delphi IDE. To do this you need to add `PJEnvVars.pas`, `PJEnvVars.dcr` and `PJEnvVarsDsgn.pas` to a design time package. If you need help doing this see here. This is not recommended other than for reasons of backwards compatibility.

## Documentation

The Environment Variables Unit has comprehensive online documentation.

In addition there is an article, How to access environment variables, that discusses interaction with environment variables on Windows.

## Demo Programs

Two different demo programs are includes in the `Demos\1` and `Demos\2` sub-directories. There are VCL and FireMonkey 2 versions of each demo.

The demo programs are documented in the file `DemosReadMe.htm` that can be found in the `Demos` directory.

## Update History

A complete change log is provided in a text file that is included in the download.

## License

The Environment Variables Unit is released under the terms of the Mozilla Public License v2.0.

## Bugs and Feature Requests

Bugs can be reported or new features requested via the Issue Tracker.

If no similar report or request has been recorded already, use the New Issue link to add a new issue. Please select the most appropriate template from the Templates drop down list and make sure you specify the `Project-envvars` label.

## About the Author

I'm Peter Johnson – a hobbyist programmer living in Ceredigion in West Wales, UK, writing write mainly in Delphi. My programs and code are available from http://www.delphidabbler.com/.

I can be contacted via the website.

Please let me know if you have any comments about the unit, but please use the Issue Tracker noted above to report bugs and request new features.
This document is copyright © 2008-2014, P D Johnson, www.delphidabbler.com.