Error - File was not marked for prefetch in download pre-pass

(imported topic written by mPenuel91)

Quick background - the actionscript prefetches a file that runs a .hta, the user makes selections (in this case languages) and a .txt file is created (via .hta code). I then check for the existence of a file and attempt to download the assoicated language pack, however it keeps failing on the “download” or “prefetch” command with the following message in the local BF log file -

“Command failed (File was not marked for prefetch in download pre-pass ‘http://server.domain.com:52311/CSTData/Office2010/FrenchLP.exe’) download http://server.domain.com:52311/CSTData/Office2010/FrenchLP.exe

I get this rather I use a prefetch command or a download command. Here’s my actionscript:

If {not exists folder “C:\Support\BigFix\Office2010Install”}

dos mkdir “C:\Support\BigFix\Office2010Install”

endif

//download Office 2010 Install

prefetch Office2010.exe sha1:1d1c157fd3ab94a6669ae1b3e2e8687a8ce7aae1 size:693770447 http://server.domain.com:52311/CSTData/Office2010/Office2010.exe

//Run the main .exe

wait __Download\Office2010.exe

//Run some pre-install routines

wait C:\Support\BigFix\Office2010Install\Pre-Work.exe

//Run the extracted .HTA file

wait C:\Support\BigFix\Office2010Install\RunAsCurrentUser.exe --w {pathname of file “mshta.exe” of system folder as string} “{“C:\Support\BigFix\Office2010Install\Office2010.hta”}”

//Check for Language Packs

if {exists file “C:\Support\BigFix\Office2010Install\French.txt”}

download http://server.domain.com:52311/CSTData/Office2010/FrenchLP.exe <-----HERE’S WHERE IT FAILS

wait __Download\FrenchLP.exe

wait C:\Support\BigFix\Office2010Install\Customizations\Languages\French.exe

endif

//Set Default Language

wait C:\Support\BigFix\Office2010Install\SetDefaultLanguage.exe

//Clean up

delete “C:\Support\BigFix\CleanUp.exe”

copy “C:\Support\BigFix\Office2010Install\CleanUp.exe” “C:\Support\BigFix\CleanUp.exe”

wait C:\Support\BigFix\CleanUp.exe

I haven’t been able to find any info on this in the BigFix forums, please help. I can try to provide any info you may need.

Thanks in advance.

(imported comment written by BenKus)

Hi mPenuel,

This one is tricky but it is addressable…

The problem is that the agent will try to download the files before an action runs so it doesn’t need to wait in the middle of the action to go download the files. To accomplish this, the download manager for the agent will evaluate the action looking for download commands and figuring out whether it should download the files in the “if” blocks. In this case, the file “C:\Support\BigFix\Office2010Install\French.txt” doesn’t exist yet so the FrenchLP.exe file isn’t downloaded… Then when the agent runs the action, the file isn’t available to use…

There are various ways to try to address this, but the easiest will be to move the download command for the FrenchLP.exe file outside of the IF so it will always be downloaded.

Ben

(imported comment written by mPenuel91)

Thanks for the reply Ben however these are Office 2010 language packs so they are each (12 total) around 400-700MB. I was only wanting to download the languages they needed/wanted which is why I was trying to execute the download in an if statement.

Is there a better way to do this? I need a way for the file(s) to only be downloaded based on a condition. Can BigFix/actionscript not do this?

Thanks in advance.

(imported comment written by mPenuel91)

Would creating a separate task for the installation of the language pack then putting it in a custom baseline work for what I need to do? For example I have a task that installs Office 2010 and create .txt files based on language selections then the next task run only if certain .txt files exist?

(imported comment written by BenKus)

You can conditionally download files based on relevance… however, you cannot easily conditionally download files based on results of the same action… You could make a baseline to output the file in the first action and then in the next action(s) download the appropriate files… Alternately, you could try to find an attribute of the computer that exists before the action runs… for instance, you might try something like:


if { system language as lowercase contains “french” }
download http://server.domain.com:52311/CSTData/ … enchLP.exe
wait __Download\FrenchLP.exe
wait C:\Support\BigFix\Office2010Install\Customizations\Languages\French.exe
endif

Note that if you have these big files, it is better to use the prefetch command rather than just the download command because caching on the server/relay is more efficient when the sha1 of the file is known (as is the case with the prefetch command).

Ben