How works 'extract'?

(imported topic written by Harald.Zarakowitis)

Hello,

I am working on this for a while now…I´m trying to download an archive from a web server, extract it and call an .msi from the archive.

The archive contains one folder ‘cisco’

Download and extract is successful according to the log.

This is the action script after the download command:

extract cisco
dos net stop "Cisco Systems, Inc. VPN Service"
if {exists file "C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe"}
   wait msiexec.exe /x "C:\Install\Cisco VPN Client 48\vpnclient_setup.msi" /qn
endif
wait msiexec.exe /i __Download\cisco\vpnclient_setup.msi /qb

This however does not work, because the .msi is not found. According to the specs ‘extract’ should unzip the files to the __Download folder, shouldn´t it? How do I have to write this?

Best regards,

Harald

(imported comment written by brolly3391)

Hello Harald,

I am guessing that the .zip file that you are trying to extract is located in the __download directory and is named cisco.zip.

Give this a go?

extract __download\cisco.zip
dos net stop "Cisco Systems, Inc. VPN Service"
if {exists file "C:\Program Files\Cisco Systems\VPN Client\ipsecdialer.exe"}
   wait msiexec.exe /x "C:\Install\Cisco VPN Client 48\vpnclient_setup.msi" /qn
endif
wait msiexec.exe /i "__Download\cisco\vpnclient_setup.msi" /qb

You also might want to consider either /qb! or /qn as your quiet MSI parameter.

/qb! shows the basic progressbar without the cancel button.

/qn shows no progressbar at all.

Cheers,

Brolly

(imported comment written by jessewk)

Harald,

If you look in the __Download folder after the extract command has run, are your files there? I suspect the “cisco” folder might not be there, but all the files that are supposed to be in the “cisco” folder are instead in the root of the “__Download” folder. Is that correct?

-Jesse

(imported comment written by Harald.Zarakowitis)

brolly33

wait msiexec.exe /i “__Download\cisco\vpnclient_setup.msi” /qb
You also might want to consider either /qb! or /qn as your quiet MSI parameter.
/qb! shows the basic progressbar without the cancel button.
/qn shows no progressbar at all.

My intention is to uninstall the old version completely hidden, but install the new version with the progress bar, just for an additional information to the user.

Nevertheless, the extract command works fine. So BigFix finds the archive and extracts it I suppose.

Jesse: I know now what the problem is. I always looked into “C:\Program Files\BigFix Enterprise\BES Client__BESData__Global__Download” directory. While the archive is downloaded there, they are extracted to

“C:\Program Files\BigFix Enterprise\BES Client__BESData\CustomSite_VIE__Download”

The “__Download”-variable does not point there, so the .msi package is not found.

So I had to hardcode the path, but it works now.

Harald

(imported comment written by SystemAdmin)

Hey Jesse…

I’ll keep this question in this same thread. I have a non-MSI setup that I want to ZIP up (multiple files), download to the client and run.

If I temp extract the ZIP into the __Download folder, should I extract it to it’s own subfolder? I’m just wondering how (or if) I should handle the cleanup of the extracted files once the install completes.

-Paul

(imported comment written by jessewk)

Paul,

If you leave the files in the __Download folder the Client will be clean it up for you. If you extract them to a different location, you’ll need to handle removing them yourself.

-Jesse

(imported comment written by SystemAdmin)

Ok, thanks. I’m guessing then it’ll cleanup created subfolders as well. Ex: __Download\SomeFolder

-Paul

(imported comment written by jessewk)

Yup.

(imported comment written by Harald.Zarakowitis)

Can I use ‘extract’ to extract the files to a specific folder and not the download folder? I don´t want them to be deleted.

Thanks in advance,

Harald

(imported comment written by jessewk)

Harald,

The extract command does not accept an extraction path. You will need to use the ‘move’ or ‘copy’ commands after extraction, or a script to move the files out of the __Downloads folder.

-Jesse

(imported comment written by jr6591)

I am trying the move command, but it doesent work.

dos md C:\Software

extract big123.tmp __Download\Software

move __Download\Software*.* C:\Software*.*

I also tried this and it did not work.

dos md C:\Software

extract big123.tmp

move __Download*.* C:\Software*.*

Any ideas? Thanks

(imported comment written by jessewk)

jr,

The move command does not accept wild cards. If there are a lot of files extracted, I would just write out a dos script to move the files. Here’s an example:

delete __appendfile
delete movefiles.bat

appendfile @ECHO OFF
appendfile set my_dest=%1
appendfile mkdir %my_dest% > NUL 2> NUL
appendfile shift
appendfile :Loop
appendfile If !==!%1 Goto End
appendfile If Exist %1 move %1 %my_dest% > NUL 2> NUL
appendfile Shift > NUL 2> NUL
appendfile Goto Loop
appendfile :End

move __appendfile movefiles.bat

run “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” movefiles.bat “c:\path\to\dest\folder” {(concatenation " " of ("%22" & pathname of it & “%22”) of files of folder ( pathname of client folder of current site & “/__Download”))}

(imported comment written by jr6591)

This sort of worked. It move some files over but it did not move the extracted folders. So, in my download directory, i have about 6 folders (with files in them) that were not moved. also it moved the big59.tmp file. Can this be avoided.

extract big59.tmp

delete __appendfile

delete movefiles.bat

appendfile @ECHO OFF

appendfile set my_dest=%1

appendfile mkdir %my_dest% > NUL 2> NUL

appendfile shift

appendfile :Loop

appendfile If !==!%1 Goto End

appendfile If Exist %1 move %1 %my_dest% > NUL 2> NUL

appendfile Shift > NUL 2> NUL

appendfile Goto Loop

appendfile :End

move __appendfile movefiles.bat

run “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” movefiles.bat “C:\CSCSoftware\Off2003Pro” {(concatenation " " of ("%22" & pathname of it & “%22”) of files of folder ( pathname of client folder of current site & “/__Download”))}

run C:\CSCSoftware\Off2003Pro\PRO11UPG.BAT

(imported comment written by jessewk)

Try changing the run command to the following and see if it works as expected:

run “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” movefiles.bat “C:\CSCSoftware\Off2003Pro” {(concatenation " " of ("%22" & pathname of it & “%22”) of descendants whose (name of it != “big59.tmp”) of folder ( pathname of client folder of current site & “/__Download”))}

(imported comment written by jr6591)

This is the original and it moved only the files and not the folders. It also moved the big59.tmp

run “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” movefiles.bat “C:\CSCSoftware\Off2003Pro” {(concatenation " " of ("%22" & pathname of it & “%22”) of files of folder ( pathname of client folder of current site & “/__Download”))}

This is the latest and it didn’t move anything.

run “{pathname of client folder of site “BESSupport” & “\RunQuiet.exe”}” movefiles.bat “C:\CSCSoftware\Off2003Pro” {(concatenation " " of ("%22" & pathname of it & “%22”) of descendants whose (name of it != “big59.tmp”) of folder ( pathname of client folder of current site & “/__Download”))}