English 中文(简体)
What causes ClickOnce URLDownloadToCacheFile failed during installation?
原标题:

I m getting the following error when installing my ClickOnce application via firefox. It doesn t happen with IE on the same computer. I swear I ve installed it via firefox before. This is a Windows 7 machine.

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [ProcessorArchitecture] = Intel {string}
Property: [VersionNT] = 6.1.0 {version}
Running checks for package  .NET Framework 2.0 (x86) , phase BuildList
Running external check with command  C:UserslukeAppDataLocalTempVSDEF1A.tmpDotNetFXdotnetchk.exe  and parameters   
Process exited with code 1
Setting value  1 {int}  for property  DotNetInstalled 
Reading value  Version  of registry key  HKLMSoftwareMicrosoftInternet Explorer 
Read string value  8.0.7600.16385 
Setting value  8.0.7600.16385 {string}  for property  IEVersion 
The following properties have been set for package  .NET Framework 2.0 (x86) :
Property: [DotNetInstalled] = 1 {int}
Property: [IEVersion] = 8.0.7600.16385 {string}
Running checks for command  DotNetFXinstmsia.exe 
Result of running operator  ValueExists  on property  VersionNT : true
Result of checks for command  DotNetFXinstmsia.exe  is  Bypass 
Running checks for command  DotNetFXWindowsInstaller-KB893803-v2-x86.exe 
Result of running operator  ValueExists  on property  Version9x : false
Result of running operator  VersionLessThan  on property  VersionNT  and value  5.0.3 : false
Result of running operator  VersionGreaterThanOrEqualTo  on property  VersionMsi  and value  3.0 : true
Result of checks for command  DotNetFXWindowsInstaller-KB893803-v2-x86.exe  is  Bypass 
Running checks for command  DotNetFXdotnetfx.exe 
Result of running operator  ValueNotEqualTo  on property  DotNetInstalled  and value  0 : true
Result of checks for command  DotNetFXdotnetfx.exe  is  Bypass 
 .NET Framework 2.0 (x86)  RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT  -2146697211 
Error: An error occurred trying to download  http://croppy.lukehunter.net/download/croppy.application .

The following is the howto from Microsoft, but this doesn t apply to firefox. There is no redirection happening either.

If a user has set Internet Explorer Advanced Security option "Warn if changing between secure and not secure mode" on the deployment target computer, and if the setup URL of the ClickOnce application being installed is redirected from a non-secure to a secure site (or vice-versa), the installation will fail because the Internet Explorer warning interrupts it.

问题回答

Internet Explorer calls either LaunchApplication or ShOpenVerbApplication procedure from dfshim.dll behind the scenes, whereas Firefox plug-in (as well as a standard bootstrapper created by Visual Studio 2008-2010, which could also produce this rare error) uses a different, out of date technique to launch ClickOnce applications. (Note, that LaunchApplication requires at least .NET Framework 2 SP 2.)

To avoid such error one could redirect Internet Explorer to a deployment manifest (.application) and all other browsers to a custom installer (.exe) that would install .NET Framework if necessary and then call ShOpenVerbApplication.

Hmm, after using IE to install, then uninstalling, I was able to install via firefox again. Odd.

The following worked for me:

Within the local distribution package CLICK ONCE a web.config file was generated on line clientCache that was the problem, in which altered as follows for CHROME and IE8 and now run the file:

<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />

I ve had this and it to resolve it was to disable the firewall. I sadly don t know what Firewall settings it was, I just disabled the lot and it ran/installed without issue.

After exhausting firewall options on this issue, I found that my excutable was pointing to the IP Address of the Application Server. When I changed the site deployment and consequently the executable to the FQDN of the server instead of the IP Address, the installer worked first time.

Simple Solution, on cmd execute setup.exe /URL=http://< Production  URL>/

Easy!





相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签