Mega Code Archive

 
Categories / Delphi / Examples
 

Making delphi 2005 independent of net

Despite what Borland says, Delphi 2005 DOESN'T require .NET. If you are a Delphi 7 developer and don't like that Delphi 2005 comes polluted with .NET stuff, you have come to the right place. I'll tell you how to convert Delphi 2005 into a pure Win32 IDE, completely independent from .NET, making it a real successor to Delphi 7. 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. ---------------------------------------- Case 1. Clean install of 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: 1. 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). 2. 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... 1. 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. 2. 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. 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!! Because you are again a happy Win32 developer!! Appendix. Additional optimization ================================= 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): 1. Run Delphi 2005 and go to Component->Install Packages... 2. Uncheck all those packages that you never use. I use to leave "Borland Standard Components", "Borland Database Components" and little more. 3. Check the Default checkbox and click OK. ---------------------------------------------------- Case 2. Hacking an already installed Delphi 2005 ---------------------------------------------------- - 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: 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