ClickOnce的SETUP.EXE失败,但在使用Windows共享部署。应用文件工作正常但在、正常、文件、工作

2023-09-04 00:06:25 作者:苏沐熙°

我收到 System.Deployment.Application.DeploymentDownloadException 的错误,当我尝试为我的ClickOnce应用程序运行setup.exe。如果从其原始位置运行它在网络上能正常工作,但如果我复制 SETUP.EXE 从路径上的服务器上出现错误

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.

我所需要的设置,因为它会安装一些prerequisites( .NET 4),最终用户可以没有。

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.

该问题的根源是它试图从同一个路径 SETUP.EXE 从(文件运行下载的文件:/ // C:/用户/在这种情况下srchamberlain /下载),而不是实际部署网址( \\ FS1 \ contractflowtool

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)

我看到一个few solutions,但是所有的人都告诉我的解决办法是改变 MIME类型在IIS上。 IIS未托管文件安装在服务器上。

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.

还有什么可以做,除了要解决这个问题改变MIME类型?

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

更新

见第二个职位在this线程一些测试用例我跑。本摘要:看来, SETUP.EXE 文件使用工作目录,因为它工作正常,当我在网络上运行EXE文件下载的文件,但它失败如果我的EXE复制到我的本地磁盘。

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: 纵观 SETUP.EXE 用十六进制编辑器文件,我找不到我的安装在任何地方的路径。当我改变安装路径 http://example.com/Test 我能够很容易地找到它。

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.

它是一个Visual Studio的错误,这并不重要,如果你正在使用的 UNC路径?

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

推荐答案

我的理解是,在的Setup.exe 文件不包含您的应用程序;这是多么的Visual Studio安装prerequisites,然后将它运行在您的。应用文件实际安装应用程序。

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.

我测试了这一点跟我自己的应用程序之一。首先,我只是复制 SETUP.EXE 过去,给你做了同样的错误:

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'.

然后我复制了视频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.

其他需要检查的,如果你不把它下载prereqs从商贩的网站,然后确保它指向一个静态的地方,或者至少确保你过也复制这些文件

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.

在发布向导,在如何将用户安装的应用程序?页,我选择从CD-ROM或DVD-ROM ​​。我不知道如果选择其他两个选项可能会改变它的工作原理。

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.

编辑: 我通过你的其他后阅读。我怀疑它,是因为有不同的协议如何处理文件。我能得到它从 publish.html 页的工作,但我实际上它发布到Web服务器,从而使该网页的地址是 HTTP: //www.example.com/programs/publish.html

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.

我试图从ñ运行它:\ webroot的\程序\ publish.html ,它失败。

你有没有办法把它发布到Web服务器?或者至少安装 IIS 或阿帕奇,以使之成为一个Web服务器?

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

另外,只要确保每个人都有prerequisites,然后让他们点击发布链接:

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

编辑2:

下面是我出版的设置。它的工作原理通过点击互联网&NBSP安装按钮;浏览器,火狐和Chrome(所有我测试过)

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

这似乎是安装文件是看网站为。应用文件,因此它并不需要在本地计算机上。

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.

编辑3:

在Windows(XP和Windows 7的验证):  *第1步:开始菜单 - >运行  *第2步:输入IEX preSS'不'  *步骤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.word$p$pss.com/2008/07/11/create-self-extractinginstaller-for-free/

一旦完成,那么你可以让自己的 HTML 页面指向您的安装程序的EXE文件。 我遇到的唯一的事情是,安装在第一时间每次都没有工作。我跑了,并没有解压缩文件。然后,我立刻跑了第二次,和它的工作就好了......我不知道是什么原因呢。

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.