Can't Compile Compil32.dproj using Delphi 10.1 - delphi

Hello I want to recompile Inno Setup Compiler's source code to rename the Uninstall Executable Generation like unins***.exe.
When I try to compile, Delphi says that Error Reading Form : Class not found because my Delphi IDE haven't all the packages needed to compile Compil32.exe.
If I compile my Compil32.exe without all missing classes and run it, Compil32.exe has stopped working appears as it isn't correctly compiled.
Please tell me what version of Delphi or what IDE Packages want to be downloaded and can be used to compile / build Compil32.exe without any problem.
Thanks in Advance.

It's a bit confusing.
Readme does say you need to install components
The readme.md address this issue.
Let me quote it for you
Component Installation
If you intend to view or modify the Setup project's forms, you must install the following component units, which can be found in the Components directory.
BidiCtrls
BitmapImage
FolderTreeView
NewCheckListBox
NewNotebookReg
NewProgressBar
NewStaticText
PasswordEdit
RichEditViewer
If you intend to view or modify the Compil32 project's forms, you must additionally install the following components. (Like the Compil32 project itself, these require Delphi 3 or later.)
DropListBox
NewTabSet
But the readme does not tell you how to do this
The readme assumes you know how to install components from scratch.
This is a bit of an assumption and I can see why you're getting stuck here.
In Delphi you need a create a .dpk (package) file to put your components in.
Choose File->New->Package
And add all of the units listed above to your package.
Now build the package and then install it.
You should be seeing a message that 11 new components have been installed.
If this is successful you can open the forms.
If you have previously ignored any errors and saved the project Delphi will have removed the components. In that case you'll need to reload the project from github.

Related

Delphi 10.1 doesn't find the units added with an installed package

I use Delphi 10.1 Berlin Starter and have the following problem:
Is added some packages by opening them, and installing them by right-clicking on the package in the project manager and choosing "install". The compiled packages are now in the same folder as the other packages Delphi uses, so I think that there cannot be a problem with the library or search path.
The packages also added some Components that are now accessible in the tool palette. If I add one of these components to my program, Delphi automatically adds the unit name of the component to the "uses" section of the unit containing the component. But if I want to compile, Delphi throws the fatal error "could not find unit_name.pas".
How can I fix this? Does the units required to build and install the packages have to be included in a library path?
Maybe this is a compatibility problem. The packages were written in 2008 (Are Namespaces in Delphi younger?), so maybe the way the package wants to tell the compiler what to do does not work anymore.
This question might be difficult to understand (I had some problems to explain it...), so please comment, if you need more information.
Quite easy, I just had to add the units of the package to the library path (Tools->Options->Delphi Options->Library). Worked. Thanks to KenWhite.

Delphi component install issue

After installing a SVN version of graphics32, I cannot see the components in the ToolPallette. (Windows 8.1, Delphi XE)
I mean, I see the group Graphics32, but it's empty.
When I navigate to see Installed Packages, I see the package there, it's checked... and when I click on it, and then click on the "Components" button I can SEE the components, but again, on the component pallette they are not visible.
So I am having problems adding those components to my form.
I just upgraded from version 1.9.1 to version 2.0 (beta) from the SVN trunk because I need functionalities from the latest version, but I have problems installing it correctly.
Please help
Thank you
EDIT
After compiling and installing the library, I copied the dcu`s and the pas files to Delphi's folder in program files (Release and Debug), because that is what I do with all my components so I don't depend on later folder changes.
Graphics32 does not come with .dproj files, so you might have to do some adaptations regarding component installation / setup yourself. The reason why these file types are not included can be found here.
If you open the .dpk files in the IDE (for recent Delphi versions there are runtime and designtime packages) you can of course build and install the packages right away. The designtime package need to be installed otherwise they won't be shown in the IDE. It should show something like "Package [..]\GR32_DSGN_RSXE1.dpk has been installed". If you have not removed previously installed GR32 packages before you should also get a text for all the new components now installed.
To actually use the components in a project you need to have either the source files or the dcu files be found from Delphi. As mentioned in the comments before this can either be the library or the search paths depending on what you want. For a better explanation see this question here on stackoverflow.
In short and as mentioned by Stefan Glienke in a Google+ post you shoud not put source files in your library path as it will cause the files to recompile each time you compile your project.
Instead, you should take some time configuring the packages options in advance (before building / installation) to put the DCU / DCP directly into a place where it can be used. For example you can put something like
....\Lib\XE2\$(PLATFORM)\$(CONFIG)
into both packages 'Output path for units' AND 'DCP output path'.
Now after build/installation, just add the path specified there into the library path. In addition you can put the source path into the search path, so that a [CTRL] + Click will find the code as well.
The advantage of this is that the library will be used with the package options, which might differ from your project's options.
As said, other ways are possible here including installing the components directly into a global library path.
This might not explain why the components are not visible in your project, but maybe you should just remove the existing packages (delete them from the list, not only uncheck), restart the IDE and reinstall the packages as mentioned above.

What is the best way to install components?

Installing components under Delphi XE3 is a nightmare.
First I need to add source files to
Tools -> Options -> Library
then I need to find a normal package and compile it
finally I need to find design time package and install it.
This is just quite tedious and error prone. Is there a nicer way to install components?
I have found Delphi Package Installer. Unfortunately it doesn't support Delphi XE3 or above.
I have heard that there is something similar which produces exe packages that install themselves (something like Inno Setup) but I can't find such thing.
No. The steps above are required.
First, adding the file path to Tools->Options->Delphi Options->Library Path is so the compiler knows where to find the files to compile them. (Actually, it's not required - you can eliminate this step by making sure that the .dpk files are in the same folder as the .pas files, and that all .pas file names are listed in the includes section in the .dpk. If the .pas files are in a different location, you'll need to either use relative paths in the .dpk (eg., MyComponents in '..\Source\MyComponents.pas') or add the location of the .pas files to Project->Options->Delphi Compiler->Search Path.)
The next step (finding the "normal package") is in order to build the runtime package. It's required, because the design-time package (next step) requires the code that's in that package in order to function in the Form Designer. It's also needed when you decide to build your application with runtime packages, if you use the third-party components and want to distribute the runtime package for it.
The separate design-time package (the third step) is required because designtime code can only be used at design-time; there's nothing that can be distributed with an application if it's built with runtime packages and the package build in step 2 is one of them.
This has been the way components are installed since around Delphi 3 or so, and the requirement to separate out designtime code into it's own package started being advised in Delphi 5 and enforced in Delphi 6 (when they relocated much of the IDE designtime support into their own separate packages and stopped distributing the source for them).
There really are no other options, unless the vendor supplies pre-build designtime and runtime packages for you, or supplies an installer that will do all of the above steps. (Most don't.) But if you update your Delphi version, you'd still have to go through the steps above.
What about the built-in component installer? It is part of Delphi XE, XE2 and XE3 and a description can be found here (I wrote it). It will even install components in C++Builder. You can instal into an existing package or into a new one, which it will create for you.
I would say that the best way to install components is to use your build manager (for example FinalBuilder) and add each component to a manager-project file which sets the necessary paths, builds the DPK files, and 'installs' the component in the IDE by making a registry entry. That way you have a documented procedure which allows you reliably to set up or repair your complete, tested, Delphi development environment. You can simply re-run the project when a component has been updated and tested. It is also quite easy to tweak an existing project to handle a new Delphi version.
The big disadvantage of a vendor-supplied installer is that all the ones I have seen simply overwrite the previous version on updates. I prefer to control the install myself, so that I have previous component source versions archived and available for comparison, in case testing reveals a problem with an upgrade. The 'one-click install' sounds fine, until a minor component upgrade suddenly causes your application to stop working.
Take a look at "Lazy Delphi Builder". It was created to simplify build/installation of many components at once. It resolves packages dependencies automatically. Free to use.
Link to some old tutorial

Delphi package install error - DCU not found

I am trying to install a Delphi package from the VST SDk, my problem is that it says a .dcu is missing.
The .dcu is not missing, and before installing the package, it doesn't exist, but is created by the
IDE during the installation, so it's not precompiled from a former version of Delphi. The .pas file doesn't appear to be incomplete. All the other files appear to be installing just fine, this however is giving me a great load of trouble. I hope someone might help me :)
Im using Delphi 2010 btw.
Thanks in advance :D
Image showing my files and errors
Here's the SDK - im using 1.3
The problem is that the compiler cannot find the source files, or the dcu files.
There are several ways to solve this.
You can add the paths that contain the .pas files to your library, via /tools/options/EnvironmentOptions/DelphiOptions/Library/LibraryPath
You can add the paths to the search path of the project.
In the project options (ctrl+shift+f11)
You can add each file that you need to the project. shift+f11
Note that you can also point to the folder that contains the .dcu files, but that means you wouldn't be able to step through code when you're debugging.
I usually use method 1, because that settles it for all future projects that you use in this IDE. It's convenient if you create many projects that use the same library.
Some other people like to specify this per project, so that they have full control over the dependencies of the project.

Error Loading a Form

I am a .Net programmer and I'm currently debugging a Delphi application and as I go along
I encountered the following error:
Could you explain to me what is this error, and how I can resolve it?
I am new to using Delphi.
Error Explanation
The error that is been presented to you is telling you that a component on that form is not registered in the IDE, in this case TsStatusBar which is from the AlphaControls library: http://www.alphaskins.com/
The form would have been saved at some point with TsStatusBar placed on the form. When any component is added onto a form they leave references to the component in both the forms source file (*.pas) and the inside the forms dfm. This is why you are getting this error, because the component cannot be found, yet the references linking to it still remain.
Option 1 - Install the AlphaControls packge
The best option would be to install the components that are missing, this will solve your error problem as shown in your question.
Option 2 - Convert Project
AlphaControls provides a tool to convert a project from standard VCL to AlphaControls and vice versa, this may be an easier option then installing the AlphaControls package or manually editing source files, the convert tool is free. Just remember to make a backup before converting should anything go wrong.
Option 3 - Manually Editing the Source Files
You could manually remove these references yourself. Do note though, if you remove the references then Delphi will no longer know that the TsStatusBar was ever there, and without a doubt there will be code somewhere that would have interacted with this component which will create compiler errors.
As an alternative to removing the references, you could rename them from TsStatusBar to TStatusBar, which is a standard statusbar from the VCL. At worst there may be some small syntax errors that may need correcting. If you do decide to edit the forms source and dfm files then I would suggest you do it before loading the form into the IDE.
Option 4 - GExperts
You can also install an IDE Expert such as GExperts which can automate the process of renaming/converting component references.
I would however advise against removing or renaming the references in this circumstance as it seems the project is reliant on the AlphaControls package.
Summary
I can see there are more components from the AlphaControls package been used, so fixing the TsStatusBar error manually will only fix part of the problem.
If the project must remain in its current state then Installing the AlphaControls package is the way to go, if you are able to edit it then I would also suggest the project convert option, this way you won't even need the AlphaControls package.
If you do chose to install the package, it is important to realise that once you install the package Delphi knows where the source files are to be able to compile. After installing the packages, goto Menu > Tools > Options from the IDE, then you need to go to Library and add the folder for the AlphaControls source to the library path. The source folder will be the one containing the most .pas files, but you could add all folders if you are unsure. If you don't add to the Library path then Delphi will not be able compile when using the new components.
Your IDE does not have the package which contains TsStatusBar installed. Find that package, build it, and install it.
Design time components need their code to be integrated into the IDE. This is done using what are called packages. The package project has extension .dpk. You should find this package project in your revision control system. Load the .dpk file in Delphi, click Build from the package manager, and finally, when built, click Install. Now that the package with your component is known to the IDE, your form will load. Whoever maintains this code in your organisation will be able to help with all the details.

Resources