rejetto forum

[Tutorial] How to compile the HFS's Source code

LeoNeeson · 10 · 10663

0 Members and 1 Guest are viewing this topic.

Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 740
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
[Tutorial] How to compile the HFS's Source code

As the result of this, and for the first time ever, I would like to publish the complete process of compiling the HFS's Source code (as simple as possible, step by step, so everyone could do it). It's recomended to watch first THIS video tutorial (download size: 1.56 MB, in GIF format), to see the enterelly compilation process. Then, just follow these steps:

1] Download 'Portable Turbo Delphi Lite v1.0d', from here.
2] Download the 'Library pack' required by HFS, from here.
3] Download the latest 'Source code' file of HFS, from here.
4] Install and/or unrar the exe of the step one, on: C:\Portable\TDLite
5] Unzip the file from the step two, on this exact folder: C:\Portable\TDLite\lib
6] Unzip the source code file of HFS, from step three, here: C:\Portable\TDLite\Projects\HFS
7] Start Turbo Delphi by opening the file "TDrun.exe" or using the shortcut on your desktop.
8] Go to the menu 'Tools' and click on 'Options...' and the 'Options' window will open.
     There, on go to: 'Environment Options' > 'Delphi Options' > 'Library - Win32'.
     Now on 'Directories' > 'Library path:' replace it with the following path:

Code: [Select]
$(BDS)\lib;$(BDS)\lib\Obj;$(BDS)\Imports;$(BDS)\lib\DelphiZLib.128;$(BDS)\lib\FastMM4991;$(BDS)\lib\GifImaged2010b;$(BDS)\lib\JCL1_22\source;$(BDS)\lib\Kdl32;$(BDS)\lib\OverbyteIcsV7Gold\Delphi\Vc32;$(BDS)\lib\TRegExpr\Source;$(BDS)\Projects\HFS;
9] Go to the menu 'File' and click on 'Open Project...' and locate the file 'hfs.bdsproj'.
10] Go to the menu 'Project' and click on 'Options...' and the 'Project Options' will open.
       There, click on 'Compiler Messages' and on 'Warnings', uncheck the following items:

Code: [Select]
    - Deprecated Symbol
    - Platform Symbol
    - Return value of function might be undefined

(This entirely step 10 is optional, but recommended. If you don't do it, you will encounter 32 or 33 Warnings on compiling time, but this doesn't affect the compilation process and you will get the very same functional executable. Those warnings are not important, but informative).

11] Finally, go to the menu 'Project' and click on 'Build hfs' and wait the process to finish.
       Once finished, you will see (in bold text): 'Done: Build All', click on 'OK' and it's done.
       You will find the new executable hfs.exe on this folder: C:\Portable\TDLite\Projects\HFS

12] Enjoy! :)

If you need a tool to unzip/uncompress, you can use 7-Zip.

If you want to use another folder path location (for example to run it from a USB drive), it's better you complete steps one to six from those locations, and then move that folder to the USB before running step seven. This way, you don't mess up with folder locations. Of course, if you choose another folder, you need to change the path in all the steps, but do NOT change the path of step eight (since it will auto-detect the new location).

» WARNING: the instructions and libraries found on this post are outdated, since latest HFS versions were compiled using the new Delphi 10.3.3 Community Edition. My instructions were only valid to old HFS versions (up to v2.3m). Instructions could have changed since then, and now you have to use the latest libraries listed here. This post will be updated on the future.

» DISCLAIMER: I'm not making me responsible for any damage or miss-configuration on your PC. Always backup first, and keep in mind this tutorial was done on fresh installed Windows computer. If you already have any version of Delphi, running this portable version of 'Turbo Delphi' could lead you to problems, so avoid using it on a PC with Delphi installed. My uploads are untouched and virus free, but you must re-check that the MD5 file checksums are the same, as follows:

Quote
hfs2.3m.src.zip / MD5: AE2C3025B36FFF2BC72DB5FF7784C4BD
HFS.Libraries.zip / MD5: 7751002A930B7C211BFC1F9C7AA1853C
PortableTurboDelphiLiteInstaller10d.exe / MD5: 9B24FA6BD91FAF9ACA8AEA78B90AEF07
(You could use the freeware HashCheck to verify the MD5 file checksums)

» HFS.Libraries.zip Download link:
https://www.4shared.com/s/fsY2jRS7Tda
http://www.mediafire.com/?z32tkfzezfx36i7

Feel free to leave a comment or ask any question if you have doubts, and also report if you find any problem when compiling, or if you need further help.

Cheers,
Leo.-
« Last Edit: March 25, 2021, 11:15:12 PM by LeoNeeson »
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 740
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
(This space is reserved for future use, please ignore this)
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 740
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
With this, I could say that I'm a 'virtual member' of the group of users who can compile HFS, and I hope I could contribute in the future (to Rejetto) with small and tested modifications (that's in the case he likes something I could do, but if he don't, at least I will publish it here so anyone could benefit of it). For the time being, I don't plan to implement any change (I currently don't have too much free time, and I've spent too much time and energy on getting everything working, along with doing this tutorial for the benefit of anyone who could be interested on compile HFS).

I encourage that any member, with a basic level of Pascal/Delphi knowledge, feel free to join the virtual group of 'compilers/programmers', contributing (here on the forum) with any change, modification or enhancement that could have in mind (even leaving new ideas). That doesn't mean Rejetto automatically would incorporate those new ideas in HFS, but perhaps if something is good enough, he could take some of those contributions. Team work is always positive in the open source world. ;)

Cheers,
Leo.-
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline bmartino1

  • Tireless poster
  • ****
    • Posts: 901
  • I'm only trying to help i mean no offense.
    • View Profile
    • My HFS Google Drive Shared Link
I appreciate this LEO. Thank you Rejetto for this program and code, and Thank you Mars and many other users on the form for this software.

I have tested it and can confirm that this process works.

I will not that the warning messages were not 100% necessary to disable:
    - Deprecated Symbol
    - Platform Symbol
    - Return value of function might be undefined

I have created a sfx zip (self extracting exe zip file that contains the portable application, the lib files and current hfs source file 2.3m)
https://drive.google.com/file/d/1UntWvAcJcHgXMoHD14ThB7SQy2NGywtE/view?usp=sharing

* This zip has successfully built hfs and is also in the folder. you will have to delete hfs.exe form
% path% \ TDLite \ Projects \ HFS \ hfs.exe

run the portable application and build.

Thank you Leo for this, I will now be able to review the code for a bit easier and may find the kink in the chain from my previous attempt form last attempt at this.

https://drive.google.com/file/d/1A2YNVyo17jxtjG6ih5gDwAswhbzxHrUM/view?usp=drivesdk
« Last Edit: July 31, 2019, 06:40:42 PM by bmartino1 »
Files i try to keep and share can be found on my google drive:

https://drive.google.com/drive/folders/1FOWi3Gqaldld6JLXvZ-biDv4RSguf0IC



Offline newbie

  • Occasional poster
  • *
    • Posts: 38
    • View Profile
Hi,
I'm trying to compile the HFS 2.4.0 RC07 codebase with instructions from this thread, and I'm encountering the following errors.
[Pascal Fatal Error] hslib.pas(33): F1026 File not found: 'system.contnrs.dcu'
If I comment out the use of the system.contnrs lib I get other errors:
[Pascal Error] hslib.pas(209): E2003 Undeclared identifier: 'TobjectList'
[Pascal Error] hslib.pas(309): E2004 Identifier redeclared: 'chop'
[Pascal Error] hslib.pas(314): E2004 Identifier redeclared: 'chop'
[Pascal Fatal Error] hslib.pas(338): F1026 File not found: 'ansistrings.dcu'

Note that the instructions worked just fine for 2.3m, and the current build is attempted on the same machine.

Any suggestions would be appreciated.

Thanks


Offline SilentPliz

  • Operator
  • Tireless poster
  • *****
    • Posts: 1298
  • ....... chut ! shh!
    • View Profile
Hi,


HFS 2.4 is compiled with Delphi 10 now.

Quote from: rejetto
hi guys,
this days i had some spare time, so first i reinitialized my Windows system after 5 years. Muchi better now!Then i decided to try to go for Delphi 10.3.3, that is the latest free version (it's callled "community edition").
https://www.embarcadero.com/products/delphi/starter/free-download

...
« Last Edit: March 10, 2021, 08:44:14 AM by SilentPliz »


Offline newbie

  • Occasional poster
  • *
    • Posts: 38
    • View Profile
Hi,
I'm trying to build 2.4.0 rc07 with Embarcadero 10.3.3 Community Edition.

1. Do I use the same Library pack as mentioned by LeoNeeson at the top of this thread? Or is there a new one somewhere?
2. Delphi fails to build with this error: "Cannot resolve unit name 'uFreeLocalizer' at line 28 of hfs.dpr" Got past this.
3. I now get an error in uFreeLocalizer.pas
Code: [Select]
WideToAnsiString(ws, s, GetACP);. Modified definition to
Code: [Select]
s: AnsiString; and it got past.
4. Next compile error in OverbytelcsMimeUtils.pas Undeclared identifier errors: TBufferedFileStream(Stream).Mode & TBufferedFileStream(Stream).FastSize

I'm playing whack-a-mole here so it kinda appears that there is a new Library Pack, I need to use.

Thanks
« Last Edit: March 25, 2021, 04:25:44 PM by newbie »


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 740
  • Status: On hiatus (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
@newbie: The 'Library Pack' posted on this thread, was something I've done to simplify the compiling process, but there isn't an 'Official Pack' to download. You have to manually download the latest versions of each libraries (from each author's website), listed HERE. You can find more information about the switch to the new Delphi version, HERE (be sure to read the whole thread).

Summarizing, HFS is currently using these libraries:
  • OverByte's ICS v8.64 by François PIETTE
  • TRegExpr v0.952b by Andrey V. Sorokin
  • JEDI Code Library v2.7
  • Kryvich's Delphi Localizer v4.1
:-[ Sadly, I don't have any free time to update this package, neither to update this post with updated instructions for the new 'Delphi 10.3.3'. It's on my 'to-do list', but I don't have any estimation of when I will be able to complete this (but anyone is welcome to comment here which changes are needed to compile HFS with the new Delphi version).

Cheers,
Leo.-
HFS in Spanish (HFS en Español) / How to compile HFS (Tutorial)
» Currently taking a break, until HFS v2.4 get his stable version.


Offline newbie

  • Occasional poster
  • *
    • Posts: 38
    • View Profile
@LeoNeeson. Thanks for those pointers.

I was able to figure out how to build HFS 2.4.0 rc07.
But it reqd a few lines of code changes. Not sure if its the right changes.

Specifically:
In utilLib.pas:  Line 363-365:
RAD IDE's drop-down helper suggested 2 possibilities: MountPointReparseBuffer or SymbolicLinkReparseBuffer. I chose the former.
Code: [Select]
      if BytesReturned < DWORD(ReparseData.Reparse.MountPointReparseBuffer.SubstituteNameLength + SizeOf(WideChar)) then exit;
      SetLength(Destination, (ReparseData.Reparse.MountPointReparseBuffer.SubstituteNameLength div SizeOf(WideChar)));
      Move(ReparseData.Reparse.MountPointReparseBuffer.PathBuffer[0], Destination[1],
     ReparseData.Reparse.MountPointReparseBuffer.SubstituteNameLength);

Anyway, here's my full Readme.txt that got me up and running w/ 2.4.0 rc07


README for building 2.4.0 rc07

Code: [Select]
Assumption: Installed everything to E:\Portable\TDLite.
If you move it elsewhere, modify include paths in RAD (Step 4a) appropriately

1. Install Embarcadero 10.3.3 RAD IDE Community Edition to E:\Portable\TDLite
https://www.embarcadero.com/products/delphi/starter


1. Install HFS Source
   https://github.com/rejetto/hfs2#libs-used
   2.4.0rc07: https://github.com/rejetto/hfs2/releases/tag/v2.4-rc07
   https://github.com/rejetto/hfs2/archive/refs/tags/v2.4-rc07.zip
   Extract to: E:\Portable\TDLite\Projects\hfs2-2.4-rc07

   Build HFS Data resources:
   Execute: E:\Portable\TDLite\Projects\hfs2-2.4-rc07\recompile_data.bat

3. Setting up HFS Library pack
HFS incl. all all its reqd 3rdparty libs will be installed under E:\Portable\Projects\hfs-lib

Ref: https://github.com/rejetto/hfs2#libs-used
a. Overbyte 8.64: http://www.overbyte.eu/frame_index.html
   Daily archive: http://wiki.overbyte.eu/arch/icsv8w.zip
   Extract to: E:\Portable\Projects\hfs-lib\OverbyteIcsV8_64
b. TRegExpr 0.952b: https://github.com/andgineer/TRegExpr/releases
   https://github.com/andgineer/TRegExpr/archive/refs/tags/0.952b.zip
   Extract to: E:\Portable\TDLite\Projects\hfs-lib\TRegExpr0_952b
c. Jedi CL 2.7: https://github.com/project-jedi/jcl
   Install this git repo to a temp folder somewhere.
   git clone --recurse-submodules -j8 https://github.com/project-jedi/jcl.git
   cd jcl/jcl
   ./Install.bat
   copy *.* E:\Portable\TDLite\hfs-lib\JCL2_7
d. KDL 4.1: https://sites.google.com/site/kryvich/localizer
   kdl41.zip: https://drive.google.com/open?id=0BwH77FLlRxs2RnFRTnMxcnZNbUE
   Extract to E:\Portable\Projects\hfs-lib\kdl41

4. Building in Embarcadero RAD:
   Open E:\Portable\TDLite\Projects\hfs2-2.4-rc07\hfs.bdsproj

   a. Modify include paths:
      In Projects window, right-click hfs.exe and choose "Options"
      Click on "Delphi Compiler" > Search Path, and replace w/:
      $(DELPHI)\Lib\win32\release;$(DELPHI)\Projects\hfs-lib;$(DELPHI)\Imports;$(DELPHI)\Projects\hfs-lib\JCL2_7\source\windows;$(DELPHI)\Projects\hfs-lib\JCL2_7\source\common;$(DELPHI)\Projects\hfs-lib\JCL2_7\source\include;$(DELPHI)\Projects\hfs-lib\Kdl41;$(DELPHI)\Projects\hfs-lib\OverbyteIcsV8_64\Source;$(DELPHI)\Projects\hfs-lib\OverbyteIcsV8_64\Source\Include;$(DELPHI)\Projects\hfs-lib\TRegExpr0_952b\Source;$(DELPHI)\Projects\hfs2-2.4-rc07;
      Save and close.
     
   b. SourceModifications reqd to compile:
      utilLib.pas
      Line 363-365:
      if BytesReturned < DWORD(ReparseData.Reparse.MountPointReparseBuffer.SubstituteNameLength + SizeOf(WideChar)) then exit;
      SetLength(Destination, (ReparseData.Reparse.MountPointReparseBuffer.SubstituteNameLength div SizeOf(WideChar)));
      Move(ReparseData.Reparse.MountPointReparseBuffer.PathBuffer[0], Destination[1], ReparseData.Reparse.MountPointReparseBuffer.SubstituteNameLength);
   
   c. In Projects window, right-click hfs.exe and choose "Build"
 
DONE