ClickOnce setup.exe 失败,但使用 Windows 共享进行部署时 .application 文件工作正常

发布于 2024-11-29 21:41:57 字数 7216 浏览 0 评论 0 原文

当我尝试为 ClickOnce 应用程序运行 setup.exe 时,出现 System.Deployment.Application.DeploymentDownloadException 错误。如果从其原始位置通过网络运行它,它可以正常工作,但是如果我从服务器上的路径复制 setup.exe ,则会出现错误

无法下载应用程序。该应用程序缺少所需的文件。

我需要该设置,因为它安装了最终用户可能会安装的一些先决条件(.NET 4)没有。

单击错误窗口中的详细信息按钮会显示以下信息:

PLATFORM VERSION INFO
    Windows             : 6.1.7601.65536 (Win32NT)
    Common Language Runtime     : 4.0.30319.237
    System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.237 (RTMGDR.030319-2300)
    dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
    Deployment url          : file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\srchamberlain\Downloads\ContractFlowTool.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application did not succeed.
        + Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        + Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        + Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [8/16/2011 12:23:26 PM] : Activation of C:\Users\srchamberlain\Downloads\ContractFlowTool.application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [8/16/2011 12:23:26 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application did not succeed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
            at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.Net.FileWebRequest.GetResponse()
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
            at System.Net.FileWebRequest.GetResponseCallback(Object state)
        --- Inner Exception ---
        System.IO.FileNotFoundException
        - Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
            at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

问题的根源是它尝试从运行 setup.exe 的相同路径下载文件(file: ///C:/Users/srchamberlain/Downloads 在本例中)而不是实际部署 URL (\\fs1\contractflowtool)

我看到了 很少 解决方案,但他们都告诉我解决方案是更改 MIME 在 IIS 上键入。 托管文件的服务器上未安装 IIS。

除了“更改 MIME 类型”之外,还可以采取什么措施来解决此问题?


更新

请参阅此线程中的第二篇文章 对于我运行的一些测试用例。摘要是:setup.exe 文件似乎使用工作目录来下载其文件,因为当我通过网络运行 EXE 文件时它工作正常,但是如果我将 EXE 复制到我的本地磁盘。

除了“告诉人们只从网络路径运行它”之外,如何解决此问题?


更新2: 使用十六进制编辑器查看 setup.exe 文件,我无法在其中的任何位置找到安装路径。当我将安装路径更改为 http://example.com/Test 时,我能够轻松找到它。

如果您使用 UNC 路径?

I am getting the error of System.Deployment.Application.DeploymentDownloadException when I try to run setup.exe for my ClickOnce application. If run it over the network from its original location it works fine, but if I copy setup.exe from the path on the server I get the error

Can not download application. The Application is missing required files.

I need the setup as it installs some prerequisites (.NET 4) that the end user may not have.

Clicking the details button from the error window gives the following information:

PLATFORM VERSION INFO
    Windows             : 6.1.7601.65536 (Win32NT)
    Common Language Runtime     : 4.0.30319.237
    System.Deployment.dll       : 4.0.30319.1 (RTMRel.030319-0100)
    clr.dll             : 4.0.30319.237 (RTMGDR.030319-2300)
    dfdll.dll           : 4.0.30319.1 (RTMRel.030319-0100)
    dfshim.dll          : 4.0.31106.0 (Main.031106-0000)

SOURCES
    Deployment url          : file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\srchamberlain\Downloads\ContractFlowTool.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application did not succeed.
        + Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        + Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        + Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.

COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [8/16/2011 12:23:26 PM] : Activation of C:\Users\srchamberlain\Downloads\ContractFlowTool.application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [8/16/2011 12:23:26 PM] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading file:///C:/Users/srchamberlain/Downloads/ContractFlowTool.application did not succeed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
            at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirectBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.Net.FileWebRequest.GetResponse()
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        --- Inner Exception ---
        System.Net.WebException
        - Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        - Source: System
        - Stack trace:
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
            at System.Net.FileWebRequest.GetResponseCallback(Object state)
        --- Inner Exception ---
        System.IO.FileNotFoundException
        - Could not find file 'C:\Users\srchamberlain\Downloads\ContractFlowTool.application'.
        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync)
            at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.

The root of the problem is it is trying to download its files from the same path as setup.exe is run from (file:///C:/Users/srchamberlain/Downloads in this case) instead of the actual deployment URL (\\fs1\contractflowtool)

I have seen a few solutions, but all of them tell me the solution is to change the MIME type on IIS. IIS is not installed on the server that is hosting the files.

What else can be done to fix this besides "change the MIME types"?


UPDATE

See the second post in this thread for some test cases I ran. The summary is: it appears that the setup.exe file uses the working directory to download its files as it works fine when I run the EXE file over the network, however it fails if I copy the EXE to my local disk.

How do I resolve this issue other than "Tell people to just run it from the network path"?


UPDATE2:
Looking at the setup.exe file with a hex editor, I could not find my install path anywhere in it. When I changed the install path to http://example.com/Test I was able to find it easily.

Is it a Visual Studio bug that it does not save the publishing location/install path if you are using a UNC path?

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

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

发布评论

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

评论(2

被翻牌 2024-12-06 21:41:57

据我了解,Setup.exe 文件不包含您的应用程序;这就是 Visual Studio 安装先决条件的方式,然后运行您的 .application 文件来实际安装您的应用程序。

我用我自己的一个应用程序对此进行了测试。首先,我只复制了 setup.exe 并得到了与您相同的错误:

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\Andy\Desktop\Video Uploader.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/Andy/Desktop/Video Uploader.application did not succeed.
        + Could not find file 'C:\Users\Andy\Desktop\Video Uploader.application'.
        + Could not find file 'C:\Users\Andy\Desktop\Video Uploader.application'.
        + Could not find file 'C:\Users\Andy\Desktop\Video Uploader.application'.

然后我将 Video Uploader.application 也复制到了我的桌面上并且它起作用了。因此,如果您想从网络共享之外的其他地方安装它,您只需要确保它具有这两个文件即可。

其他需要检查的事情,如果您没有从供应商网站下载先决条件,请确保它指向静态位置,或者至少确保您也复制了这些文件。

在发布向导的用户将如何安装应用程序? 页面上,我选择了“从 CD-ROM 或 DVD-Rom”。我不知道选择其他两个选项中的任何一个是否会改变它的工作方式。

编辑:
我读过你的另一篇文章。我怀疑这与不同协议处理文件的方式有关。我能够从 publish.html 页面使其正常工作,但实际上我将其发布到网络服务器,因此页面地址为 http://www.example.com/programs /publish.html

我尝试从 n:\webroot\programs\publish.html 运行它,但失败了。

您有办法将其发布到网络服务器吗?或者至少安装 IISApache 使其成为网络服务器?

或者,只需确保每个人都满足先决条件,然后让他们单击启动链接:

编辑 2:

这是我的发布设置。它的工作原理是单击 Internet Explorer、Firefox 和 Chrome(我都测试过)中的安装按钮。

在此处输入图像描述

在此处输入图像描述

看起来安装文件正在网站上查找 .application 文件,因此它不需要位于本地计算机上。

编辑 3:

在 Windows 中(XP 和 Windows 7 已验证):
* 步骤1:开始菜单->运行
* 第 2 步:输入“iexpress”,不带“

* 第 3 步:跟随向导。

http://expertester.wordpress.com/2008/ 07/11/create-self-extractinginstaller-for-free/

完成后,您就可以制作自己的 HTML 页面,指向您的安装程序 文件。
我遇到的唯一问题是每次第一次安装都失败。我运行了它,但它没有提取文件。然后我立即运行了第二次,效果很好......我还不知道为什么。

The way I understand it, the Setup.exe file doesn't contain your application; it's just how Visual Studio installs prerequisites, and then it runs your .application file to actually install your application.

I tested this out with one of my own applications. First, I copied just setup.exe over and got the same error you did:

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of C:\Users\Andy\Desktop\Video Uploader.application resulted in exception. Following failure messages were detected:
        + Downloading file:///C:/Users/Andy/Desktop/Video Uploader.application did not succeed.
        + Could not find file 'C:\Users\Andy\Desktop\Video Uploader.application'.
        + Could not find file 'C:\Users\Andy\Desktop\Video Uploader.application'.
        + Could not find file 'C:\Users\Andy\Desktop\Video Uploader.application'.

Then I copied the Video Uploader.application over to my desktop too and it worked. So it seems like if you want to install it from somewhere other than the network share, you just need to make sure that it has both files.

Other things to check, if you don't have it downloading the prereqs from the venders website, then make sure that it is pointing to a static place, or at least make sure that you copy those files over too.

In the Publish Wizard, on the How will users install the application? page, I selected From a CD-ROM or DVD-Rom. I don't know if selecting either of the other two options might change how it works.

Edit:
I read through your other post. I suspect that it has to do with how the different protocols handle files. I was able to get it working from the publish.html page, but I actually published it to a webserver, so that the page address was http://www.example.com/programs/publish.html.

I tried running it from n:\webroot\programs\publish.html, and it failed.

Do you have a way to publish it to a webserver? Or at least install IIS or Apache to make it into a webserver?

Alternately, just make sure that everyone has the prerequisites, and then have them click the launch link:

Enter image description here

Edit 2:

Here is my publishing setup. It works by clicking on the install button in Internet Explorer, Firefox, and Chrome (all I tested).

Enter image description here

Enter image description here

It seems like the setup file is looking at the website for the .application file, so that it doesn't need to be on the local computer.

Edit 3:

In Windows (XP and Windows 7 verified):
* Step 1 : Start menu –> Run
* Step 2 : Type ‘iexpress’ without ‘
* Step 3 : Follow the wizzard.

http://expertester.wordpress.com/2008/07/11/create-self-extractinginstaller-for-free/

Enter image description here

Once it's done, then you can just make your own HTML page pointing to your installer EXE file.
The only thing I ran into was that the install didn't work the first time every time. I ran it, and it didn't extract the files. Then I instantly ran it a second time, and it worked just fine... I don't know why yet.

热风软妹 2024-12-06 21:41:57

我们使用自解压 ZIP 文件来启动安装。 (有很多方法可以做到这一点,例如,使用 7-ZipWinZip 等)
这样就只需下载 1 个文件。

但我不确定在这种情况下您将如何处理更新 - 我假设您可以发布 ClickOnce 和自解压 ZIP 文件,以便应用程序随后找到必要的文件...

我希望这会有所帮助。

We use a self-extracting ZIP file to launch our installation. (There are many ways to do this, for example, use 7-Zip, WinZip, etc.)
This way there is only 1 file to download.

But I'm not sure how you would handle updates in this scenario - I assume you could publish both the ClickOnce and the self extacting ZIP file so that the application finds the necessary files afterwards...

I hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文