Search code examples
vb6ocx

App launches manually OK, but when launched from Installer it fails (error:an .OCX as Unregistered) Why?


Our installer (old version of the WISE installer) uses the ShellExecute to launch a program (MyApp.exe) it has installed. But when we do that Windows 7 balks and says that Richtx32.ocx is not registered or is missing a component.

-If I manually launch MyApp.exe from Explorer, it runs just fine. -If I run a .Bat file that launches MyApp.exe, it runs just fine. -If I move my installer to the same directory that MyApp.exe is in an run it from there I get the same error.

  • Windows 7, 32 bit.
  • An older RichTx32.ocx is installed in the \Windows\System directory.
  • In testing on VMware (Windows 7, 32 bit, without RichTxt32.ocx installed) this problem does NOT happen.
  • The RichTx32.ocx I install happens to have the o capitalized (.Ocx) and then the system reports the error it refers to my OCX (RichTx32.Ocx) or one of it's components being unregistered.

One thought I just had is that the installer may be running as the Admin user and maybe when it launches another app that app doesn't run as the same user, but if you launch from a .bat file it does?


Solution

  • That apper be an about access control and administrative privileges

    Try changed

    ShellExecute(NULL, "open", szGadgetSource, NULL, NULL, SW_SHOWNORMAL);

    for

    ShellExecute(NULL, NULL, szGadgetSource, NULL, NULL, SW_SHOWNORMAL);

    or

    turned out to access control