How to: Specify an Alternate Location for Deployment Updates
You can install your ClickOnce application initially from a CD or a file share, but the application must check for periodic updates on the Web. You can specify an alternate location for updates in your deployment manifest so that your application can update itself from the Web after its initial installation.
Your application must be configured to install locally to use this feature. For more information, see. In addition, if you install a ClickOnce application from the network, setting an alternate location causes ClickOnce to use that location for both the initial installation and all subsequent updates. If you install your application locally (for example, from a CD), the initial installation is performed using the original media, and all subsequent updates will use the alternate location.
Specifying an alternate location for updates by using MageUI.exe (Windows Forms-based utility)
Open a .NET Framework command prompt and type:
On the File menu, choose Open to open your application's deployment manifest.
Select the Deployment Options tab.
In the text box named Launch Location, enter the URL to the directory that will contain the deployment manifest for application updates.
Save the deployment manifest.
Specifying an alternate location for updates by using Mage.exe
Open a .NET Framework command prompt.
Set the update location using the following command. In this example, HelloWorld.exe.application is the path to your ClickOnce application manifest, which always has the .application extension, and http://adatum.com/Update/Path is the URL that ClickOnce will check for application updates.
Mage -Update HelloWorld.exe.application -ProviderUrl http://adatum.com/Update/Path
Save the file.
You now need to re-sign the file with Mage.exe. For more information, see.
If you install your application from an offline medium such as a CD, and the computer is online, ClickOnce first checks the URL specified by the <deploymentProvider> tag in the deployment manifest to determine if the update location contains a more recent version of the application. If it does, ClickOnce installs the application directly from there, instead of from the initial installation directory, and the common language runtime (CLR) determines your application's trust level using <deploymentProvider>. If the computer is offline, or <deploymentProvider> is unreachable, ClickOnce installs from the CD, and the CLR grants trust based on the installation point; for a CD install, this means your application receives full trust. All subsequent updates will inherit that trust level.
All ClickOnce applications that use <deploymentProvider> should explicitly declare the permissions they need in their application manifest, so that the application does not receive different levels of trust on different computers.