Delphi Project Needing runtime Packages, even with runtime Packages off - delphi

My Delphi7 project will not run on my clients computer if i don't have a few of the runtime packages in the path. eg rtl70.bpl
I have Build with runtime packages unticked, so shouldn't they be complied into the exe?
Edit: the Project uses Jedi Packages (TJvPlugin) and running the program with out any plugin installed works fine. As Soon as i add a Plugin, the bpl not found errors reappear. Seems like ill have to live with the extra packages.

It has been a while, but it seems like there was something where you needed to (1) check build with runtime packages, and then that enables some other editor (maybe list of packages to use), and you (2) make a change there. (3) Then do a full build, and then (4) remove the runtime packages check and do another (5) full build. It is important to do a full build each time.

From memory:
1. check the build with runtime packages
2. Remove all the run time packages from the list
3. Full build
4. Uncheck the build with run time packages
5. Full build.
Can't test, don't have D7 anymore...

Your project may use DLLs or COM objects that have been built with Delphi packages.

You also need to uncheck the "Use Dynamic RTL" on the Linker tab of the Project Options.
Caveat: I'm using C++Builder, but I believe the options are the same.

One may find this obvious, but check the size of the executable once you've compiled, if it's larger, it'll run. When we manually copy in our updates a smaller dll is a big red flag that something is wrong with the project options.

Related

I get a Can't load package error although the BPL is there

This issue is driving me crazy. I'm trying to compile and install The QR Designer from QuickReports 6. I have an issue just with the one package. When I right the package in the IDE > Install the IDE gives me:
Can't load package C:\xe10_3\QRDesign\Win32\Debug\dclqrd_DXE10_3.bpl.
The specified module could not be found.
But the exact file is there.
I've also tried installing it via the menu under Components > Install Packages and then choosing the BPL from there, with the same issue.
I've tried to use Process Monitor as on this post here to find the issue:
Delphi Can't load package the specified module cannot be found
I couldn't fix the issue, but what I did pick up from Process Monitor was that some process was looking for the package here:
Computer\HKEY_CURRENT_USER\Software\Embarcadero\BDS\21.0\Package Cache\dclqrd_DXE10_3.bpl
That key didn't exists. I tried manually creating the key, but that didn't do a thing.
Any ideas?
UPDATE
Here is the list of packages:
As you can see, dclqrd_DXE10_3 is dependant on two others. Which I already built and installed. I removed its references and re-added them again now, to make sure the references are sound. I guess its like Remy said, the Specified module not found is probably not referring to dclqrd_DXE10_3 although I don't know what other module it could be referring to.
To install a package successfully in IDE, follow the steps:
Open the dpk/dproj/groupproj file in IDE
Build the package(s) for Windows 32-bit platform.
IDE itself is a 32-bit applicaton, so it should match.
Normally, it will build all dependent/required packages
Check if all chain of BPL & DCP files are generated in package Output directory.
It defaults to $(BDSCOMMONDIR)\Bpl & Dcp folders, but can be changed individually for each Package in Settings.
PBL packages are like DLL files. In order to load them, it requires all dependent BPLs.
If you have custom package output paths:
Check if your DCP output path is included in Tools\Options\Language\Delphi\Library Library Path for Windows 32-bit platform
Check if no duplicates of outdated compiled packages in default $(BDSCOMMONDIR)\Bpl & Dcp directories
Add the paths to library source pas files in Tools\Options\Language\Delphi\Library Browsing path or Library path
In some specific cases, if the package requires some extra dll-s like DB Client libraries, check if these dlls are 32-bit and are loadable, like included in %path% environement variable.
Note, some libraries offers package installer tools, that automagically do all mentioned things for you.
Also, there are universal package installer tools for quick working environement setup in one click.
I don't know why this fixed my issue, but it did.
The output directories for the bpl and dcp was set to be $(Platform)\$(Config)
The project files for the different packages exists in the same folder so the above config was supposed to be the debug folder or the release folder. Why only this package was thrown off I still don't know, but since changing the above packages to have a fixed path suddenly I could now install dclqrd_DXE10_3.bpl.
Thank you all for helping.

Debugging a package during component installation

I need to build old components made for BCB6 (Borland C++ Builder 6) in Embarcadero RAD Studio XE5. Projects are CPP- projects, and the component code is contained in the *.PAS - files.
The project contain 6 packages:
three packages a design time
three packages runtime
First I build packages runtime. After that I start building and installing the packages design time that use packages runtime. And one design time package has a problem during installation:
I found a runtime package that causes this problem. My question is how do I find and resolve the following error? After all, when the package is installed, I cannot start the debugger, see the stack trace, nothing at all. What are the options? Thanks.
For that you need to run a second instance of the IDE in the debugger:
Uninstall the packages
Compile all packages with debug information
Load the project of the runtime package that causes the problem
In Run -> Parameters Set the Host application to $(BDS)\Bin\bds.exe
Press run with debug
This will start a second instance of the IDE. You might have to ignore some exceptions that it internally raises (and handles).
In that second instance, load the design time package which loads the runtime package that causes the problem
Hopefully you will now see what happens

Creating OpenCV installer with NSIS

I am compiling OpenCV for our project with specific build options (such as 64bit, QT and OpenNI). I was able to follow the instruction as given here: http://opencv.itseez.com/doc/tutorials/introduction/windows_install/windows_install.html
At the end of 2-3 hours of build process, I ended up with \install\build\ with collected bins, dlls and libs in their respective folder. I would like to distribute an .exe installer to other members in research group. But I could not because _CPack_Packages/win32/NSIS is nowhere to be found.
Note: To create an installer you need to install NSIS. Then just build the
Package project to build the installer into the
Build/_CPack_Packages/win32/NSIS folder. You can then use this to
distribute OpenCV with your build settings on other systems.
In the cmake-gui screen, I ticked "Build Package" which I hoped would enable me to see Build/_CPack_Packages/win32/NSIS folder. After build process, this is not found.
Could someone give a suggestion as why I don't see this _CPack_Packages/win32/NSIS folder as described? Could I use
Inno setup instead? If so, do I simply pack all \build\install folder and set path in system to include \build\install\bin?
Thank you.
Sticking with the KISS principle (Keep it simple, Stupid!):
Did you install NSIS prior to building the Package project?
INSTRUCTIONS TO BUILD WIN32 PACKAGES WITH CMAKE+CPACK
------------------------------------------------------
- Install NSIS.
- Generate OpenCV solutions for MSVC using CMake as usual.
- In cmake-gui:
- Mark BUILD_PACKAGE
- Mark BUILD_EXAMPLES (If examples are desired to be shipped as binaries...)
- Unmark ENABLE_OPENMP, since this feature seems to have some issues yet...
- Mark INSTALL_*_EXAMPLES
- Open the OpenCV solution and build ALL in Debug and Release.
- Build PACKAGE, from the Release configuration. An NSIS installer package will be
created with both release and debug LIBs and DLLs.
Jose Luis Blanco, 2009/JUL/29
I suggest instead of using Visual Studio to build, you should try using CMake.
http://www.cmake.org/
Let me know if this helps at all.

RTL150.BPL not found

i have this problem: i compile and run application and all work in mine computer. When i try to run same application in other computer, i have error about rtl150.bpl not found.
I have searched on internet and all response that i have had tell me to verify if in PROJECT->OPTION->PACKAGES is checked: "BUILD WITH RUNTIME PACKAGE".
It is checked, i compile project but i have same every error. I have saw too that executable of application is very small for example: 186 KB, when usually it was about 2000 KB.
I use delphi xe and not know as i need to do for solve it.
Please, someone can help me to solve this problem?
Thanks very much.
If you build with packages you must distribute the packages (.BPL files) your application uses.
If you don't build with runtime packages you won't get this error.
The list of packages you must distribute is semi-colon delimited list next to the check box for Build with run time packages in the project options.
The Size of an Executable will drop when building with Runtime packages. That is because the code is now in the BPL/Package. But that means your application now needs these additional files. Think of a Package as a specialized DLL that has been renamed.

Delphi IDE Project "Clean"Command -- What does it do?

Running Delphi 2007 (and probably other versions as well, I'm guessing), if I right-click on a project in the Project Manager (either EXE of BPL in this case), there is a "Clean" command above Compile and Build. What exactly does it do?
To "clean" a build means to delete all intermediate and output files generated by the compiler. Some compilers or IDEs also have a "clean & build" or "rebuild all" option which essentially performs a clean, followed by a build.
When you rebuild an existing project, compilers generally only rebuild files it determines are changed or new. This is, of course, to save time by not completely recompiling the entire project each time. However, sometimes this has problems; you will find your program getting strange errors or not working right. This increases with the number of dependencies within your project - they may not be rebuilt properly. In this case, you will find that cleaning the output and re-building from scratch will solve the problem.
It is also generally recommended to do a clean before building any release versions for the same reason.
Yes, it removes the DCU files and the EXE file, BUT it doesn't clean :
DCUs in other directories than the project dir (even if the PASes are added included to the project),
.MAP file
.RES files (compiled from corresponding .RC files)
.DRC file
.TLB file
...
So, ... the implementation is really, really bad, ....
Using Delphi 2009.
Clean is one of the commands of MSBuild, now used as underlying engine for every compilation or build. This commands removes temporary files (like DCU) but also final output (like EXE).

Resources