Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Specified module could not be found on "reinstall"


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Jan 5, 2017 9:31 AM Last Post By: Remy Lebeau (Te...
Frank Staal

Posts: 115
Registered: 12/9/99
Specified module could not be found on "reinstall"  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 4, 2017 3:43 AM
Because of hte Appx platform I am re-creating a development environment on a virtual machine. This time it is Win 10, but the previous one was Win 7. I've installed Berlin Update 2 and am trying to install our thrid party and our own components. And that is where problem arises. When I click "Install" on the project it ends in "Can't load package %s. the specified module could not be found." When I go C:\Users\Public\Documents\Embarcadero\Studio\18.0\Bpl I see the .bpl, in ..\DCP I see the .dcp. Set in a DOS box confirms that the bpl folder is in the path, yet it claims it doesn't see it. Under Windows 7 (the previous installation) everything works as expected, but not WIn 10... Has anything changed from 7 to 10?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Specified module could not be found on "reinstall"  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 4, 2017 9:37 AM   in response to: Frank Staal in response to: Frank Staal
Frank wrote:

When I click "Install" on the project it ends in "Can't load package %s.
the specified module could not be found."

Does it really display "%s", or does it display the actual filename?

When I go C:\Users\Public\Documents\Embarcadero\Studio\18.0\Bpl I
see the .bpl, in ..\DCP I see the .dcp. Set in a DOS box confirms that
the bpl folder is in the path, yet it claims it doesn't see it.

More likely, the BPL has a dependency on another BPL/DLL that cannot be found.
The error dialog displays the filename that is being loaded, not the filename
that is actually missing. Use tools like Dependency Walker and SysInternals
Process Monitor to see what dependencies are present, and what filenames
are being looked for and where.

--
Remy Lebeau (TeamB)
Frank Staal

Posts: 115
Registered: 12/9/99
Re: Specified module could not be found on "reinstall"  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 5, 2017 1:56 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

Does it really display "%s", or does it display the actual filename?

It displays the filename. I figured , among developers, it would be understood what I meant, lol.

Remy Lebeau (TeamB) wrote:

More likely, the BPL has a dependency on another BPL/DLL that cannot be found.
The error dialog displays the filename that is being loaded, not the filename
that is actually missing. Use tools like Dependency Walker and SysInternals
Process Monitor to see what dependencies are present, and what filenames
are being looked for and where.

You are correct as usual. I already figured it was depending on one particular .dll but the path statement showed it could be found (c:\Windows\System32). Somehow Delphi does not, I don't understand why, but apparently so. I copied the dll next to the bpl, ran "Install", and it got installed. Agaiin, no clue as why it wasn't found in the system folder, but it is installed and that was the goal.

Thanks Gambit
Lajos Juhasz

Posts: 801
Registered: 3/14/14
Re: Specified module could not be found on "reinstall"  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 5, 2017 7:18 AM   in response to: Frank Staal in response to: Frank Staal
Frank Staal wrote:

[snip]

You are correct as usual. I already figured it was depending on one
particular .dll but the path statement showed it could be found
(c:\Windows\System32). Somehow Delphi does not, I don't understand
why, but apparently so.

My guess is that you have a 64 bit Windows and you've copied the file
into System32 instead of SysWow64.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Specified module could not be found on "reinstall"  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jan 5, 2017 9:31 AM   in response to: Frank Staal in response to: Frank Staal
Frank wrote:

I figured , among developers, it would be understood what I meant, lol.

You'd be surprised how easy it is to pass wrong parameters to printf-style
functions, causing actual placeholders to appear in formatted messages.
At least in C++, anyway (and especially in C++Builder, since its compilers
do not implement compile-time printf parameter validation). I've been bitten
by this numerous times.

Maybe it is not as big a deal in Delphi, though, when using things like Format(),
which raises an exception if it encouters a parameter mismatch.

You are correct as usual. I already figured it was depending on one
particular .dll but the path statement showed it could be found
(c:\Windows\System32). Somehow Delphi does not, I don't understand
why, but apparently so.

Delphi is not the one doing the searching, Windows is. When you load the
main BPL, the DLL loader detects the dependencies and tries to find them,
and in this case is failing. How the loader looks for dependent files is
quite complex in modern systems:

Dynamic-Link Library Search Order
https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx

Agaiin, no clue as why it wasn't found in the system folder

Again, using a tool like SysInternal Process Monitor would have shown you
exactly where the file was actually being looked for.

Since the BPL is 32bit (or else it can't be loaded into the IDE), then the
DLL has to be 32bit as well (or else the 32bit BPL cannot use it). If you
are running on a 64bit machine, putting a 32bit DLL into the "C:\Windows\System32"
folder is wrong since that is a 64bit folder. The 32bit system folder is
"C:\Windows\SysWOW64" instead. But, you really shouldn't be putting files
in the Windows system folder to begin with. Putting the DLL in the same
folder as the BPL is preferrable, unless the DLL needs to be shared with
other libraries/processes, in which case putting it in your own folder and
then registering the path in the KnownDLLs subkeys in the Registry is preferrable
instead.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02