I plan to post interesting Q&A that I come a cross once in a while.
Feel free to post your question (and answer) too.
Is there a way to customized the download location of the prerequisites of clickonce deployment?
I mean, from a corporate intranet where people cann't access internet, and deployment of framework is not possible, can we change the location of the bits fx2.0?
To change the location from which a perquisite will be downloaded at install-time, you must do the following
1. Open up <VS Install Dir>\SDK\v2.0\BootStrapper\Packages. This directory contains the metadata about each prerequisite understood by the Bootstrapper build engine. The contents of each subdirectory is called a bootstrapper package, and corresponds to an entry in the Prerequisites dialog in VS 2. Choose the directory that corresponds to the prerequisite for which you want to change the hosting URL. In the case of the .NET FX 2.0 bootstrapper package, the dir name is 'dotnetfx'
3. Open the product.xml file. For each redistributable associated with the bootstrapper package, you'll see there's a <PackageFile> tag with a Homesite attribute. This homesite attribute is the URL from which these redistributables will be downloaded form. Because many redists have langpacks, we define a string resource in <locale>\package.xml and reference it in the product.xml file. For .NET FX 2.0 redist, we call the string resource for the Homesite URL 'DotNetFXExe'
4. To change the definition of the string resource, open <locale>\package.xml for the appropriate locale and change the value of the string in the definition. For .NET FX 2.0, you'd be changing <String Name="DotNetFXExe">http://go.microsoft.com/fwlink/?LinkId=37283</String>
Alternatively, you could host all relevant packages internally on some share or server. You can then modify the Prerequisites dialog (off of the Publish tab from your project designer, or the setup project property page) to "Download prerequisites from the following location" to the appropriate location.