There is a message pinned to the #dev_support channel where ElminsterAU described the steps for building xEdit in the Community Edition of the Delphi RAD Studio IDE. With the release of version 10.4 of that IDE, these instructions have been superseded. I'm giving below my steps to get this project group to build. I would like to thank ElminsterAU for working with me to fix a couple problems in the codebase that were preventing it from building or running correctly. I will describe those too.
This is not hard. Either log in on this page or click the link that reads "Register Here" to fill out a form. Then satisfy the captcha and click the button that reads "DOWNLOAD NOW" to begin the download of the latest version. You will also be sent by email a license key which needs to be provided during install. The install should be self-explanatory.
Link is here: https://www.uweraabe.de/Blog/downloads/download-info/project-magician/. Dowload the zip, extract it into a folder, and run the installer application contained therein.
At the time of writing, there is not currently a fix pack for version 10.4 so this step can be skipped. In case there ever is one, you will find it here: https://www.idefixpack.de/blog/ide-tools/ide-fix-pack/
Grab the latest version from this page, then extract the 7z file to a folder and run the executable inside. You may need the free 7-Zip program for this, which also handles zip and many other types of archive.
Open RAD Studio and find DDevExension options under the Tools menu. Tick the box next to "Disable Package Cache (requires IDE restart)" and click OK. Restart the IDE now or later.
It is not enough to download the zip archive from the green Code button, as this will not give you the externals. You'll need to clone the git repository using whichever tools and methods with which you are most comfortable. For read-only access, you will probably need to use the https URL to get it. The project page is here: https://github.com/TES5Edit/TES5Edit, and the repo URL is https://github.com/TES5Edit/TES5Edit.git
You should have the default branch of dev-4.1.5, which is currently recommended as of 8th December 2021. If you see a later dev branch as default, then you should use that. ElminsterAU includes a note about making sure to update the submodules. This needs a bit more of an explanation. Assuming you are using command line git (such as from the excellent Git Bash console), you will need to issue the following commands:
> git submodule init
> git submodule update
This will pull down the tagged heads of the external project repos.
The recommended way to install the JEDI packages JCL and JVCL is through a combined installer; however, for xEdit we need to use the specific versions that are supplied with special patches. ElminsterAU's instructions, and indeed the package's own instructions for installing individually, say to install with a command line batch script. Unfortunately, due to a new limitation instroduced in version 10.4, this no longer works. Instructions here give a clue as to how to proceed with a manual install, but I found these a bit lacking. Here's what you need to do:
- From the TES5Edit root folder, find .\External\jcl\jcl\source\include\jcl.template.inc and create two copies of that as jcld27win32.inc and jcld27win64.inc in the same location.
- In the IDE, open the group project file located at .\External\jcl\jcl\packages\JclPackagesD270.groupproj
- Compile the projects Jcl270.bpl and JcslVcl270.bpl for both 32-bit and 64-bit targets, though 32-bit is all you'll need for this.
This suffers from the same problem as JCL. This package's instructions for manual install are obscure as well as outdated. Here's what you need to do:
- Open the group project file found at ".\External\jvcl\jvcl\packages\D27 Packages.groupproj"
- Choose from main menu Tools -> Options then Language -> Delphi -> Library
- Edit the library path to add the full path to the include folder where you created the two include files in step 6. Also add the full path to .\External\jcl\jcl\lib\d27\win32.
- "Build All Projects" from the Project menu. They will not all build successfully, but it's okay. I had "[dcc32 Fatal Error] JvBands.dpk(43): E2202 Required package 'JclDeveloperTools' not found". This package is not needed.
- Install the design time package JvCoreDesign270.bpl
There is no need to bother with the D27_x64 Packages group project, as it does not contain a design time package for JvCore. I'm told that this is because that package is only used by RAD Studio and that there is no 64-bit version of the IDE.
- Open the group project file at ".\External\VirtualTrees\Packages\RAD Studio 10.4\VirtualTreeView.groupproj" and choose the Windows 32-bit target platform.
- Ensure that the library path for the 32-bit Release build configuration contains the same paths as in step 7, then also add the full path to .\External\jvcl\jvcl\lib\d27\win32.
- "Build All Projects" from the Project menu, then install the design time package VirtualTreesD27.bpl.
I tried to follow similar steps to install the 64-bit version of VirtualTrees, but I couldn't get that to work. I'm not sure whether it has anything to the lack of JvCore design time package. I may investigate this further when I have more time. If you want to try, apply similar changes to the Windows 64-bit library path but substiting win32 with win64 in any path names. At this point, JEDI paths can optionally be removed from any library path for the target platforms, as they are no longer needed.
Open the group project file at .\External\FileContainer\FileContainer26.groupproj then Build All and install the design time package FileContainerD26.bpl.
Note: It certainly would seem like there should be a D27 version of this package included, but the D26 seems to work.
- Open BethWorkBench.groupproj from the TES5Edit root. If you see an error related to frmMain, hit Cancel.
- Choose the target platform. There is a 32-bit and a 64-bit target, which both build and run fine. The 64-bit version displays a warning saying there is usually no good reason to run that version unless you are seeing out of memory errors.
- When building xEdit.exe, select the build configuration LiteDebug under Debug. For the others, select Debug.
- Build and then run the project. It should run without any errors. Then you are done!
Note: If you see an error about cxEdit when building xEdit.exe, it means you have not selected the correct build configuration.
See this commit, which fixes a bug that the new compiler picks up which turns out to be an inconsequential memory leak: https://github.com/TES5Edit/TES5Edit/commit/218cfe1584160b2001ba9cb42e976b21f8821fc4
Any other commits on the same date as above address these issues, which boiled down to missing changes for the RAD Studio 10.4 package of VirtualTrees. VirtualTrees is heavily patched for xEdit, and the 10.4 package had not been used before.
When xEdit is distributed for a particular game, it is given a unique file name, for example, FNVEdit.exe. This is how the application normally detects which game mode it should be working in. From the IDE, it is necessary to suppy a command line parameter. The choices are 'tes5vr', 'fo4vr', 'tes3', 'tes4', 'tes5', 'enderalse', 'enderal', 'sse', 'fo3', 'fnv', 'fo4', and 'fo76', defaulting to fo4. The parameter is supplied as a switch that follows a hyphen, so -fnv for example. Choose "Parameters..." from the Run menu and plug the switch into the Parameters box. Then run the program. As Todd Howard famously said, "It just works."
This help file is provided without license in the hope that it will be useful. It may be reused in any form. I only ask that credit is given.
In addition to these instructions & Infernio's correction, I had to install the
JvCustomDesign270.bpl
package from the JVCL group project. Otherwise, I got errors about a missing TJvBalloonHint class that prevented xEdit from building.