[simage=129,288,y,left]I’m not the world’s biggest fan of Juniper’s VPN software offering, for a number of reasons including its annoying client requirements and terribly annoying host checker. While downloading a large SQL dump, though, I noticed that the client on my Mac is reporting download speeds using some funky notation that I haven’t seen since the 11th grade. Can’t wait til this software gets replaced.
After a recent post that included a couple of small .zip files for download, I decided I might want to track how many times my files had been downloaded. A Google search for ‘wordpress download monitor plugin’ yielded the aptly named WordPress Download Monitor plugin. At first glance, it seemed as if I would need to re-upload anything I wanted to count downloads on, which seemed like a pain, but I figured if I decided later I had to have a count, it would just be more downloads to re-upload, so I decided to install it and try it out.
The install was typical–upload to your plugins directory and go activate it in the admin section of your site. The first clue that I was in for a treat is right there in the description of the plugin–it tells you where its options page is. Once in the management area, I immediately noticed that you can either add an Existing or a New download to track. Adding an existing download was as simple as pointing the plugin to the URL and giving it a title. Download Monitor then offers 4 simple ways to integrate the plugin into your post using simple bracket tags and the unique ID of the download. You can specify whether to show a link to the download and a count, just a count, or just the download. There’s also some handy PHP functions that you can use to show your top downloads, etc.
All in all, this seems to be a really great plugin. I was worried at first that I might have to lose a bunch of time re-uploading stuff, but obviously that eventuality was accounted for by Mike Jolley, the brains behind Download Monitor. Other than that, it works for keeping a count, and it’s easy to use. The only thing I might think to improve is that some sort of download image could be added as an option, much like the really nice one on the plugin’s homepage. That will bring more attention to the download and separate it from the general flow of the story. Other than that, I’m a happy camper.
If you’ve worked with MSIs before, you’re aware that you can either stream setup files with the MSI directly, or attach them separately in .cab cabinet files to be extracted at run-time. The former method saves file space: when the user installs the program, only the MSI is cached in WINDOWS\Installer, so the data in the cabinet does not occupy space on the user’s hard drive. The downside, of course, is that you can no longer get clean copies of those files during a re-install unless you have the original installation media. The other major downside, from an Active Directory standpoint, is that you can only push single MSIs with Group Policy, not multi-file installs.
So, if you have an MSI with a separate .cab file, what’s the easiest way to stream that cabinet? First you’ll need the Windows Installer SDK (available separately from the 1.2Gb Microsoft Platform SDK as a 7.9Mb download here). In there is a program called msidb.exe. Its only mission in life is to pack .cabs into .msis, so it’s appropriate for the task. If you’re into esoteric stuff like that, you can check out the full docs here.
1) Put the .cab and the .msi in the same directory as msidb.exe.
2) Open a DOS prompt and navigate to the directory with msidb.exe in it.
3) Run the following command, replacing the defaults with the names of your MSI and CAB files “Msidb.exe -d mydatabase.msi -a mycab.cab”
4) In the Media table of your MSI, rename the link to the .cab file with a # sign in front of it. In other words, if your file is called Data1.cab, the Cabinet column of the Media table should now read #Data1.cab.
Your MSI will now look inward to find the files it needs, and after all, isn’t that what world peace is all about?