Action Script: different file name in _Download?

I tried some different approaches and nothing worked. I was trying to customize a fixlet for EMET 5.1. The download file name for EMET 5.1 is EMET 5.1 Setup.msi. I tried to use %20 for spaces and %2e for period (ex. 5.1). Not working so I decided to rename the filename to EMET_5_1_Setup.msi and prefetch worked. I used sha1 tool to provide the sha1 for this EMET file. I wrote an action script (see below). The ‘continue if’ statement returns the value of false. I peeked at the _Download folder. It contains sha1_1_4be905e4a84e8c1c124aa3545c4584d35ee7d28f. (Note: Ignore the URL below because this system is using offline network so I manually added the sha1 file <4be905e4a84e8c1c124aa3545c4584d35ee7d28f> on the server for console to retrieve.) What am I supposed to do to convert from sha1 to original file name (i.e. EMET_5_1_Setup.msi)? (I used FixletDebugger tool to test my action script).

prefetch EMET_5_1_Setup.msi sha1:4be905e4a84e8c1c124aa3545c4584d35ee7d28f size:11501568

continue if {exists file _Download\EMET_5_1_Setup.msi}

waithidden msiexec /i _Download\EMET_5_1_Setup.msi /qn /norestart

action requires restart “4be905e4a84e8c1c124aa3545c4584d35ee7d28f”

The link provided in the example actually doesn’t go to a file download so that’s a problem.

The downloaded file is renamed to the second parameter in the prefetch file (you can call it whatever you want) and placed into the Download directory when the action begins

Edit: argh dunno how to escape underscores. In this description both BESData and Download are preceded by two underscores.

The file will be named EMET_5_1_Setup.msi and placed in the Download folder beneath the site from which the action was run, only while the action is executing as @AlanM states. Until then it’s named for its sha1 value in a download cache area (that you have no need to access). When you need it, it’ll be somewhere like BESData/opsite101/Download.

I’ve had problems with a few fixlets dealing with quotes on the waithidden line, so I generally build a .cmd first and then execute it. You also might have problems with using the 32-bit msiexec by default as BigFix is a 32-bit application.


// replace with real url. Hint: … is the wwwrootbes folder on your bes server. You can create folders and put stuff there.

begin prefetch block

prefetch name=EMET_5_1_Setup.msi sha1=4be905e4a84e8c1c124aa3545c4584d35ee7d28f size=11501568 url=
collect prefetch items
end prefetch block

action uses wow64 redirection false

delete __appendfile

// used a prefetch block so the relevance in this line doesn’t error out during prefetch, when the file doesn’t yet exist

appendfile start /wait msiexec /i “{pathname of file “EMET5_1_Setup.msi” of download folder}” /qn /norestart

delete install.cmd

move __appendfile install.cmd

waithidden cmd /c install.cmd

action requires restart “4be905e4a84e8c1c124aa3545c4584d35ee7d28f”

Hi Turyturbo,

Try this (I have not tested the waithidden statement):

prefetch EMET_5.1_Setup.msi sha1:4be905e4a84e8c1c124aa3545c4584d35ee7d28f size:11501568 sha256:191c57c636c7916e0ff9e30d4f91f5ccbb6fb935fffe6e7548c06ec92f344f0f

waithidden msiexec.exe /i __Download\EMET_5.1_Setup.msi /quiet /norestart

As Alan mentioned, you are not using the correct download link. You can obtain that link by visiting the download page in your browser, download it, and get the link from your browser’s download history.

Hi BaiYunfei, JasonWalker and AlanM:

Thank you very much for replying my post. I tried both solutions provided by JasonWalker and BaiYunfei. They worked nicely.

Regarding the link I posted for downloading the file, thank you for correcting me. I assumed that it automatically downloaded the file once it visits that link because when I copied/pasted that link into my browser and it automatically download that file for me. That’s why I assumed that link is the one. Now I learned something new about ‘download history’ providing the ‘absolute path’ link.

thumbs ups