Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ClickOnce extension for Chrome #97

Closed
Redsandro opened this issue Jun 21, 2015 · 53 comments
Closed

New ClickOnce extension for Chrome #97

Redsandro opened this issue Jun 21, 2015 · 53 comments

Comments

@Redsandro
Copy link

There are about 4 extensions in the Chrome webstore that claim to add ClickOnce support. But one was branded adware, one is Spanish, two cater to specific websites and don't mention global ClickOnce support, and the last one has a poorly written English description because the original is in Hebrew. Furthermore, I couldn't get any to work with my website (which uses Boxstarter), perhaps because it's too dynamic and 'modern'.

The extension mentioned on line 76 of WebLauncher.cshtml doesn't exist anymore because NPAPI extensions have been removed from the webstore.

Everything was a bit too much off for my taste, so I've created my own ClickOnce extension, created a Native Messaging Client in C#, added some forms of extension identification for compatibility with other websites and made it work with my own. It was actually already there for a while, but Google kept it hidden until I replaced NPAPI with a Native Messaging Client.

https://chrome.google.com/webstore/detail/windows-remix-clickonce-h/dgpgholdldjjbcmpeckiephjigdpikan/

Check it out. If it works for you, perhaps update the broken link. 👍 Otherwise maybe we can add the features to make it work.

@mwrock
Copy link
Member

mwrock commented Jun 22, 2015

very cool.

I'm having issues getting it working. I installed it in a win 8.1 VM. After launching a boxstarter url, it wanted me to install .net 3.5 which seemed odd. I had .net 4.5.1. I went ahead and accepted the install. Then I relaunched a boxstarter url and nothing happened. I tried restarting chrome and also rebooting but anytime I try to install a package via the boxstarter click-once app, nothing happens.

What version of windows have you been testing this with?

@Redsandro
Copy link
Author

This is weird. I have been testing this with Windows 7 32 bit, and Visual Studio 2013. I have temporarily unlisted the extension until I figure out what the problem is.

I have been communicating the ClickOnce url to PresentationHost.exe. Is this no longer available in Window 8.1 or dotNET 4.5.1?


Why would something need dotNET 3.5? If dotNETs are backwards compatible, I must have a hardcoded restriction in one of the 10000000 VS options.


Thanks for letting me know!

@mwrock
Copy link
Member

mwrock commented Jun 22, 2015

Hmm. I'm really not an expert here. I do seem to remember when putting together the click once boxstarter bootstrapper running into the same .net 3.5 issue. I think thats the minimum version of .net needed for click once to work. Looking through the boxstarter click once csproj I see this:

  <ItemGroup>
    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
      <Visible>False</Visible>
      <ProductName>.NET Framework 3.5 SP1</ProductName>
      <Install>false</Install>
    </BootstrapperPackage>
  </ItemGroup>

So you likely just need to set these install properties to false.

@mwrock
Copy link
Member

mwrock commented Jun 22, 2015

Ha! and yeah 10000000 sounds about right. I remember it being much more confusing that I thought it should be.

@Redsandro
Copy link
Author

Redsandro commented Jun 22, 2015 via email

@Redsandro
Copy link
Author

PS what url are you using for testing? Just tested the extension on Windows
8.1 64 bit Chrome 64 at windowsremix.com and it worked.

On Mon, Jun 22, 2015, 11:11 Sandro [email protected] wrote:

I'm afraid I haven't figured out the forced installation part yet. I am
'targetting' version 3.5 because this is most likely to be there on XP.SP2
and the code doesn't require a newer version. However, I did assume 4.5
would prevent installation of 3.5. You tip doesn't apply, there is no
BootstrapperPackage in my csproj. I believe that is a ClickOnce specific
item.

However, are you willing to try this Native Messaging Client (on your
virtual machine with the extension)?
Just run it, it will put itself over the previous one.
It doesn't use presentationhost anymore.

https://www.dropbox.com/s/sli2a2ucvf8839c/winmixClickOnceHelper%20v0.2.0.2.exe?dl=0

@Redsandro
Copy link
Author

I updated the binary again and packaged it in the updated extension:
https://chrome.google.com/webstore/detail//dgpgholdldjjbcmpeckiephjigdpikan
(Enable developer mode in extensions page, update extensions, install the new binary)

I think the dotNET dialog should be gone now that I am using an app configuration that supplies both supportedVersions. I did get some missing schema notifications, but I don't think they are relevant to the final binary.

If the url still won't launch, I think your test document contains ClickOnce urls that aren't being detected and I'd like to check it out.

@mwrock
Copy link
Member

mwrock commented Jun 23, 2015

Will give this another shot.

@mwrock
Copy link
Member

mwrock commented Jun 24, 2015

I have been trying with http://boxstarter.org/package/visualstudio2013ultimate.

The update didn't work but I'll try blowing away the VM and starting over clean.

@Redsandro
Copy link
Author

Is that the clickonce link? I get an empty page back.

The extension has to identify the links before they are clicked, otherwise I would have to send every click to the messaging host, which is not nice. It has to identify the links through DOM. By default it looks for .application in the pathname, as in here:

http://boxstarter.org/launch/Boxstarter.WebLaunch.Application?package=7zip&noreboot=1&cofc_goback=false

If I click that link, the extension launches boxstarter.

@gep13
Copy link
Member

gep13 commented Jun 24, 2015

For me, browsing to that link that @mwrock provided in Internet Explorer brings up this ClickOnce dialog:

image

@Redsandro
Copy link
Author

Ah I see, it is clickonce!

Well for that type of link we have a problem. It does not identify itself as clickonce from the DOM (e.g. it's just a link without context) so we can only identify it with the actual mime-type after it is clicked. I cannot redirect all links to the messaging host, otherwise normal links wouldn't work properly anymore (and the extension will probably be flagged as spyware). So I think this is simply not possible (anymore) with Chrome/Chromium/Opera.

The solution is to add an identifying tag to the DOM a-element which the extension can pick up (don't have one yet) or simply end the url pathname in .Application like this example-link I gave:

http://boxstarter.org/launch/Boxstarter.WebLaunch.Application?package=7zip&noreboot=1&cofc_goback=false

Note that this needs to be pathname, you cannot simply add a querystring:
http://boxstarter.org/package/visualstudio2013ultimate?ext=.Application won't work.
Oh this actually does work. I didn't know querystring was part of the pathname.

@mwrock
Copy link
Member

mwrock commented Jun 24, 2015

Yeah it has to support raw click once. The docs focus on the scenario of simply typing a raw URL in the browser location bar.

I should remove the reference to that bad extension.

@Redsandro
Copy link
Author

Okay, let me try something.

PS - I heard Firefox is also dropping NPAPI support and might have similar problems where an extension cannot switch based on mime-type anymore. It's unfortunate that browsers are making our lives hard. 😉

@Redsandro
Copy link
Author

Important notice

Actually, when I click your new link, it get's redirected to the old link, which gets picked up by the extension.

So it does launch Boxstarter, it's just too late to cancel the page refresh.

@Redsandro
Copy link
Author

Update

So I've educated myself and updated the extension to 1.2.0 with support for raw mime-types.
Here on Windows 7 your URL works both when clicking and both when pasting in a new tab.

🎉 🎈 🍷 ❓ or too early?

@mwrock
Copy link
Member

mwrock commented Jun 26, 2015

Hmm. still having issues on win 8.1. Here are the repro steps:

  1. Started a clean 8.1 VM
  2. Installed Chocolatey
  3. choco install googlechrome -y
  4. Installed v1.2 of the winremix extension
  5. I was prompted to install .Net3.5 and I did so
  6. Launched http://boxstarter.org/package/nr/git
  7. Nothing happens and the url in the location bar reverts to the currently loaded url
  8. shut down and restart chrome
  9. launch same boxstarter url with same result as Boxstarter keeps rebooting (stuck in boot loop) #7

The Network pane in the dev tools shows a 301 redirect to http://boxstarter.org/launch/Boxstarter.WebLaunch.Application?package=git&noreboot=1 which is the correct redirect but then that URL shows a status of cancelled

@Redsandro
Copy link
Author

This is so weird. What box/image do you use? Modern.IE?

Yes, Boxstarter does the 301. The extension picks up this url as ClickOnce (you can probably see it in the "background page" console of the extension), redirects it to the Native Message Host (the companion app you installed with the extension) and cancels the request so Chrome doesn't download the file.

So if I'm correct, the Native Message Host (.exe) doesn't seem to get called by Chrome, or somehow doesn't work for you.

(and as a side issue, you still have to install .NET 3.5 even though you have .NET 4.5, but I remember I had that same 'bug' when I just installed Chocolatey without rebooting the VM after, so not sure about that one.)

The helper app is now using dfshim.dll which is part of .NET3.5+ to launch ClickOnce and I have it working in Windows 7 and Windows 8.1. So I am beginning to think that this Chrome call is blocked due to some Windows 8.1 (security) feature.

I don't have any currently ready ideas as to what the exact problem is but I must figure this out!

@Redsandro
Copy link
Author

image

Can you check that background page (open it first and then open a ClickOnce link) to see if you get any Native Messaging Host failed error from Chrome?

Host is identified through the json file listed here:
HKEY_CURRENT_USER\Software\Google\Chrome\NativeMessagingHosts\winmix.clickonce.helper

@mwrock
Copy link
Member

mwrock commented Jun 28, 2015

I dont have a NativeMessagingHosts key in the registry. Here is a shot of the background page console. I dont see any errors.

image

So it seems that the urls are being detected but the extension is not surfacing the click-once flow.

This is a freshly built 64 bit win8.1 professional from the .ISO.

@Redsandro
Copy link
Author

No NativeMessagingHosts key in the registry?
It looks like the ClickOnceHelper.exe is not properly installed.

Perhaps you need to re-run it after installing .NET 3.5? in order to register it with Crome as a Native Messaging Host?

@mwrock
Copy link
Member

mwrock commented Jun 28, 2015

yup. uninstalled and reinstalled and then it worked.

@Redsandro
Copy link
Author

I'm glad! 👍

@mwrock
Copy link
Member

mwrock commented Jun 29, 2015

Yeah. Once the .net issues are resolved I'd be happy to include the link in the boxstarter docs. Is this on GitHub?

@mwrock
Copy link
Member

mwrock commented Jul 26, 2015

closing for now, but please feel free to reopen once you get past the .net 3.5 issue.

@mwrock mwrock closed this as completed Jul 26, 2015
@Redsandro
Copy link
Author

Sorry for the delay. Holiday + sick + work. You know how it works. :)

I thought the issue was resolved, as I tested this on Windows 8.1 without problems, and I was under the assumption it came with .NET 4.5 preinstalled.

Perhaps I am mistaken. Do you know of a simple way to determine what versions of .NET are installed on a certain computer or VM? Preferably in the commandline or something, without having to install Visual Studio?

I mean, this is really a pain in the neck.

@cam1985
Copy link

cam1985 commented Jul 28, 2015 via email

@Redsandro
Copy link
Author

Hey @cam1985 thanks for the input.

Although the link you provided is the same as the one I mentioned as pain in the neck, I'm afraid there's indeed no simple way to list versions using a single command, and frankly I have to say this is in line with my expectations from a Microsoft technology.

Regedit.exe will be my partner in crime!

@cam1985
Copy link

cam1985 commented Jul 28, 2015

Sorry I missed that part of the conversation, :-(

Would a batch or powershell script that checked these values be of any use? If so which would you prefer?

@mwrock
Copy link
Member

mwrock commented Jul 28, 2015

take a look at the dotnet packages in my chocolatey-packages repo https://github.com/mwrock/Chocolatey-Packages each contains a registry check for that version of the framework.

@Redsandro
Copy link
Author

@mwrock are you sure when you tried that latest version that the binary was also updated?

I just tried it on a Win7 vm:

  • Boot Windows 7
  • Install the Chrome extension
  • Install DotNet 4.5.1
  • Go to Disable Windows Features... and disable DotNet 3.5
  • Reboot
  • Install something random from WindowsRemix.com

It just works. No request to install dotNet.

@mwrock
Copy link
Member

mwrock commented Jul 28, 2015

Have you tried 8.1 too? 8.1 does not come with 3.5 installed and if the installer is specifically looking for v3.5 (which seems to be the case) then it would push that download. win7 comes with 3.5 as its installed version instead of 4.5.

@Redsandro
Copy link
Author

Yes, that's why I removed it from windows features. However, my Windows 8 installation seems to have dotNET 2.0, 3.0, 3.5 and 4.5 pre-installed as Windows features.

When I install the framework manually, it is installed as a program, not as a Windows feature. Which leads me to believe that my particular version of Windows 8 has all these frameworks out of the box?

Not sure. Let me try to remove everything except 4.5 on Windows 8 and see what the extension does.

@mwrock
Copy link
Member

mwrock commented Jul 28, 2015

yeah. I believe you want to test 8.1 and not 8. Thats when they removed 3.5 I think. Its also gonna be a much more common use case.

@Redsandro
Copy link
Author

You are right. I currently have no fresh 8.1's. All my 8.1's are updated 8.0 RTMs.

However, shouldn't the deactivating of features handle this? It does remove files in the process.

Selfnote: http://www.asoft.be/prod_netver.html

@mwrock
Copy link
Member

mwrock commented Jul 28, 2015

personally i no longer test 8.0 anymore. Deactivating the feature does not remove the files. The change in 8.1 was they not only deactivated the feature, they removed the feature. I'm not sure exactly how the installer logic works and what it looks for but that may be it. maybe it tries to enable the feature but if it is removed, tries to download it. Not sure...

@cam1985
Copy link

cam1985 commented Jul 28, 2015

@Redsandro the app you have linked looks good. I've nearly finished a powershell script that does much the same, it returns the latest version installed and any previous as well. I just need to sort a couple of little bits out. But will be tomorrow now before I get a chance.

@Redsandro
Copy link
Author

@mwrock you are right. I will get back to you once I've spotted a clean 8.1 Windows. Although allegedly, tomorrow, most windowses will upgrade themselves to Windows 10. :)

@cam1985 ps script would work. I encourage you finish it anyway and put it in a gist and provide it as an answer to the many stack overflow questions. People love ready-to-use solutions that don't require compiling. That's why I like the previously linked odd looking but functional tool.

@mwrock
Copy link
Member

mwrock commented Jul 28, 2015

haha. you are right. I've been on the tech previews for months so its not such a big deal but I think you would see the same issue there.

@Redsandro
Copy link
Author

@mwrock slightly unrelated:

Any thoughts on this free upgrade they provide? They will probably upgrade the system while preserving all installed software and settings.

This is what I (and the rest of the world) want(s), because I (we) don't have time to deal with a fresh installation. However, upgrading a major version in stead of fresh install has always been a notoriously bad idea, both in Windows and in Linux.

@mwrock
Copy link
Member

mwrock commented Jul 28, 2015

my experience has been very smooth each time I have upgraded to a new build. Have not lost anything. I have to say its surprisingly impressive. I have not done any fresh installs and that seems to have been ok. Your mileage may vary.

@Redsandro
Copy link
Author

👍

I'm looking forward, even if it's only because I have a license (the sole reason being work-related Adobe Creative Suite usage) but I hardly ever use it, so the free upgrade sounds like fun. :P

Anyway, I'll get back on this once I've managed to do a proper test on at least fresh 8.1 and dealt with the alleged problem. 😉

@gep13
Copy link
Member

gep13 commented Jul 29, 2015

There is a utility out there that detects the version of the .Net Framework that are installed:

https://chocolatey.org/packages/dotnetversiondetector

I wonder if it can output the results somewhere for parsing/inspection.

@Redsandro
Copy link
Author

@mwrock I have updated the extension's binary to use .NET 4.0 / 4.5.

The file is not offered when the extension is updated (because the people using it now already have .NET 3.5 anyway and I don't want to bug them), but if you remove the extension and add it again it will offer the binary again.

I googled high and low, but to support both 3.5 and 4.5 I would need to provide the configuration separately. I cannot embed the configuration in the binary. Stack overflow answers say it is not possible. So I decided to drop Windows XP support.

So it is supposed to work out of the box on Windows 7 SP1 and up. For Windows 7 and Windows Vista, you will now get bugged to install .NET 4 or 4.5 instead. But anyone in their right mind will not run Vista anyway, and will have a fully updated system anyway. 😄

Is this solution satisfactory? I already like it since I've updated quite some machines to Windows 10 now. :)

@Redsandro
Copy link
Author

@mwrock I don't have permission to re-open this issue. I hope this notification gets your attention. 😉

@cam1985
Copy link

cam1985 commented Aug 18, 2015

@Redsandro - Sorry for the delay in getting back to you with the Powershell Module. Unfortunately I have been unwell, away etc. But I have just got a chance to finish and upload a version that works. There are a number of functions you can call once you import the module:

Get-DotNet-LatestInstalledVersion - This retrieves just the latest version number

Get-DotNet-LatestInstalledRelease - This retrieves the last release number from the last version that used a release number

Get-DotNet-InstalledVersions - This produces a list of the installed versions of Dot Net

Get-DotNet-InstalledReleases - This produces a list of the installed release numbers from versions that have release numbers

Get-DotNet-Information - This gives a summary of what is installed on the current computer using the other functions

Hope this helps and is not too late.

@Redsandro
Copy link
Author

Sorry to hear you have been unwell. Unfortunately for this project I have already figured it out. The extension has been re-released with .NET 4 dependency and it works well. I've been using it on Windows 10 machines. I'm waiting to hear back from @mwrock to see if it's up to his standards to recommend this to Chrome users in stead of the outdated one.

As for your module, it's still convenient to have in a number of scenarios. Where can I find the module to import?

If it's possible, it would also be convenient to have a single posh command that automatically downloads the module and then runs Get-DotNet-Information. Like the command to install Chocolatey is one line of posh.

@mwrock
Copy link
Member

mwrock commented Aug 19, 2015

Sorry for the delay. I just tested this again and it does indeed work. Nice job! I'll make sure it gets recommended on the website in the next release.

@Redsandro
Copy link
Author

👍

Chrome is still much better than Edge.

@mwrock
Copy link
Member

mwrock commented Aug 20, 2015

Agreed!!!!!

@cam1985
Copy link

cam1985 commented Aug 20, 2015

@Redsandro Sorry i forgot to post the link. I haven't included it within the boxstarter project as of yet as I wanted to ensure it would be needed/wanted/useful. Let me know what you think and if it is if @mwrock agrees we can maybe include the module or change it back to a .ps1

https://github.com/cam1985/Get-DotNet-Information

@wackogracko
Copy link

I apologize for reviving an old thread but I have been using the Windows Remix ClickOnce handler for hte Deltek Ajera program and a recent update to Chrome has caused it to stop functioning. I now get this error when trying to launch the application with the extension installed (I doubt this will be helpful since it is an error from the Deltek code):

image

I'm confident this is an issue with the extension because the application runs fine in IE 11.0.9600.18792 but not in Chrome Version 62.0.3202.94 (Official Build) (64-bit).

Any help would be greatly appreciated.

@wackogracko
Copy link

I'm also getting this error:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants