Tuesday, April 05, 2005

Delphi Installation Organization Part 4

Well.. you can believe your eyes... here it is.. the last article of the Delphi Installation Organization.. incredible.. After receiving many emails supporting my blog (in fact only 1 from Esteban #:-D.. thank you again Esteban for your support) I decided to finish my article. I just took my mug, filled it with milk... heated it on my microwave, added some, some.. err... plenty Cofeee and there it is... the Article.
On last article I explained the last configuration steps of the Delphi IDE. Now you should have all dcp's and bpl's (except the ones that Delphi Installs of course) located at a precide folder, all your component sources also well placed at they folders and so on. Now after having set all this up, and having all this well organized, we want to be able to store all this settings so that we could be able to restore all this in a minute if we may have to reinstall Delphi or our OS. All this settings, organized, are going to be stored in a precise sub-folder at our BDS folder that is named Settings. If you remember I explained it at the First Chapter of this article. I will explain what settings are placed at each subfolder of the Settings folder, and how are they retrieved to place them there and a brief explanation of what they are:

G:\BDS\Settings\Bin:
Here I place all settings that are going to be copied to the $(BDS)\Bin folder. Here I have two files, the Delphi.dct file and my Programming.dst file. Delphi.dct is a file that holds all of our configured Component Templates at the Delphi IDE. Programming.dst is my Desktop Speedsetting file. So once I do a change of any of this files I copy them from the $(BDS)\Bin Folder to my G:\BDS\Settings\Bin Folder for backup.

G:\BDS\Settings\Delphi 2005 Examples:
This folder holds some Borland Samples for D2005 that once installed you get it to be opened on the IDE wellcome page. I got them from a Delphi Blog (you may find it at CodeCentral) . In fact this is not vital but I have placed here as many of the Samples are usefull for me for testing purposes.

G:\BDS\Settings\Objrepos:
Here I store all my reformated Units/Forms of the object Reposistory and the Configuration file for the IDE. For Example I have edited some of the Objrepos files from the Delphi Installation folder just to re-format them as I like them to look like, so each time I Invoke a FileNewASP .NET Page I get them as I want it to look like, so I don't have to reformat it's source each time. I also have some Form Templates Stored in a fixed Place somewhere outside of the G:\BDS\ Folder (in fact in my G:\BDS Projects Folder :-) ) These form templates where added as template to the object repository. All this settings are stored in the BorlandStudioRepository.xml, so copy the files edited at the $(BDS)\Objrepos Folder and the before mentioned xml file and store them here for Backup.

G:\BDS\Settings\Patches:
Here I store all IDE patches install files. (With this IDE, Delphi 2005, too many #:-( and to short at the same time.)

G:\BDS\Settings\Path:
Here I store a txt file (path.txt for example) holding the Path information that I have to set each time I reinstall my os for the bpl and dcp dir.(as explained in previous article) At the moment it would be G:\BDS\_Win32\_bpl;G:\BDS\_Win32\_dcp.


G:\BDS\Settings\Registry:
Here I store the registry exports from the Delphi Settings at the registry. I export normally three different paths from the registry (so I generate obviously three files).
a) HKEY_CURRENT_USER\Software\Borland.
b)HKEY_CURRENT_USER\Software\Borland\BDS
c)HKEY_CURRENT_USER\Software\Borland\BDS_WIN32.

The a) export is the whole Delphi Installation Settings store. (I store this for backup just in case I have some problems with the b) export.
The b) exported registry file is the Normal Delphi 2005 Settings at the registry.
The c) Exported registry file is a configured Delphi 2005 optimized for Win32 configuration to use with the -rBDS_WIN32 switch with the Delphi 2005 IDE.


G:\BDS\Settings\Settings Profile:
Some configuration settings of Delphi 2005 are stored in some place of your user profile, located at ApplicationData\Borland\BDS\3.0. You will find some files you may backup as the
CodeSnippets.xml file that has all your configured codesnippets, the DefProject.bdsproj that holds your default project options for all personalities (Delphi, NET, and C#) and some other as the Code Templates file (bds.dci)

So well.. after having stored all files as stated before, in the case you for example reinstall your os.. when it comes the time to install Delphi see how easy and fast it will be to restore the settings to its "production" state with all configured.
a) Install Delphi. (Bare in mind you must install of course delphi to the same path allways at it was when you exported the registry file)
b) Execute Delphi for first time so all default values are created at the registry.
c) Close Delphi .
d) Execute all the patches needed in order.
e) Set the path as stored in the G:\BDS\Settings\Path\Path.txt for our bpl's and dcp's.
f) Copy all files from the G:\BDS\Settings\bin to the $(BDS)\Bin Folder.
g) Copy all files from the G:\BDS\Settings\Objrepos to the $(BDS)\Objrepos Folder.
h) Copy al files from the G:\BDS\Settings\Settings Profile to its destination part.
i) *CAUTION* with this.Delete the HKEY_CURRENT_USER\Software\Borland\BDS key at the registry (be carefull with deleting keys at the registry.. just only the above mentioned should be deleted. I you delete some other key you may turn your os to unusable and loose some or all of your data.)
j) Import the Registry File where you exported the HKEY_CURRENT_USER\Software\Borland\BDS key
k) you are done !!!! Execute Delphi and you will have all set at it was before.

The process from e to j is fast as the lightning and you have all nicelly setup again.
Buff.. and that was it all for today friends. I wish you understood it all and forget my typos. #;.D. Se you soon again back here.

2 comments:

Anonymous said...

I just came across your 4 articles while doing some research on standardizing and hopefully automating a delphi backup procedure so that your setup, components, etc... can be replaced, moved to a new pc, etc...
I haven't read all your stuff yet but so far it is promising and will complete the read after I have looked at more sources. Thanks for your time and posts!

Albert Research said...

Thank you for your comments. Some thinks have changed with the new versions of Delphi but this article is still quite accurate... maybe I will make a updated article sometime...