ClickOnce CD 安装程序尝试连接到 Internet
我正在尝试部署使用 VS2008 Express 构建的应用程序。这个想法是将文件上传到网络服务器(通过网站安装),同时为一些没有互联网连接的用户提供离线(CD)安装。
在“发布”选项中,我将“安装文件夹 URL”留空,取消选中“应用程序应检查更新”选项(因为我正在手动处理更新检查)并且我填写了选项更新位置(如果与发布位置不同)
。
当我尝试测试离线安装时,无法安装该应用程序。我收到错误“应用程序下载失败。请检查您的网络连接...”,当按下“详细信息”按钮时,我看到以下错误:
- 激活 C:\Install\myapp.application 导致异常。下列的 检测到失败消息:
- 正在下载http://myserver.com/myapp.application 没有成功。
- 无法连接到远程服务器
- 尝试对无法访问的网络进行套接字操作 195.42.142.11:80
为什么虽然所有文件都存在,但安装程序却试图从 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:
- Downloading http://myserver.com/myapp.application
did not succeed.- Unable to connect to the remote server
- A socket operation was attempted to an unreachable network
195.42.142.11:80
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ClickOnce 运行程序将尝试连接到指定的 URL,无论文件是否已存在于本地。您将需要两个构建配置来支持 CD 和基于 Web 的部署。以下是来自 Microsoft 文档的相关信息。
您可以自动执行此操作,因此无需每次都手动编辑项目设置(甚至冒着犯一个小错误而导致客户端无法更新的风险)。不幸的是,项目的 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.
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.
我遇到了一个类似的问题,只不过我是在 VS2015 中为更新的项目发布应用程序。我的发布设置是:
我将从我的开发计算机(例如
mymachine01
)发布此应用程序,并且它与Setup.exe捆绑在一起的.application文件总是包含这样的一行:我会压缩它然后将其放到另一台机器上来测试安装程序,我会得到一个
Application无法启动。请联系应用程序供应商。
错误。单击详细信息按钮将显示应用程序尝试访问mymachine01
时的无法解析远程名称
错误。为了解决这个问题,我使用了以下步骤: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:
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 aThe remote name could not be resolved
error where the app had been trying to accessmymachine01
. To fix that, I used the following steps: