Resolved Problem with Click-Once Deployment

robertb_NZ

Well-known member
Joined
May 11, 2010
Messages
146
Location
Auckland, New Zealand
Programming Experience
10+
My software is made available by click-once deployment from the Jazz Software web site. After an earlier issue was resolved deployment has worked correctly since May 2016, but now it doesn't seem to recognize that a new version is available and download and run it. Clicking the Get Jazz button simply downloads the software but doesn't start it.
My startup code is basically
VB.NET:
If System.Diagnostics.Debugger.IsAttached Then ' Case 1: Debugging (run from Visual Studio)
' Code for debugging
ElseIf IsNothing(ApplicationDeployment.CurrentDeployment) OrElse IsNothing(ApplicationDeployment.CurrentDeployment.ActivationUri) _
OrElse IsNothing(ApplicationDeployment.CurrentDeployment.ActivationUri.Query) Then
' Case 3. Run downloaded copy offline if the saved license token is OK
Else
' Case 2. Run from JazzSoftware web page.   Save the license token for offline running.
End If

This hasn't changed since 2016. Since the last release I've changed VS2017 => VS2019 and Edge has updated to a chromium-based version. Both are up to date. Other software updates seem unlikely to be relevant.
Symptoms are: click "Get Jazz" and the software is downloaded (whether it has changed or not). Click on the downloaded software and it will start, this always takes the path "Case 3: Run downloaded copy offline". Because of this there is never a valid license, and it only runs when I use a back door to bypass the license code.

Previous behavior: clicking Get Jazz would check if the local version was obsolete and download a new version if necessary, then MANASYS Jazz would be started whether or not there had been a download. This went through Case 2, Run from Web page.

I experimented by publishing a version with "the application is available online only". This behaved exactly the same way.

Any ideas? I've been trying to sort this out for a couple of days, and I'm out of ideas. The software works as it should when I use the back door code. The documentation for ApplicationDeployment doesn't suggest that there have been any changes to that class.
 
I'm still getting the same messages as before, so nothing has changed. They relate to an IBM component (DB2) specifying a different processor architecture to the rest of the project, but DB2 has always worked correctly both in test and in published version, including in a test with the most recent build that generates a program that updates a DB2 table. I can give you the full text of the publication messages if you want to see them, but I don't think that this is the answer.
 
Thanks JohnH. I'd been unable to find the problem, it had to be in my logic, or in the change from VS2017 -> VS2019, or the change to the latest Edge browser. I proved that it wasn't VS2017 -> VS2019, and in spite of testing for a couple of weeks with StartupTest I couldn't find anything wrong with my logic.

I created a test program (StartupTest) that was just my MANASYS Jazz startup code and a Window to display the results of getting the license, with logging to record information that couldn't be displayed by VS debugging because StartupTest was to be published and run from the web site. I deployed StartupTest with ClickOnce from LocalHost. ClickOnce worked perfectly, but I couldn't get StartupTest to work when I copied it to the real web site. The difference: the local test used Internet Explorer, but the real web site used Edge. Your post has explained this.

How to fix it? I've searched through all the Edge settings - there is no mention of ClickOnce. I googled "Chrome ClickOnce and found an add-in from Menarva on the Chrome store. I downloaded and installed this, but although the install dialog referred to Edge, it made no difference and I suspect that it updated Chrome, not Edge. I tried using Chrome but it didn't seem to work properly, I tried setting my default browser to Internet Explorer but that doesn't work either - it seems that somewhere in the series of Windows and Edge updates other browsers have been nobbled, perhaps not deliberately, but I get Blue Screens of Death, or flashing Internet Explorer screens, so I appear to be personally stuck with Edge now.

So how do I deploy my software? ClickOnce was perfect, with automatic checks for updates, downloads when there was a new version, and it was easy to program my application code to manage licenses from my web site. I need to get back this functionality, either by it being fixed properly by Microsoft, or using an alternative deployment technique. I want deployment to be easy for anybody who has a license (controlled by the web site). I'd prefer not to have to tell them to install an add-in if I can avoid it.

The reference you gave records this issue in January, and the comments infer that Microsoft is in no hurry to fix it. When it it going to be fixed? If not soon, or if you recommend alternatives to ClickOnce for general deployment (I have absolutely no control over the user's configuration) what deployment strategy do you recommend? We have a new release that I'm very keen to publish, if you recommend an alternative to ClickOnce I'll get to work on it right away.

Thank you for your help.
 
My mention was about the solution posted by Stan York in that thread, navigation to that address gives me this:

1601797838297.png


The solution also mentions and links to a Windows Remix ClickOnce Helper that is supposed to work with Edge and give a better experience. You can look in Extensions in Edge to verify if an extension is added there, the download button in Chrome Web Store won't change from 'Add to Chrome' even if you use the Edge browser.

Also from the linked docs:
Currently, Chromium doesn't provide native support for ClickOnce or DirectInvoke.
My guess is that native support never will be added also, but I wonder why Edge is configured like it is, since support can be enabled.
 
My guess is that native support never will be added also, but I wonder why Edge is configured like it is, since support can be enabled.

This is certainly weird, it means that the easy convenience of ClickOnce is lost. I'll check it out as an interim approach for the current release which has already "escaped" into the wild, but longer term it is too much to ask of users so I'm going to explore other deployment methods. Most software requires you to install the software through an install wizard, and don't require ClickOnce to be enabled. While slightly less convenient than ClickOnce when ClickOnce is working as designed, leaving decisions about accepting a software update to the user is an advantage.

I'll start by Googling "How to deploy a desktop app" and see where that leads me. Suggestions about the best papers to read would be great.
 
If it's activated via the flags page then, as that page says, it is an experimental feature. All such features are off by default. When Edge was built by Microsoft from the ground up, they could include ClickOnce support however they wanted. Now that Edge is based on Chromium, ClickOnce support has to be added within that context. It's basically in beta form at the moment but, once it has been developed to a satisfactory level, they will include it as a standard feature and, most likely, enable it by default.
 
If it's activated via the flags page then, as that page says, it is an experimental feature.
Of course... I didn't notice the notice on top when I browsed directly to the setting.
 
Eureka, that's brilliant. Now that I understand how to turn ClickOnce on in Edge (not at all difficult once I addressed my usual stupidity), I've updated the MANASYS Jazz Setup page with instructions on how to turn ClickOnce on, and quoting from and referencing this thread. No need to look for a new way of deploying my software. I'll mark the thread Resolved. Thank you JohnH and jmcilhinney!
 
Back
Top