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 4,262 other subscribers

Getting the new MMX from Raabe Software to work when installing it as separate Administrative user

Posted by jpluimers on 2018/05/24

I have a policy to install software with a separate Administrative user, but develop with a normal non-Administrative user.

For some software, this creates problems, either because it cannot cope while running as a non-UAC user, or because they write their configuration (either on disk or in the registry) to the user that installed the software as opposed to:

  • write the configuration as a template to a generic place (like %ProgramData% or HKLM) then
  • apply that template when a user first runs the software

ModelMaker Code Explorer does the latter, of which I earlier wrote about in Fixing Unable to create ModelMaker Tools Shared Directory and Cannot create file “C:\HungarianTypeLookup.txt”. Access is denied..

Uwe Rabbe (who now maintains MMX) will fix this, but until then, you either will see no MMX menu entry at all, or get errors like the ones below.

Others have ran into them as well, so hopefully these steps will provide a fix for them as well, see

I think the best fix is for the installer to detect if it is being run as regular user or administrator, then decide upon those where to write in the registry. I’m not sure though how other Delphi experts handle this, so I am open on input from other parties.

Steps below are based on

No MMX in the Delphi menu at all

This likely means MMX is not registered in the registry for the current user.

This happened on my system because the MMX installer creates entries in the template location HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Embarcadero\BDS\#.0\Experts where # is your BDS version, but Delphi had already been started once so Delphi will not copy those again.

So you will need to manually do this using the below batch file.

At first I assumed the default location C:\Program Files (x86)\Raabe Software\MMX\13\ but later found out you can get that from HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\MMX13_is1and HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Raabe Software\MMX\13.0

setlocal

:: in case path in the registry found, set default
set mmxPath=%ProgramFiles(x86)%\Raabe Software\MMX\13\

:: pick installation path from the registry
:: in the loop, %%c is REG_SZ and %%d the path

for /f "usebackq tokens=2* delims= " %%c in (`reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Raabe Software\MMX\13.0" /v InstallDir`) do (
  set mmxPath=%%d
)

:: install for any Delphi version regardless if it exists:
reg add "HKEY_CURRENT_USER\Software\Borland\Delphi\7.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%midexd7.dll
reg add "HKEY_CURRENT_USER\Software\Borland\BDS\5.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds5.dll" /f
reg add "HKEY_CURRENT_USER\Software\CodeGear\BDS\6.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds6.dll" /f
reg add "HKEY_CURRENT_USER\Software\CodeGear\BDS\7.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds7.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\8.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds8.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\9.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds9.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\10.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds10.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\11.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds11.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\12.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds12.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\14.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds14.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\15.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds15.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\16.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds16.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\17.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds17.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\18.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds18.dll" /f
reg add "HKEY_CURRENT_USER\Software\Embarcadero\BDS\19.0\Experts" /v MidexExpert /t REG_SZ /d "%mmxPath%mmx_bds19.dll" /f

:end

endlocal

If you now start Delphi, then it tries to load MMX, you still get errors below.

Any of these errors means your user is not configured for MMX

The below errors occur when your user is not configured for MMX.

This happens because MMX in that case uses template settings from HKEY_LOCAL_MACHINE\SOFTWARE\Raabe Software\Shared which in this case has RootDir pointing to C:\Users\jeroenAdministrator\AppData\Roaming\Raabe Software\Shared.

I think that should become a TemplateRootDir pointing to

  • %ProgramData%\Raabe Software\Shared or $(ProgramData)\Raabe Software\Shared 
  • or the environment variable ProgramData should be replaced with CommonProgramFiles(x86) or ProgramFiles(x86)

In the below screenshots, jeroenAdministrator is my Administrative user and jeroen is my normal user. The middle dialog refused to copy itself to text using CtrlC, so I typed it by hand. The first and last text-copy somehow uses two different formats when using Delphi.

---------------------------
Fout
---------------------------
Unable to create Raabe Software Shared Directory:

C:\Users\jeroenAdministrator\AppData\Roaming\Raabe Software\Shared\
---------------------------
OK   
---------------------------

---------------------------
Application Error
---------------------------
Exception EFCreateError in module rtl240.bpl at 0010B978.
Cannot create file 

"C:\Users\jeroenAdministrator\AppData\Roaming\Raabe Software\Shared\HungarianTypeLookup.txt". Toegang geweigerd.
---------------------------
OK   
---------------------------

[Window Title]
Error

[Content]
Could not find Wizard, 'C:\Program Files (x86)\Raabe Software\MMX\13\mmx_bds19.dll'.

[OK]

Steps to get rid of these dialogs

  1. Download my repository from github.com/jpluimers/Roaming-ModelMakerTools
  2. Run the batch files in the order listed

3 Responses to “Getting the new MMX from Raabe Software to work when installing it as separate Administrative user”

  1. Mike Howard said

    I was able to install ok, but the Properties… dialog will not open in Delphi 7

Leave a comment

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