Pergunta

I developed a ClickOnce app for .NET 2.0 and it works just fine. If I hit the install button on the generated publish.html page or access the application URL https://<host>:<port>/<path>/<app>.application directly within IE it installs / launches and runs as intended.

To make the start experience better for users I would now like the installation / launch of the application to start right away, without the necessity for the user to click another button or link. Therefore I added the following JavaScript code:

setTimeout(function() {
  var iframe = $("<iframe/>")
      .attr("id", "autoDownloadFrame")
      .attr("src", "https://<host>:<port>/<path>/<app>.application")
      .hide();
  iframe.appendTo($('body'));
}, 1500);

This code works fine to start, for example, automatical downloads of installers. And it does also work as far as downloading the .application file for my ClickOnce app. But unforunately the ClickOnce installation / launch does not kick in to start my app.

I thought that might be related to the Content-Type being set by the web server (using Tomcat 7 with Spring 3.2 here). But even after making sure (and verifying) that the content type is set to application/x-ms-application the autostart does not happen.

Any hints on why this is the case?

OS: Win7 Enterprise 64 bit, EN Browser: MSIE 9.0, .NET 2.0 thru 3.5 available (naturally since the click-start works) Protocol: Tested both HTTP and HTTPS, both with custom ports (8080 and 8443)

Thanks in advance for any hints! Cheers, Bjorn

Foi útil?

Solução 2

My current research and feedback from co-workers indicates that this behavior was implemented by Microsoft on purpose to prevent automated app launches that were not explicitly "requested" by the user (by explicitly clicking a link or button). So I'll consider this not doable and go on with the "click this button to start" solution.

Please feel free to correct me if I'm wrong, I'd like to be wrong in this case :)

Cheers, Bjorn

Outras dicas

You can use microsoft-edge:http://url/abc.applicaiton url to get downloaded automatically via javascript. This will open your clickOnce application in microsoft edge, which in turn will download and install the application.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top