Friday, 28 August 2009

Add DirectX as prerequisite for Visual Studio installer

I've just spend a couple of days building installers with Visual Studio, and I thought I'd blog about what I've learned...

Prerequisites
Visual Studio allows you to define Prerequisites, which are components required for your software - for example, if you're writing anything in the .Net Framework, you'll need to include the correct version of the Framework as a prerequisite in your installer.

To set prerequisites, right-click the install package you've created, click properties and then click the Prerequisite button. You can also set prerequisites on a project BUT this doesn't seem to affect the installer so always set them on the installer - this caught me out for a while!!

My Prerequisite isn't in the list!
The list of prerequisites for Visual Studio 2008 comes from "Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages" (the location is different for VS 2005). There you'll find a bunch of folders ("Bootstrappers") for each prerequisite. Each folder contains the install files for the prerequisite, a product.xml file (which details the files and how to handle them), and some language specific folders (e.g. "en" which contain language specific licence files and a package.xml file).

If your prerequisite isn't on the list then you can make your own. I've explained this process below for DirectX.

Download or Distribute
When setting your prerequisites, you can specify whether they should be included in your install folder, or whether the installer should download them if they're needed. This can be good because, for example, it's probable that your user already has the .Net Framework installed and so you don't want to include all those files in your installer - simply get them to download it if they need it.

You set this option by choosing either "...from the component vendor's web site" or "...from the same location as my application" on the VS prerequisites window.

This works by setting a url download link in either the product.xml file or the package.xml file which is then integrated into the installer. Have a flick through the .Net Framework ones to see it in action.

.Net Framework 3.5 SP1
If you need the .Net Framework Service Pack 1 as a prerequisite, and it's not in your list, don't panic like I did. You don't have to make your own - installing VS 2008 SP 1 will create this bootstrapper for you... BUT it's got a big bug - it doesn't include the install files! Again, don't panic - there is a fix as described here.

Creating a DirectX prerequisite.
I needed to install DirectX as part of my installer. Frustratingly, I couldn't find a bootstrapper anywhere. I'm a bit surprised - this seems like the kinda thing that Microsoft should produce with each version...?

In the end I wrote my own. Rather than hand coding the xml, I used the Bootstrapper Manifest Generator to do it for me. You'll need to download the installer package for you, find the correct download url for the same package's web installer, and have a correct version check to make sure it's not already installed. After a quick check on Wikipedia, I put in a registry check for DirectX version 4.09.00.0904.

Once you've created all your files and put them into the correct place, VS finds them and offers you your new prerequisite option.

Friday, 27 February 2009

Music on demand



I've been using Spotify today.  It's not a treatment for acne; it is in fact a "free" music on demand service.  Like itunes, it allows you to choose music from it's online library but, unlike itunes, you can stream it for free.  In return you have to sit through a short advert every 20 mins.  You can pay a monthly or daily subscription to avoid the adverts.



I like the idea and I like their interface - it's quick and easy to use and seems to have a lot of music available.  The monthly subscription price is £9.99 which would translate into probably about 1 CD, but with this service you can listen to a whole load of new releases every month.  I guess it's a weigh-up of how much music you currently buy and how you like to listen to it.  I listen to most of my music whilst I'm working, so it makes me a happier man!

Thursday, 27 November 2008

Monday, 6 October 2008

How to get to sleep

Sorry for posting so many videos - couldn't resist this one...


Thursday, 25 September 2008

Monday, 12 May 2008

Thursday, 1 May 2008

Month Review - April


The months are disappearing this year! Classic blog apology - sorry for the lack of activity on this blog - I've been quite busy!

It's been a good few months. Songsmith's really starting to take shape - most of the functionality is there, so I'm tidying things up and getting some feedback before I start to finalise things. The closer it gets, the more excited I am that it'll be a great product!

This month, I've also paid myself for the first time! It's the first pay I've received since I left my job in December. I've done a bit of work on the side, building a website and playing at an event which has meant I've had the funds coming into the company to allow a salary. It's a step of faith that things will continue to progress.

I incorporated (became a limited company) back at the start of April, so I'm now officially a company Director. I thought about putting it on my email signature, but I think it sounds a bit pretentious still! Perhaps when I start selling units I might do that...

Wedding plans are coming along well. The invitations went out over the last couple of weeks, and these have been hard work to do! My wonderful fiance has worked her socks off to create them, and we've both spent many long nights cutting, sticking and writing them.

Lessons

One of my big lessons from the last few months is to set good deadlines. I've given myself a few tough but realistic deadlines, and have pretty much met them all, but the best thing about this was that it made me focus my work. It's so easy to be distracted by fiddling with stuff, but when you know you need something done by the end of the week, it helps to clear the mind! I've obviously worked with deadlines before, but when you don't have anyone over you, telling you what to do, I've found it quite a steep learning curve to figure out how best to make me work!

Welcome to May!