sisong / HDiffPatch

a C\C++ library and command-line tools for Diff & Patch between binary files or directories(folder); cross-platform; runs fast; create small delta/differential; support large files and limit memory requires when diff & patch.
Other
1.52k stars 280 forks source link

Command `selfExtractArchive` show help menu instead of self extracting #387

Closed Mesteery closed 2 months ago

Mesteery commented 2 months ago

Platform: windows 11 When I run [selfExtractArchive] without argument in the directory that I want to patch, it show the help menu instead of self extracting (according to doc: extract SFX: selfExtractArchive (same as: selfExtractArchive -f "" -X "./"))

Code to reproduce

hpatchz diffFile -X#updater.exe
./updater.exe # show help menu instead of self extracting in current directory

By the way selfExtractArchive -f "" -X "./" show error: options -X input count ERROR!. Only selfExtractArchive -f "./" -X "./" works as intented.

sisong commented 2 months ago

The command line argument "" is different from "./", where "" means there is no oldPath, and "./" means that the current directory is oldPath.
Your diffFile is created with an oldPath, so hpatchz thinks that the params count is no enough when run with default parameter "".
If you want to change this default parameter of hpatchz, you can edit the C source code: change oldPath =kSFX_emptyPath; to oldPath =kSFX_curDefaultPath;

Mesteery commented 2 months ago

Thanks you for your fast answer. Indeed your are right I created my diff file with oldPath. But the main issue, is when I run directly selfExtractArchive without arguments by double clicking it (or via terminal), it show help menu instead of self extracting.

sisong commented 2 months ago

Thank you for your feedback;
I maybe modify that default logic in the next version.

Mesteery commented 2 months ago

Thanks you, it works perfectly now!