How to install DWScript - delphi

I am trying to install DWScript into Delphi XE4: (I did copy the package files into a DelphiXE4 folder and change the package suffix property to XE4...)
In the packages folder there are 3 files:
dwsLibRuntime.dpk
dwsLib.dpk
dwsLibDesignOnly.dpk
I manage to install dwsLibRuntime and then dwsLib (although I get a few warnings which I ignore), but then have problems trying to install dwsLibDesignOnly.
Is one meant to install both dwsLib.dpk and dwsLibDesignOnly.dpk, or only one of them?? (They both reference the same Register unit, so it would seem that only one should be installed).

I just installed dws in the following manner (after downloading using svn and creating a new project directory , \DelphiX4, copying the four files from \DelphiXE3):
When you open dwsLib.dproj you should have (in Project Manager, under ProjectGroup1) dwsLibXE3.bpl as your project.
In Project Options - Description, Change LIB suffix to XE4 and under Usage options select 'DesignTime and Runtime'. Click OK and your project should now be dwsLibXE4.bpl.
Right click on dwsLibXE4.bpl and select Build. (I moved dwsWebUtils.pas from \Libraries\SimpleServer to \Libraries\SymbolsLib to succeed with the build, adding \Libraries\SimpleServer to the search path would be better).
After a successful build right click on dwsLibXE4.bpl again and select 'Install'.
The DWScript group should now be available on the Tool Palette.

Related

Issue with TurboPower Async Professional installation on Delphi-XE7

I want to make a Delphi program that can connect to my Arduino via usb(Serial communication), I know i have to use TpaPro (TurboPower Async Professional) for this but i don't know how to install it on Delphi-xe7.
I installed the setup (http://sourceforge.net/projects/tpapro/). I added the source directory from TpaPro to the libraries but I still can't see any funtions of tpapro in the tool palette.
I already read the Readme.txt but i don't understand the install instructions.
Does anyone know how i can get TpaPro working for Delphi-XE7?
These are the install instructions i don't understand step 4 and 5:
Unzip the release files into a directory (e.g., d:\apro).
Start Delphi or C++Builder.
Add the source subdirectory (e.g., d:\apro\source) to the IDE's
library path.
Open & compile the runtime package specific to the IDE being
used.
Open & install the designtime package specific to the IDE being
used. The IDE should notify you the components have been
installed.
I got my answer thanks to Tlama.
You open the \packages\Delphi\Delphi.groupproj project group and in the Project Manager you should see two projects. You right click the first one in the tree, AsyncProDR.bpl (that R at the end means runtime) and select From Here | Build All From Here menu item. Both projects will be build. Then you right click the second one, AsyncProDD.bpl (that D at the end means design-time) and select Install menu item. That will install design time package.

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.

How do I modify Indy 8 IdMessage.pas with Delphi 6?

I have a copy of Delphi 6 and a simple email program that uses the Indy TIdMessage component. I want to remove lines 464-465 of IdMessage.pas then recompile the application. I'm having a hard time finding clear documentation, so I tried these steps to modify the component:
opened \delphi6\source\indy\indy.dpk in the IDE
double-clicked IdMessage.pas in the Package window
edited IdMessage.pas and saved the file
clicked "Compile" in the Package window
clicked "Build Indy" in the Project menu
clicked "Install" in the Package window
But then I get an error that \bpl\indy60.bpl can't be loaded because \bin\indy60.bpl is already loaded. So I tried "Install packages..." in the Components menu, but only found \bpl\dclindy60.bpl there. So I removed that package, and:
opened \delphi6\source\indy\dclindy.dpk in the IDE
clicked "Compile" in the Package window
clicked "Build dclIndy" in the Project menu
clicked "Install" in the Package window
The IDE confirmed all the components (including TIdMessage) were installed, but the email program is still acting as though the original unmodified component is still being used.
What am I doing wrong?
if you were using runtime packages then you'd need to ensure that your program found the new package file, the .bpl.
But you probably are not using runtime packages. So the runtime program statically links the Indy code using .dcu files located in the Delphi installation folders. Specifically in this case to <ProgramFiles>\Borland\Delphi6\Lib\IdMessage.dcu. You need to make sure you link the new code. The easiest way is to add the modified file to your project. That will mean that the modified version gets compiled and linked into your program.
Since your modifications are in the implementation section of the unit this is all you need to do. If the modifications were in the interface section you'll encounter "Unit X was compiled with a different version of Unit Y" errors. You'd solve that by adding the rest of the Indy source to your project.
One point to stress is that you should never modify the files under the Delphi installation folder. If you want to build modifications to those components, take copies of the files and make modifications in those copies.

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.

How to correctly set "Directories/Conditionals" and "Library" path

How to set "Directories/Conditionals" in Project Options and "Library" path in Environment Options? Delphi help don't say much about these very important settings. I have all kind of strange errors because of wrong dependencies between my VCLs.
1.
I have merged a large set of 3rd party controls in a package called ThirdPartyPackages_D7.dpk. This is useful when I reinstall Delphi because I don't have to reinstall all those 3rd party VCLs amnually.
Then, I have my own controls in MyControls_D7.dpk which depends on the ThirdPartyPackages VCL. I also have another package BlgPackage.dpk that depends on MyControls.
At the end of the chain is my application (DPR project) which is using the controls in BlgPackage.
ThirdPartyPackages.dpk -> MyControls.dpk -> BlgPackage.dpk -> MyApplication.dpr
When I change/edit something to the second package (MyControls.dpk) and build the DPR application, it works. The compiler sees the changes made into that package.
However, if I close the project and load and compile the BlgPackage, it throws a nasty message that function xyz cannot be found in MyControls because I delete it (I have loaded MyControls' units into IDE in parallel with application's units). It seems that building the application only refreshes the DCU files for all used packages but not the DCP/BLP files.
How do I write and compile the code in the packages without explicitly loading the packages into the IDE and building them?
(Note: I have a nasty bug that does not allow me to switch between projects without restarting the IDE or to load a group of projects/packages (*.bpg) at the same time.)
2.
Another problem is that I want to store the compiled files (DCP/BPL/DCU) of a package in its folder (for example c:\MyProjects\Blg).
If I set the "Output directory", "Unit output directory" and "DCP output directory" boxes of BlgPackage package to its folder, not only its BPL/DCU/DCP files will be stored there but also the BPL/DCP files of MyControls will be stored there.
How can I have the binary files of each package in a separate folder?
Delphi 7, Win XP, all projects set to "Rebuild as needed"
You should explicitely compile packages - just compiling package files is not enough and as you have noticed leads to problems.
In modern Delphi versions you can create a project group (not sure about Delphi 7) that contains an application and packages you want to develop with the application, and you can easily switch between them and complile packages without need to close/reopen the application.
BlgPackage should not have an access to MyControls package sources (through "Library" path or by using the same directory), it should access only already compiled MyControls package, else the files from MyControls are compiled every time you build BlgPackage and the compiled files are stored in BlgControls DCU directory
ADDED
The "Library" path should lead to compiled files (.dcp, .dcu) and (if needed) resource files (.res, .dfm) only - it is enough to compile applications and packages that requires "MyControls" package. You can set the directory for compiled files directly in the package settings, and you should copy the resource files (if you need them) to the same directory manually. This directory should be included into "Library" path, or else you can use a directory already contained in "Library" path.
The "Library" path should not lead to source files (.pas) if you don't want these files to be compiled every time you build your BlgPackage or an application that requires "MyControls" package.
I use much simpler way for 3rd partie components and reinstalling Delphi.
Open regedit and find
[HKEY_LOCAL_MACHINE/SOFTWARE/Borland/Delphi/xxx] where xxx is version and export whole
branch.
Open file and delete keys LMKEY, LMLIC.
Copy C:\Program Files\Borland\Delphi x\Projects\Bpl folder to another location
Copy C:\Program Files\Borland\Delphi x\Imports to another location
Reinstall Delphi including any updates and GExpert
Import previously saved registries
Restore Bpl And Imports Folder
And whoala, Delphi is back with all 3rd partie components and IDE settings. Only limitation is that all components must reside in same folder before and after reinstalling Delphi.
This also restores TeamSource settings. If you are reinstalling Windows as well, be sure to make windows user with same user name as before.
MY solution (kinda dirty, but hey it works):
I put ALL 3rd party libraries.controls in a single package (a super-package). I put all my controls in a single package.
Now, when I migrate the packages to a different PC all I have to do is to copy/paste two folders and set two paths.
Works for me - others may not agree with it and I can't blame them. I blame the 'hell designers' from Borland/Embarcadero. If you look on StackOverflow you will see that until now nobody provided an elegant solution to this.

Resources