(imported topic written by blinkxzero)
I’m fairly new to writing Fixlets, so I may not know all the best practices and ways to go about creating them. That being said, I’m trying to figure out the correct way to use the BFArchive.exe tool in order to accomplish a simple task.
I’ve seen the documentation available at:
http://support.bigfix.com/cgi-bin/kbdirect.pl?id=452
and also have searched the forums for the proper usage, but I can’t seem to pin it down.
So I really have two questions:
How do I go about invoking BFArchive.exe? Do I need to download it to the client computer via the fixlet and then run it or is this something that should be working straight from the action script?
Here is my work in progress for this fixlet (took out specific names / sizes to generalize):
For the record, the contents of bigfix.tmp is about 15 files (35 MB in size) and there are no subfolders.
// download tmp file from server download <server>/bigfix.tmp
continue
if
{(size of it = <size> AND sha1 of it =
"<sha1>") of file
"bigfix.tmp" of folder
"__Download"
}
// extract tmp to __Download folder extract bigfix.tmp
// copy old files from previous installation to a backup folder waithidden cmd /c xcopy
"C:\Program Files (x86)\program"
"C:\Program Files (x86)\program\backup\"
// delete original files after backup waithidden cmd /c del /q
"C:\Program Files (x86)\program\"*.*
// copy all files from __Download folder to destination waithidden cmd /c xcopy /y /s /c /i __Download\*.*
"C:\Program Files (x86)\program\"
// delete tmp file that gets copied over delete
"C:\Program Files (x86)\program\bigfix.tmp"
This works, except I want a better way of copying the files to the folder without copying -everything- from the __Download folder. I don’t want any residual files or garbage thrown into the install folder.
If using the above method, I want to extract the bigfix.tmp file to __Download\Program\ , and then copy that directory’s contents, but I don’t know the best way of doing this.
However, BFarchive.exe seems the best way to do this task.
Ideally, I’d like my fixlet to do something like this:
// download tmp file from server download <server>/bigfix.tmp
continue
if
{(size of it = <size> AND sha1 of it =
"<sha1>") of file
"bigfix.tmp" of folder
"__Download"
}
// copy old files from previous installation to a backup folder waithidden cmd /c xcopy
"C:\Program Files (x86)\program"
"C:\Program Files (x86)\program\backup\"
// delete original files after backup waithidden cmd /c del /q
"C:\Program Files (x86)\program\"*.*
// extract tmp to program folder BFArchive -x __Download\bigfix.tmp
"C:\Program Files (x86)\program\"
// delete tmp file delete __Download\bigfix.tmp
However, whenever I try and save something like this, BFArchive throws an error as Unknown Action command. I think I am missing a step or logic when using BFArchive.
Any ideas or am I going about this the complete wrong way?