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.
- Add required file(s) to you project
- Change the Build Action property to Content
- 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.
- Start the Bootstrap Manifest Generator application and create a new Package Manifest project
- Enter a project name and then add an install file
- 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 😉
- For VS 2008 you need to update the Project -> Properties (F4) to change the build location of the package.
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\<PackageName>
- Now build the package to ensure there are no warnings or errors.
- The package will now appear under Project Properties -> Publish -> Prerequisites