rejetto forum

Configure HFS Virtual File System by code

0 Members and 1 Guest are viewing this topic.

Offline vespina

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
I am thinking on including HFS with my software to allow users to download some app-related content without messing with IIS.  My normal installation contains an "Intranet" folder with an index.html and a Files folder inside of it.  The idea is to somehow configure HFS (via INI file) so when user starts HFS it automaticallly load the VFS according to the install location.

I tried replacing paths in a saved VFS files but it seems the file contains some CRC checksum to avoid anyone to mess with it.

Is there any way that I can manually create a VFS file with the correct paths ?

TIA


Offline LeoNeeson

  • Tireless poster
  • ****
    • Posts: 858
  • Status: On hiatus       (sporadically here)
    • View Profile
    • twitter.com/LeoNeeson
You could do it by scripting (THIS thread could give you some light). Keep in mind that Rejetto stopped developing HFS v2.x (he is busy developing his new HFS v3). The most easy solution, is using an already modified HFS version. The only active fork of HFS is maintained by Rapid, which already changed the VFS to ZIP format (with JSON and images, as separate files). I haven't tested it, but you can download it from HERE.

In case you know about programming (Delphi language), another option is modifying the source code and recompiling the binaries (the executable). If I were to modify the sources, I would analyze the possibility of saving the VFS encoded in Base64 (but that's only useful if, before, we convert data blobs from binary to ASCII format), otherwise it makes no sense in just saving the VFS using Base64 encoding. I have no time to think about the changes needed, but if you do it, you could leave the modifications here (to make this useful to anyone).

Hope it helps.
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 vespina

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
Thanks for your answer.  Scripting could be the way to go if there were a way to run a script from command line, which is not supported AFAK.  I think I would have to look for another solution. Its a shame, because this software is awesome.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13521
    • View Profile
hey, sorry for the late answer.
You could experiment with the [server start] event, where you can put your script
https://rejetto.com/wiki/index.php?title=HFS:_Event_scripts

The vfs format is not very complex but neither very easy. THere's no documentation, you should study the sources.
With HFS 3 i decided for simple text format (yaml).