Running Delphi from a portable drive?

From: Michael Salem (borland_at_ms3.org.uk)
Date: 12/09/03


Date: Tue, 9 Dec 2003 17:28:20 -0000

There was a posting in 2001 in borland.public.delphi.objectpascal with
Subject: Delphi Setup Question which relates to my question; I have
crossposted to b.p.d.deployment & b.p.d.language.objectpascal. I haven't
found any information on Usenet or the Web, though I suppose it must be
there.

I would like a totally portable Delphi environment on portable storage
(e.g., a 1GB or 2GB USB memory stick or USB hard drive). The Delphi
program files and projects would all live on the plugin memory, and it
would be possible to work on any computer to hand running 32-bit Windows
and with a USB port.

The only problems I can envisage are with the registry and .INI files.
While I'd like to hear from someone who's done it, my first guess at how
to do it would involve setting up a .REG file with all the registry
settings, and .INI files. The appropriate registry settings could be
read from an existing setup. As I can't entirely control the drive
letter (if the system lets me select a letter, my preferred letter may
already be in use), I would try one of the following approaches for
registry entries:

1. Set up a share with a fixed name for the portable drive on each host
machine, e.g., ab_delphi. Then, in the .REG file, use
\\%computername%\ab_delphi\borland\delphi6\bin...
instead of
C:\borland\delphi6\bin...

2. Set one or more environment variables on the host machine like
set borlandpath=I:\BORLAND
Then in the .REG file use
%borlandpath%\delphi6\bin...

3. If all else fails, create a number of .REG files, all identical
except for having
d:\borland\delphi6\bin...
e:\borland\delphi6\bin...
f:\...
etc. (trivially easy with search and replace).

Obviously, so something similar for the .INI files.

To complete the job, we would want to check whether Delphi was already
installed (in which case we don't want to change the registry, but to
use the existing installed program); and we would want to delete all the
added entries to the registry after finishing (maybe not; they should
not do any harm, and will be there for the next time?)

If this has been done, I'd dearly like to find out the details. If not,
does anybody have any comments or suggestions? I don't think this should
cause any problems with licencing.

In particular, I'm not 100% certain that registry settings are always
the same (except for file locations) from machine to machine -- would
some be dependent upon the particular setup of the machine being used?

Best wishes,

-- 
Michael Salem