The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

When GExperts for Delphi 2007 does not install itself in Delphi on Windows Vista/7/8

Posted by jpluimers on 2014/03/06

Like When DelphiSpeedup cannot register itself in Delphi on Windows Vista/7/8, GExperts also had problems installing on Windows Vista and up when Delphi runs in a non-elevated account.

It said it installed fine, but it didn’t get included when Delphi was started. The reason was that it got installed in the wrong root key.

What happened is that GExperts installed itself into the HKLM root:

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Borland\BDS\5.0\Experts]
GExperts=C:\Program Files (x86)\GExperts for Delphi 2007\GExpertsDelphi2007.dll

But it should have installed itself in the HKCU root:

[HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Experts]
GExperts=C:\Program Files (x86)\GExperts for Delphi 2007\GExpertsDelphi2007.dll

The reason is similar to the DelphiSpeedUp issue:

  • The regular user has a Delphi installation, but no elevated rights.
  • The installer runs under UAC as elevated user.
  • The elevate user has no Delphi installation.

I wrote a batch file that copies the HKLM information to HKCU for the Delphi 2007 version of GExperts. When in the future I bump into similar things for newer GExperts versions, I will add those batch files as well.

The batch file uses a few tricks:

Note this was on an x64 machine hence the Wow6432Node. But the batch file works both for x64 and x86 installations of Windows.


type NUL > %temp%\GExperts-D2007-HKCU.reg.txt
>> %temp%\GExperts-D2007-HKCU.reg.txt echo Windows Registry Editor Version 5.00
>> %temp%\GExperts-D2007-HKCU.reg.txt echo [HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Experts]
if exist %temp%\GExperts-D2007-HKLM.reg.txt del %temp%\GExperts-D2007-HKLM.reg.txt
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Borland\BDS\5.0\Experts %temp%\GExperts-D2007-HKLM.reg.txt
type C:\Users\Dames\AppData\Local\Temp\GExperts-D2007-HKLM.reg.txt | find "GExpertsDelphi2007.dll" >> %temp%\GExperts-D2007-HKCU.reg.txt
if exist %temp%\GExperts-D2007-HKLM.reg.txt del %temp%\GExperts-D2007-HKLM.reg.txt
reg export HKEY_LOCAL_MACHINE\SOFTWARE\Borland\BDS\5.0\Experts %temp%\GExperts-D2007-HKLM.reg.txt
type C:\Users\Dames\AppData\Local\Temp\GExperts-D2007-HKLM.reg.txt | find "GExpertsDelphi2007.dll" >> %temp%\GExperts-D2007-HKCU.reg.txt
reg import %temp%\GExperts-D2007-HKCU.reg.txt
del %temp%\GExperts-D2007-HKCU.reg.txt
if exist %temp%\GExperts-D2007-HKLM.reg.txt del %temp%\GExperts-D2007-HKLM.reg.txt

–jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.