For my first entry I would like to talk about ClickOnce. It is a very cool technology allowing you to automatically update you Windows Forms application. One feature that has been talked about is that you can add your own prerequisite to the application. In fact there is even a tool that you can use to generate the manifests requires here: http://www.codeplex.com/bmg there is also an article about how to use it here: http://www.codeproject.com/useritems/Add_Custom_Prerequisite.asp. I also learned how to do this process manually which is what I want to talk about in this post.
The first thing I did was create a standard Windows Installer for my application. The application I tested this with was a Windows Forms application, but it could have been a Console Application.
Next I copied the application to a language subfolder to a subfolder of the BootStrapper folder. The default location looks like this:
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\(packagenamehere)\en
Inside this folder I have the MSI Installer I created and a new xml document called Package.xml. Here is what my package.xml document looks like:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" Name="HelloWorld" Culture="En">
<PackageFiles CopyAllPackageFiles="false">
<PackageFile Name="HelloWorldSetup.msi"/>
</PackageFiles>
<Commands Reboot="Defer">
<Command PackageFile="HelloWorldSetup.msi" Arguments="">
<ExitCodes>
<DefaultExitCode Result="Success" FormatMessageFromSystem="true"/>
</ExitCodes>
</Command>
</Commands>
</Package>
You would just need to change the HelloWorld to what you named your application and MSI file (My MSI file is called HelloWorldInstaller).
There is only one more thing you need to do to make the prerequisite work. You need another xml document in the folder one level up. In my example the folder would be here:
C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\(packagenamehere)
This xml file is called Product.xml and it looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<Product
xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"
ProductCode="HelloWorldSetup"/>
Once again change the ProductCode to match the installer name. That’s it. When I go to publish a ClickOnce program, the HelloWorld prerequisite is available to me just like any other.