Archive for March, 2008

Customising your ClickOnce deployment

March 24, 2008

Here are some tips which came in handy for me when I was creating my first ClickOnce deployment in Visual Studio 2008.

Deploying custom file(s)

If you have some custom file(s) which are required by your application then you can simply add them into your project as you would normally and change the properties to make sure they are deployed with ClickOnce.

  1. Add required file(s) to you project
  2. Change the Build Action property to Content
  3. The file will now appear under Project Properties -> Publish -> Application Files

Creating custom prerequisites

If you have some prerequisites in the form of setup files or msi’s then you may want to install them as part of your ClickOnce deployment. For this you will need to download the Bootstrapper Manifest Generator application which funnily enough is now installed via ClickOnce. This application allows you to create custom packages (or bootstrappers) with the necessary XML manifest files to use with ClickOnce (or Windows installer) projects.

  1. Start the Bootstrap Manifest Generator application and create a new Package Manifest project
  2. Enter a project name and then add an install file
  3. Enter a display name for the package. At this point you can also define system checks, install conditions and many more options which I will look into another day 😉
  4. For VS 2008 you need to update the Project -> Properties (F4) to change the build location of the package.
    Project properties
    C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\<PackageName>
  5. Now build the package to ensure there are no warnings or errors.
  6. The package will now appear under Project Properties -> Publish -> Prerequisites