Sabre
Sabre

Reputation: 2400

ClickOnce installation folder URL relative

When deploying a ClickOnce application, the installation folder URL, is there a way to make it relative to the web application directory hosting it?

For instance, for local testing I publish to http://localhost:54592. However, when this web application is deployed, it could be anything from http://www.foo.com to http://www.foo.com/MyVirtualDirectory

I would like the path to find the installer in its current location, and the application after installer has completed to reference the web app host, not the development URL.

Platform: Visual Studio 2010, .NET 4.0, and C#.

Upvotes: 1

Views: 3415

Answers (2)

Wiktor Zychla
Wiktor Zychla

Reputation: 48230

This works out of the box if you stick with *.application as your application source. You just need to pick a folder inside your web application to publish your ClickOnce application, and the application is available from this address under your application.

For example, if copy your site to C:\inetpub\wwwroot\mysite and copy the ClickOnce to C:\inetpub\wwwroot\mysite\myapp with MyClickOnce.application inside the ClickOnce folder.

Then you expose your website as http://example.com and the ClickOnce application is available under http://example.com/myapp/MyClickOnce.application.

In case of setup.exe you need to recreate the manifest after you publish it to the destination location. This is done with mage.exe.

Upvotes: 2

RobinDotNet
RobinDotNet

Reputation: 11877

In the Options dialog, the Manifests tab, you can check the box that says "Exclude deployment provider URL".

Then provide the URL to your user for the installation based on where you put it. When they run it, it will create and save the URL where they got it from, and always look there for updates.

Upvotes: 1

Related Questions