BFArchive.exe not extracting where I'd like

I’m having trouble using BFarchive. I cannot seem to make it extract in a different directory. The only time this works is if I have everything in the same spot, BFArchive.exe, the archive.tmp file and I don’t specify a target path. If I do that it will extract the file locally… (then again, only manually, if I run the extract as a BF action from __download, it does not extract anything) .

In other words, if I do this by hand in dos:
c:\archivesource\BFarchive.exe -x output.tmp
I will get my file.csv file back in the same directory…

If I do it as an action:
DOS __download\BFarchive.exe -x __Downlaod\output.tmp
nothing happens.

Using “extract” instead of BFArchive also fails - should it work?

Any attempt at specifying a path for the extraction results in “failed to create directory” (not trying to, it already exists) or “failed to open or create file” or if I specifile a path+file name it creates a folder!

Seems like simple little tool, what on earth am I doing wrong ?

BFArchive could come from multiple places (so you get unfortunately different results depending on the version built) so I’d much more suggest that you use the extract command

For some 8.2 platforms and for all 9.0+ platforms you can do the following:

 extract <archive name> <directory to extract to>

By default the extract command will extract into the __Download directory. With the optional parameter you can tell it the directory to extract to.

Thanks. Sadly Extract filename.tmp directory Location fails as well… NO explanation, just “failed”.

All I was doing was compressing an excel csv file with BFarchive (that works), I get an output.tmp. Running an extract with BFarchive only outputs the original file back in the directory it was created ! No parameters work in terms of target… Anybody got an example of syntax that worked for them?
V9.2…

And it won’t extract with “extract”, only with BFArchive !

EDIT: much more success with BFArchive8.0000 - I was using the latest from IBM’s website, it’s not a good one, for me anyway.

Did you use quotes around the directory?

extract “archive Name” “Path\Of\Destination Directory”

Also, it looks like you have a typo:

It could depend on how the archive was created as well. If it was created as a “relative” archive it will extract in a relative directory. If it was created as absolute paths, then it will extract only to there.

Thanks guys… No typo, I was just working on different machines and didn’t copy/paste but retyped…

All I can say is I redid it all with BFarchive 8.0 (both the archive and the extract), straight from the __Download folder and, it takes switches and outputs exactly where I want it to - while 9.2 told me to go pound sand all morning ;-(

The correct syntax appears to be (shortened example)

prefetch BFarchive.exe … (sha1 etc…)
Download output.tmp… (no sha1 here because it will change daily and get stuffed into the uploads folder via a script/task, whatever)
DOS __Download\BFArchive.exe -x “__Download\output.tmp” “c:\Archive\result”

And presto, in the result folder I get my extracted csv file…

It shouldn’t have been this hard if not for 9.2 absolutely not playing along…
BFArchive.exe 8.0 for the win !

Seriously, for less frustration and better portability, use a real zip program to create self-extracting archives. It’s easier, more portable, and allows for distributing the same archives outside of BES.

I personally like 7-zip, but just about any zip program can create self-exrextracting .exe archives.

The 9.2 extract archive capabilities are pretty good. Again it would depend on the archive itself as to how it was created. I’d love to get a sample copy that you were having problems with to try.

1 Like

It really should just be a matter of recreating the archive file and then retesting it using the extract command. It just seems like there is something slightly off.

I am having the same issue where I can’t get the archive to extract using a fixlet. If I try the extract using cmd line it works normally. I have even tried using 7zip to create a self extracting file, and I can get it to work via a command line with the following command taddmasd.exe -o “E:\taddmasd” -y how ever when I try to run it with either of the following tasks, it gives me an exit code of 1

waithidden cmd /c “{pathname of storage folder of client}\taddmasd\taddmasd.exe -o {pathname of storage folder of client}\taddmasd\taddmasd -y”

waithidden cmd /c “{pathname of storage folder of client}\taddmasd\taddmasd.exe” -o “{pathname of storage folder of client}\taddmasd\taddmasd” -y

I have tried using bfarchive.exe as well and from a command line it works well however I get the same exit code = 1 when I try using it as well

waithidden cmd /c “{pathname of storage folder of client}\taddmasd\BFArchive.exe -x taddmasd.tem {pathname of storage folder of client}\taddmasd\taddmasd”

waithidden cmd /c “{pathname of storage folder of client}\taddmasd\BFArchive.exe -x taddmasd.tem” “{pathname of storage folder of client}\taddmasd\taddmasd”

Any help in getting this to work would be greatly appreciated.

I’m not as familiar with 7zip, but it could be something as simple as the self extracting archive is running 64 bit code and might not like running in the “32 bit” Program Files directory.

As to a BigFix archive, why are you using BFArchive.exe and not “extract” which is the Agent’s version of the same functionality and the most recent version of the code.

Honestly, have not heard about extract until today. I will give it a try, but I think I am going to run into the same situation. I have a feeling it is in the way I am writing the code for it to do the extract.

Your quotes are misplaced, they should surround the path/filenames but not the entire command line or parameters. You also don’t need the cmd /c.
try

waithidden “{pathname of storage folder of client}\taddmasd\taddmasd.exe” -o “{pathname of storage folder of client}\taddmasd\taddmasd” -y

Just had a similar issue with the v9 x64 windows bfarchive. If gave me an error “failed to create directory”, but the v8 32bit windows BFarchive works great.

This was: https://github.com/bigfix/bfarchive/issues/5

I’ll try to get a release including this fix on the wiki as soon as possible.

I added a new release on github and I updated the wiki page with a version that fixes this bug (9.3.0). If there are any more issues, please continue to report them either on github issues or here in the forum.

With most of these options like: extract command, or 7zip, or unzip, or BFArchive.

If they fail, it can often be because the directory you are trying to extract to does not exist already. You can use the “folder create” actionscript to create the destination folder ahead of time.

folder create "c:\temp"

Here is an example of a task that uses the unzip.exe that IBM hosts to extract the 7zip command line tool and then uses the 7zip command line tool to unpack a Setup.exe file:

http://bigfix.me/fixlet/details/3827

I use this idea in general in many fixlets and tasks. I like this option because it allows me to use the power of 7zip with no external dependencies within the ActionScript.


For tasks that interact with the RESTAPI, I use a combination of Unzip.exe, the 7zip command line tools, and CURL all loaded dynamically so that none need to be present on the endpoint before or after my use within the ActionScript: (Thanks to the utility cache, they do not need to be downloaded multiple times)

http://bigfix.me/fixlet/details/3876