ClickOnce application is not installing with HTTPS

2019-08-17 07:06发布

问题:

I am publishing my application with HTTPS setup url and host it to HTTPS url.

When I run setup.exe an error occurred.

An error occurred trying to download 'https://***.tjc.tv/WMSClient.application'.

See the setup log file located at 'C:\Users\mkumawat\AppData\Local\Temp\VSD3796.tmp\install.log' for more information.

Log file

The following properties have been set:
Property: [AdminUser] = true {boolean}
Property: [InstallMode] = HomeSite {string}
Property: [ProcessorArchitecture] = AMD64 {string}
Property: [VersionNT] = 6.2.0 {version}
Running checks for package 'Windows Installer 3.1', phase BuildList
The following properties have been set for package 'Windows Installer 3.1':
Running checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe'
Result of running operator 'VersionGreaterThanOrEqualTo' on property 'VersionMsi' and value '3.1': true
Result of checks for command 'WindowsInstaller3_1\WindowsInstaller-KB893803-v2-x86.exe' is 'Bypass'
'Windows Installer 3.1' RunCheck result: No Install Needed
Launching Application.
URLDownloadToCacheFile failed with HRESULT '-2146697202'
Error: An error occurred trying to download 'https://***.tjc.tv/WMSClient.application'.

When I manually download this https://***.tjc.tv/WMSClient.application in browser then it's downloading and works fine but in setup.exe it's not working.

I have already tried following solutions but nothing works.

  1. Enable - Launching applications and unsafe files in Custom level in Internet options.
  2. Uncheck - Warn if changing between secure and not secure mode in advanced tab in Internet options.
  3. Sign the ClickOnce Manifests in project properties in VS

But these all are failing nothing works.

This issue occurs with only HTTPS not HTTP. HTTP is working fine but I need to use HTTPS.

SSL certificate is valid.

Anyone know about this.

回答1:

On our systems setup.exe failed as well, with the error URLDownloadToCacheFile failed with HRESULT '-2146697208', while, when clicking on the ourapp.application link or launching the downloaded file, the applicaction installed with no issue.

If we changed the install source from HTTPS to HTTP, we would then be able to install using setup.exe.

Our resolution was to re-enable the caching of HTTPS pages. Since setup.exe is using WinInet, this is an Internet Settings change that can be made thru IE.

  1. In Internet Explorer, go to Tools/Internet options
  2. Switch to the Advanced tab and scroll down to the Security section.
  3. Un-check the item “Do not save encrypted pages to disk”.

Since most traffic is moving to HTTPS, this security feature doesn't make much sense to me anymore