A few days ago, I exchanged emails with someone who was having trouble installing Castalia for Delphi as a non-administrative user. He had found this document that I wrote over 3 years ago, and politely pointed out that the last version referenced there is Delphi 2007, while he was using Delphi XE. Here’s the same document, updated for newer versions of Delphi:
If you’re using Delphi as a non-administrative user on Windows Vista or 7, installing Castalia can be a bit of a pain, because the installer does require administrative rights (because it writes files to Program Files, which is where Windows Vista and 7 want the files to be).
Delphi, on the other hand, loads its settings (including which plugins to load up) from the HKEY_CURRENT_USER registry key, so that’s where Castalia inserts itself. Of course, when you switch users and open Delphi, it doesn’t read the Administrator’s HKCU, so you’ll have Delphi without Castalia for any other user.
Enabling Castalia for a non-administrative account is pretty simple though. Off the top of my head, here are steps:
- Install Castalia as administrator
- Open regedit, and find the appropriate registry key for your version of Delphi (seet he list at the end of this post
- Choose file | export and export this key to a file on the hard drive that is accessible to both the administrator and the non-admin user that you are installing Castalia for.
- Open the file in notepad, and delete every line that starts with $(DELPHI) or $(BDS). You should be left with the lines identifying the key, and the lines describing Castalia
- Save the file
- Switch to the non-admin user, close Delphi if it’s open, and find the file you just created. Double-click it to import it into the user’s registry.
- Start Delphi. Castalia should install itself and you’re done!
Which registry key to export:
- Delphi 5: HKCU\Software\Borland\Delphi\5.0\Known IDE Packages
- Delphi 6: HKCU\Software\Borland\Delphi\6.0\Known IDE Packages
- Delphi 7: HKCU\Software\Borland\Delphi\7.0\Known IDE Packages
- Delphi 2005: HKCU\Software\Borland\BDS\3.0\Known IDE Packages
- Delphi 2006: HKCU\Software\Borland\BDS\4.0\Known IDE Packages
- Delphi 2007: HKCU\Software\Borland\BDS\5.0\Known IDE Packages
- Delphi 2009: HKCU\Software\CodeGear\BDS\6.0\Known IDE Packages
- Delphi 2010: HKCU\Software\CodeGear\BDS\7.0\Known IDE Packages
- Delphi XE: HKCU\Software\Embarcadero\BDS\8.0\Known IDE Packages
As always, messing with the registry can cause damage to the system if you make a mistake. Do it at your own risk, your mileage may vary, etc….