从多个URL安装ClickOnce

时间:2013-11-15 14:27:56

标签: c# clickonce

我有一个需要从多个URLs设置的ClickOnce应用程序。例如,我需要从以下URL安装它:

http://mycompany.com//url1
http://mycompany.com//url2

我是基于从url1安装发布的(发布向导 - >第2页 - >来自网络指定网址:url1),但是当我尝试将其复制到url2时,仍然关注url1

为此,我将安装文件夹URL设置为

http://mycompany.com//url1

并选中排除部署提供程序URL 并将应用程序发布到我的电脑上的目录中,然后将其复制到服务器。

如何从url2上的index.html启动安装时强制它使用url2

EDIT1

我做了几次测试,看看为什么会发生什么。

发布向导会创建一个名为index.htm的HTML文件。

在此HTML文件中,有一个按钮,其中包含对setup.exe的引用。当此应用程序运行时,它会从url1查找.application。我检查过,HTML文件中没有url1的引用,但是setup.exe从url1查看.application。

如果我删除url1中的所有文件,但所有文件都存在于url2上,则应用程序设置会因找不到http:\ mycompany.com \ url1 \ myapplication错误而失败。应用

如果我创建新版本的应用程序并将其上传到url1,然后转到url2并尝试安装它,则会安装较新的应用程序,但不会进行更新。

我的设置是:

Options:
  Deployment
      Automatically generate deployment... Set
      Open deployment web                  Set
      Use .dep file ex                     Not set
      For CD installation, aut             Set
      Verify files uploaded to a web sever Not set
 Manifests
      Block application from               Not set
      Allow URL parameters to pass         Not set
      Use application manifest for trust   Not set
      Exclude deployment provider URL      Set
      Create desktop shortcut              Set
Publish location
        publish/
Installation folder URL
        http://MyCompany.com/url1
This application is available offline      Set

Publish wizard
     How the user install the application:
      From a web site URL =url1
      Yes this application is available online and off line set.

1 个答案:

答案 0 :(得分:0)

这真的很奇怪 - 请确保您确实删除了两个网址中的所有内容。使用“排除部署提供程序URL”选项生成ClickOnce部署文件后,<< your application name>> .application文件中没有提及安装URL - 因此从我的角度来看,有两种可能方案:

  1. 您将错误的(旧)部署文件复制到URL2文件夹中(或者没有覆盖它们)。
  2. 您正在从您的应用程序进行手动更新,其中URL1已在某处硬编码。
  3. 在我的情况下,完全相同的场景可以正常工作 - 多个URL - 多个安装。

相关问题