ClickOnce CD 安装程序尝试连接到 Internet

发布于 2024-08-10 07:34:10 字数 923 浏览 5 评论 0原文

我正在尝试部署使用 VS2008 Express 构建的应用程序。这个想法是将文件上传到网络服务器(通过网站安装),同时为一些没有互联网连接的用户提供离线(CD)安装。

在“发布”选项中,我将“安装文件夹 URL”留空,取消选中“应用程序应检查更新”选项(因为我正在手动处理更新检查)并且我填写了选项更新位置(如果与发布位置不同)

当我尝试测试离线安装时,无法安装该应用程序。我收到错误“应用程序下载失败。请检查您的网络连接...”,当按下“详细信息”按钮时,我看到以下错误:

  • 激活 C:\Install\myapp.application 导致异常。下列的 检测到失败消息:

为什么虽然所有文件都存在,但安装程序却试图从 Internet 下载文件?

最后,当我从更新位置中删除服务器 URL 时,一切正常。每次需要更新应用程序时是否需要创建两个不同的设置?或者还有其他解决方案吗?


编辑

进一步的测试证明,离线安装在Windows XP中可以正常工作,但在Windows 7中不起作用。在后一种情况下,使用相同的安装文件,安装程序会尝试从以下位置下载应用程序: Internet,而不是使用本地 .deploy 文件。

没有可用的 ClickOnce 专家吗?

I'm trying to deploy an application built with VS2008 Express. The idea is to upload the files to a webserver (installation via website) and at the same time offer offline (CD) installations to some users which do not have Internet connection.

In the Publish options I left the Installation Folder URL blank, I unchecked the option The application should check for updates (since I'm taking care of the updates check manually) and I filled in the option Update location (if different than publish location).

When I'm trying to test the offline installation, the application cannot be installed. I get an error "Application download did not succeed. Check your network connection..." and when pressing the Details button, I'm reading the following error:

  • Activation of C:\Install\myapp.application
    resulted in exception. Following
    failure messages were detected:

Why is it that, although all files are present, the installation is trying to download the files from the Internet?

Finally, when I remove the server URL from the Update location, everything normally. Do I need to create two different setups each time I need to update the application? Or is there another solution?


Edit:

Further tests proved that offline installation works normally in Windows XP, but it doesn't work in Windows 7. In the later case, using the same installation files, the installer tries to download the application from the Internet, instead of using the local .deploy files.

No ClickOnce gurus available?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

水水月牙 2024-08-17 07:34:10

ClickOnce 运行程序将尝试连接到指定的 URL,无论文件是否已存在于本地。您将需要两个构建配置来支持 CD 和基于 Web 的部署。以下是来自 Microsoft 文档的相关信息。

要启用此部署策略
Visual Studio,单击“从 CD-ROM”或
如何安装页面上的 DVD-ROM
发布向导。

启用此部署策略
手动更改部署清单中的deploymentProvider 标记,使该值为空。在 Visual Studio 中,此属性在项目设计器的“发布”页面上显示为安装 URL。在Mage.exe中,它是开始位置。

您可以自动执行此操作,因此无需每次都手动编辑项目设置(甚至冒着犯一个小错误而导致客户端无法更新的风险)。不幸的是,项目的 ClickOnce 设置似乎不受标准构建配置的控制,因此您需要对项目文件(也是 MSBuild 脚本)进行一些手动编辑,或者在您使用的任何工具中编写单独的构建脚本。使用。

您需要覆盖的值是InstallUrl。对于 CD-ROM 安装版本,它应该为空。然后,您的构建将需要构建这两种配置。该网站上有大量示例,其他网站上也有关于如何做到这一点的说明。

The ClickOnce runner will attempt to connect to the specified URL, regardless of whether the files are already locally present or not. You will need two build configurations to support both CD and web-based deployments. Here is the relevant info from Microsoft's documentation.

To enable this deployment strategy in
Visual Studio, click From a CD-ROM or
DVD-ROM on the How Installed page of
the Publish Wizard.

To enable this deployment strategy
manually, change the deploymentProvider tag in the deployment manifest so that the value is blank. In Visual Studio, this property is exposed as Installation URL on the Publish page of the Project Designer. In Mage.exe, it is Start Location.

You can do this automatically, so you don't need to manually edit the project settings each time (and risk making even a small mistake that prevents your clients from updating). Unfortunately, the ClickOnce settings of the project do not appear to be controlled by standard build configurations, so you'll need to do some hand editing of the project file (which is also an MSBuild script) or a separate build script in whatever tool you use.

The value you need to override is the InstallUrl. It should be blank for the CD-ROM installation build. Your build will then need to build both configurations. There are copious examples on this site an others with instructions on how to do just that.

岁月静好 2024-08-17 07:34:10

我遇到了一个类似的问题,只不过我是在 VS2015 中为更新的项目发布应用程序。我的发布设置是:

  • 用户将如何安装应用程序 - “从 CD-ROM 或 DVD-ROM”
  • 该应用程序不会检查更新

我将从我的开发计算机(例如 mymachine01)发布此应用程序,并且它与Setup.exe捆绑在一起的.application文件总是包含这样的一行:

我会压缩它然后将其放到另一台机器上来测试安装程序,我会得到一个 Application无法启动。请联系应用程序供应商。 错误。单击详细信息按钮将显示应用程序尝试访问 mymachine01 时的无法解析远程名称错误。为了解决这个问题,我使用了以下步骤:

  1. 右键单击​​ VS 中的项目并选择属性
  2. 转到“发布”选项卡
  3. 单击“选项”
  4. 选择“清单” 选中
  5. “排除部署提供程序 URL”

I had an issue that was kind of similar except I was publishing an application for a more recent project in VS2015. My publish settings were:

  • How will users install the application - "From a CD-ROM or DVD-ROM"
  • The application will not check for updates

I would publish this from my dev machine (e.g. mymachine01) and the .application file it bundles alongside Setup.exe would always contain a line like this:

<deploymentProvider codebase="http://mymachine01/Application20Name/Application20Name.application" />

I would zip that up then drop it onto another machine to test the installer and I would get an Application cannot be started. Contact the application vendor. error. Clicking the details button would reveal a The remote name could not be resolved error where the app had been trying to access mymachine01. To fix that, I used the following steps:

  1. Right click project in VS and select properties
  2. Go to Publish tab
  3. Click "Options"
  4. Select "Manifests"
  5. Check "Exclude deployment provider URL"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文