jonelo / jacksum-for-windows

Installation program to add Jacksum (CLI) and HashGarten (GUI) to Microsoft Windows. It also adds functions to the Send To menu which is accessible by the Microsoft File Explorer and other file managers. Comes also with an uninstaller.
GNU General Public License v3.0
9 stars 0 forks source link

Default path to save checksums --> in "root" folder #2

Closed ACCakut closed 1 year ago

ACCakut commented 1 year ago

Hi Johann,

is there a possibility to automatically set the output folder to the path to the "root" directory of the hashed files? E.g. I have 10 files in a folder, select them, send to Jacksum 1) and then have the txt file at the folder the files are from?

Intended usage: Hash some files and subdirectories and save the checksums consistently in e.g. SHA512SUMS in the same folder. If many files are selected, the heuristic, where this "same folder" is, is of course more complicated. But, using the send-to-function it should be easily the common parent path. E.g. C:\test\file1, C:\test\folder, C:\test\folder2\file makes it C:\test\ whereas C:\test\file and C:\Users\...\file2 can throw an error since there is no element given that is in the common parent C:\.

Thanks,

ACCakut

jonelo commented 1 year ago

Hi ACCakut,

thanks a lot for the feature request which makes absolutely sense to me. Therefore I have modified both HashGarten and also the send-to script of the Windows Explorer Integration. The new default behavior works the following way for now (I have just published the Windows Explorer Integration v2.5.0):

In the mode "calculate hash values", the initial value for the standard output will be a file called ".SHA512" (if you select SHA512; actually it get the extention dependent on the algorithm that you have selected). The file will be stored in the same directory as the directory of the first entry that have been passed by the send to mechanism. I think that should cover most of the cases, because from now on the file containing the hash values will be stored in the folder that you have selected at the Windows explorer. If you just select a file rather than a folder, the output goes to the directory where that file is being located, so file and its hash value are located in the same folder. You can still modify standard output text field manually if the new default value does not match your need.

In mode "Verify hash values", the verification filename will be initialized with the path that have been given at the "Paths are relative to" textfield so that the corresponding checksum files can be read. Also the filename will be called ".SHA512" (if you select SHA512).

For now that ".<algo>" schema for the filename is hardcoded, but I could make it customizable in a later release as well if there is demand for it.

Please let me know whether the change helps, I appreciate your feedback.

Thanks, Johann

ACCakut commented 1 year ago

Awesome! That works the way I appreciated. Now I can begin to persuade my colleagues to hash all the folders with 2-clicks in a cross-plattform compatible way.

Also. many thanks for your excetionally detailed answer.