Disclaimer
----------

As usual the MyPath...() functions are provided "as is" ;-)


Introduction
------------

I wrote the MyPath...() functions because a. the build-in Path...() functions can only handle short pathes (i.e. the old-fashioned 8.3 format) and b. in some cases the build-in PathAdd() function of InstallShield 6.1x (and higher) fails adding a path to the path buffer that differs only in the extension from an already existing path. To reproduce the latter just try

	PathSet("C:\\");
	PathAdd("C:\\dir.1\\test");
	PathAdd("C:\\dir.2\\test");

and check with PathGet() whether "C:\\dir.2\\test" is part of the path buffer...


So I've re-implemented the build-in functions. Instead of the internal path buffer I now use a global stringlist that represents the buffer. Long path names are welcome too.


Instructions
------------

To use the MyPath functions include MyPath.h at the beginning of setup.rul and MyPath.rul at the end of setup.rul.


Initialization
--------------

In the OnBegin() function add

	_g_listPathBuffer = NULL;

to initialize the global list variable. NULL means that no ListCreate() has been called yet. The first call to MyPathSet() will create the global path buffer list if necessary (just have a look at the code).

If you don't use the OnBegin() function be sure to initialize the list variable only once (!) before the very first call to MyPathSet().


Syntax
------

You can use the MyPath functions like the original ones. You only have to type MyPath...() instead of Path...(). The parameter list is always the same. The behaviour of the functions should (*gg*) be almost the same. The MyPath functions returns 0 on success and -1 (i.e. < 0) if something goes wrong.

Note 1: If you allow blanks in the path names you want to add, you'd better call LongPathToQuote() before MyPathAdd(), but be sure to add the quotes, too, before MyPathMove(), MyPathFind(), and MyPathDelete(), or the string compare within these functions will fail.

Note 2: Before you can use MyPathAdd() for the very first time in your script you have to call at least MyPathSet("") to initialize the internal stringlist.


Cleanup
-------

In the OnEnd(), OnAbort() and OnCancel() functions you have to take care about the global string list that might have been created due to a call to MyPathSet(). So please add the following piece of code there:

	if (NULL != _g_listPathBuffer) then
		ListDestroy(_g_listPathBuffer);
		_g_listPathBuffer = NULL;
	endif;




Happy installing!
Stephan


