Search code examples
opensslgzipgunzip

gunzip on windows with gzip


I am trying to use a "gunzip" command on windows as part of a build process that is rigid and cannot change. Basically in order to compile the FIPS canister for OpenSSL, you have to follow a few commands, and you cannot deviate from them.

This means I have to unzip the source tarball using gunzip as per the documentation (https://www.openssl.org/docs/fips/SecurityPolicy-2.0.12.pdf, Appendix A).

So far I have found GZip for windows (http://gnuwin32.sourceforge.net/packages/gzip.htm), however I cannot understand how this makes the gunzip command available. I can see a "gunzip" file, and how that works with the only executable in the installer, but I cannot see how you can run the command "gunzip".

Am I missing something obvious here?


Solution

  • To keep compression and decompression logic together, there is one program and command gunzip actually runs gzip program with option -d. On Unix a script using !# syntax does this invisibly.

    To do the same on Windows, assuming you put gzip.exe in a directory in your PATH, in the same place (or another PATH dir) create a file gunzip.bat containing gzip -d %*. Or to make the output look nicer, @echo off then gzip -d %*.

    gunzip -c file | tar x... should then work as desired (assuming you also have tar).