D2005 - fazendo Delphi ficar independente do dot net e mais leve |
Top Previous Next |
(http://delphi.about.com/od/delphifornet/a/delphi2005win32_5.htm) ------------------------------------------------------------------------------- PAGE 1/1
Making Delphi 2005 independent from .NET From Zarko Gajic, Your Guide to Delphi Programming.
Despite what Borland says, Delphi 2005 doesn't require .NET Article written by Alvaro Garcia Pascual, brought to you by Zarko Gajic. Despite what Borland says, Delphi 2005 doesn't require .NET.
If you are a Delphi Win32 developer and don't like that Delphi 2005 comes polluted with .NET stuff, read this article to learn how to remove .Net from Delphi 2005.
This has been tested on Delphi 2005 Architect Edition. I have written two cases: one if you are making a clean install of Delphi 2005, and other if you want to hack an already installed Delphi 2005.
So if you want to free your installation of Delphi 2005 from .Net, try the two following approaches (plus one suggestion):
Clean install of Delphi 2005 Hacking an already installed Delphi 2005 How to save memory and fasten the load time
------------------------------------------------------------------------------- PAGE 2/5
Case 1. Clean install of Delphi 2005. Step 1. Here's how to remove the .Net dependence from Delphi 2005: Step 1. Installing Delphi 2005 When we try to install D2005, the installer checks a series of pre-requisites. I'll tell you how to bypass that check, but first I must make a clarification: There are two things that should be installed before installing D2005: The .NET Framework. If we don't install it, the D2005 will not finish successfully (don't worry, we will uninstall it as soon as the D2005 installer finishes). So let's install it now (it's in the D2005 CD1, in \dotnetRedist\dotnetfx.exe). The MS Help 2 engine. This is required for the D2005 help. Unfortunately, it isn't a standalone product (it only comes bundled with some products such as the .NET Framework SDK, Visual Studio.NET, and Office XP Developer).
So we will just install the Documentation portion of the .NET Framework SDK (which includes the MS Help 2 engine). Let's install it now (it's in the D2005 CD1, in \dotnetSDK\setup.exe). Remember, only install the Documentation portion (uncheck "Development kit" and "Samples"). Once finished the installation, we can happily delete the 100 MB of .NET documentation (because we are only interested on the Help engine). Delete: C:\Documents and Settings\All Users\Application Data\Microsoft Help\MS.NETFrameworkSDK*.* C:\Program Files\Microsoft.NET\SDK\v1.1\Docs\*.*
So let's begin with the Delphi 2005 installation...
Run the D2005 installer (it's in the D2005 CD1, in \Install\setup.exe). Wait a moment and you'll see a modal window that says "Borland Delphi 2005 requires blah blah blah...". Let's kill this window...
Open the Windows Task Manager. You'll see 3 processes with sizes similar to these:
msiexec.exe ... 3,488 K msiexec.exe ... 4,476 K msiexec.exe ... 14,036 K
Kill the process of 4,476 KB... Flawless victory! The pre-requisite check has gone and we can continue with the installation!
Continue. You will be asked the type of installation (Complete or Custom). Select Custom.
Continue. You will see 3 options. Check only Win32:
[ ] Borland Delphi 2005 for the Microsoft .NET Framework [X] Borland Delphi 2005 for Microsoft Win32 [ ] Borland C#Builder 2005 for the Microsoft .NET Framework
NOTE: There is currently a bug in Delphi 2005 so that if you only select the Win32 personality, Refactoring won't work. Hopefully it will be fixed in the December patch.
Continue. You will see a tree of features. Install all if you want.
Continue. You will be asked if you want to install Rave Reports. Install it if you want.
Once the installer has finished, uninstall the .NET Framework, because we won't need it any more. NOTE: Don't run Delphi 2005 yet. It won't work. Also, if you execute it, default values will be created in HKEY_CURRENT_USER\Software\Borland\BDS\3.0, and the changes that we will make in the next step won't have any effect. If you have already executed it, run Regedit and delete HKEY_CURRENT_USER\Software\Borland\BDS\3.0.
We are almost done. The last and final step is to remove the dependency on .Net. Go for the next page.. ------------------------------------------------------------------------------- PAGE 3/5 Case 1. Clean install of Delphi 2005. Step 2. We now continue our discussion on how to remove the .Net dependence from Delphi 2005. Once Delphi 2005 is installed (Step 1), we are ready to completely remove .Net from the machine...
Step 2. Removing the dependency on .NET The most interesting is that Delphi 2005 is a normal Win32 IDE (like Delphi 7), which on startup loads some .NET-dependent modules (now you know why it is still quite fast). I bet that Borland wouldn't like to admit it in these ".NET times", in which all that sounds to Win32 is politically incorrect. ;-) These .NET-dependent modules are what we must disable if we want a pure Win32 IDE, completely independent from the .NET Framework. These modules appear under
[HKEY_LOCAL_MACHINE\Software\Borland\BDS\3.0\Known IDE Packages], in form of packages
that themselves load other modules if necessary.
To disable each package, just delete its Data. Modules that require .NET (and therefore must be disabled) [HKEY_LOCAL_MACHINE\Software\Borland\BDS\3.0\Known IDE Packages] $(BDS)\Bin\caliberide90.bpl $(BDS)\Bin\soapide90.bpl $(BDS)\Bin\asmview90.bpl $(BDS)\Bin\dbkdebugproide90.bpl $(BDS)\Bin\TGIDE90.BPL $(BDS)\Bin\compro90.bpl
Modules that don't require .NET (you can keep them) [HKEY_LOCAL_MACHINE\Software\Borland\BDS\3.0\Known IDE Packages] $(BDS)\Bin\vclmenudesigner90.bpl $(BDS)\Bin\win32debugproide90.bpl $(BDS)\Bin\htmide90.bpl $(BDS)\Bin\iteidew3290.bpl $(BDS)\Bin\SrcManIDE90.bpl $(BDS)\Bin\todoide90.bpl $(BDS)\Bin\htmlhelp290.bpl $(BDS)\Bin\idefilefilters90.bpl $(BDS)\Bin\startpageide90.bpl $(BDS)\Bin\refactoride90.bpl $(BDS)\Bin\dbkdebugide90.bpl $(BDS)\Bin\exceptiondiag90.bpl $(BDS)\bin\deployide90.bpl $(BDS)\Bin\plugview90.bpl $(BDS)\Bin\coreproide90.bpl $(BDS)\Bin\IDETools90.bpl $(BDS)\Bin\unittestide90.bpl $(BDS)\Bin\historyide90.bpl $(BDS)\Bin\htmltidy90.bpl $(BDS)\Bin\HTMLFmt90.bpl $(BDS)\Bin\mlcc90.bpl $(BDS)\Bin\delphivclide90.bpl $(BDS)\Bin\delphicoreproide90.bpl $(BDS)\Bin\win32debugide90.bpl $(BDS)\Bin\htmlide90.bpl $(BDS)\Bin\delphide90.bpl $(BDS)\Bin\comstd90.bpl $(BDS)\Bin\mtspro90.bpl $(BDS)\Bin\delphipro90.bpl $(BDS)\Bin\mtsent90.bpl
Of these packages that don't require .NET, you don't need to keep all of them. In my computer I've kept enabled only these:
[HKEY_LOCAL_MACHINE\Software\Borland\BDS\3.0\Known IDE Packages] $(BDS)\Bin\coreproide90.bpl $(BDS)\Bin\delphide90.bpl $(BDS)\Bin\delphivclide90.bpl $(BDS)\Bin\htmlhelp290.bpl $(BDS)\Bin\todoide90.bpl $(BDS)\Bin\vclmenudesigner90.bpl $(BDS)\Bin\win32debugide90.bpl $(BDS)\Bin\win32debugproide90.bpl
Step 3. Enjoy. Enjoy!! Because you are again a happy Win32 developer!! Note 1: If you already have installed Delphi 2005, here's how to hack it to remove the .Net (on the next page).
Note 2: once you have Delphi 2005-Win32 ONLY, you can speed it up even more by removing some unvanted packages from the startup process.
-------------------------------------------------------------------------------
PAGE 4/5 Case 2. Hacking an already installed Delphi 2005
If you already have installed Delphi 2005, and you really, really do not want .Net installed, here's how to "free" Delphi: Uninstall the .NET Framework, the .NET Framework SDK, and the Visual J# .NET Redistributable. Run Regedit and delete HKEY_CURRENT_USER\Software\Borland\BDS\3.0. Continue with Step 2 of Case 1. Note: once you are done, there are ways to speed up the load time and to save memory, those are discussed on the next page...
------------------------------------------------------------------------------
PAGE 5/5
Making Delphi 2005 independent from .NET From Zarko Gajic,
How to save memory and fasten the load time Once you have remove the dependency on .NET from Delphi 2005, here's how to speed it up. For further optimization, I suggest that you deactivate the design-time packages that you never use (this has no relation with .NET, but it's always useful in order to save memory and load time):
Run Delphi 2005 and go to Component->Install Packages... Uncheck all those packages that you never use. I use to leave "Borland Standard Components", "Borland Database Components" and little more. Check the Default checkbox and click OK. NOTE: You can activate/deactivate packages as many times as you want. Just be aware that the IDE always give more precedence to HKEY_CURRENT_USER than to HKEY_LOCAL_MACHINE. i.e.:
if (HKEY_CURRENT_USER\Software\Borland\BDS\3.0 exists) then it is used (and HKEY_LOCAL_MACHINE\Software\Borland\BDS\3.0 is ignored) else it is copied from HKEY_LOCAL_MACHINE\Software\Borland\BDS\3.0
For a more detailed look, visit "Delphi 8/2005 Tips, Tricks and Speed Improvements"
That's it! Now you have Win32_ONLY Delphi 2005! |