-
Notifications
You must be signed in to change notification settings - Fork 50
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
Improve update detection for .NET (Core) applications deployed with ClickOnce #27
Comments
Would there be any reason ClickOnce couldn't just drop a JSON file with information into the application directory when it is started? It seems like this would allow an easy way for the application find out information about the install (ie put the version thats on the server, the install URL etc). It could have extra information in it that would allow the developer to take action based on the information (exceptions?). This would also make it fairly extensible so if someone wanted to add information in the future they could and generally applications will just continue to work. |
@Rmurray0809 yes, a similar approach is considered - we'll have more details on the design soon. |
Any updates about this? |
For those people who want to use ClickOnce on .NET 5 and want silently update, I wrote a small wrapper that implements some of the ApplicationDeployment properties:
Hope this helps someone: https://github.com/derskythe/WpfSettings |
I definitely need the functionality of ApplicationDeployment. I can't seeing declaring victory of bringing ClickOnce to .NET 5/6 without it. This is mainly because the limitation of only checking at application startup is annoying for most users. It's funny that they don't mind a splash screen with loading progress, but they mind this. Mainly because they want update checking AT THEIR CONVENIENCE. And I agree in the case of most of my applications. Thanks for any consideration. Without it, it's back to commercial installers. |
Totally agree - without in-app updating ClickOnce is neutered. MSIX is not a real world alternative at present. Under NetFX ClickOnce proved it's reliability which is presumably why it made the cut to .Net5/6. So please re-open this issue and let's have a progress update. Thanks. |
Unable to port WinForms project from .NET Framework 4.8 to .NET 5.0 due to the following issue: |
Thanks for posting this workaround for the missing ApplicationDeployment methods in Net5. You mention that the workaround features Silent Updates. However on my setup OpenURL(setuppath) in your Update code boots my browser and offers to download the application manifest manually. Any idea how I can get the app to update silently ? Thanks. |
If you just need an "Update Now" button in your app, you can shell out to this command and then exit. rundll32 dfshim.dll,ShOpenVerbApplication http://yourupdateurl/yourapp.application |
This is on the 6.0 milestone, so will this be fixed until next week? |
I just tried to migrate a net4.8 app to .NET 6 when I came across this issue. |
Based on ideas/code from @derskythe, @alansingfield, @e-master, I created a repro at https://github.com/simmotech/Net6ClickOnce which passes through all the info from args/ApplicationDeployment/ActivationArguments to the .NET 6 ClickOnce app. It also allows in-app detection of any later version and updating to that version on close. Might be worth a look to use until an official fix is made. Grateful for any suggestions/further testing. |
Great to see ClickOnce in Net6, but still no progress on restoring the in-app updating functions in Application.Deployment. Is there any update on this issue ? Net 7 maybe ?? |
@NikolaMilosavljevic Do you have any news for this? |
We are definitely tracking improvements in ClickOnce experience for .NET (Core) apps, for upcoming release. You can expect to see some designs published in the next several weeks. Improvements might be brought up in stages, to allow for a better design and experience, as well as more testing with early previews. |
Hello! Will this be available on .NET 7? Thanks! |
The work to expose properties of ApplicationDeployment class to .NET app is happening right now. It will be available soon, in one of our Previews, during .NET 7 development. Please note that dotnet-mage ships as .NET Global tool and not as part of .NET release (i.e. 7). |
@alansingfield : With original .Net4.8 update mechanism, I used to run with the "dfshim.dll" approach I have 3 issues:
Is there a way to improve this, especially point 3? |
except the issue discussed above, I have another question, anybody know why a .net 6 WPF application with "online" mode only, cannot update itself when a new version published?(the application is not signed, but I didn't see any doc says update detect needs sign) |
@heku was the application built using dotnet-mage or ClickOnce publishing in Visual Studio? |
@NikolaMilosavljevic The VS ClickOnce behavior in .NET 6.0 apps is consistent with .NET 4.X. Update is not enabled if app is Online only. |
@sujitnayak visual studio, it is totally different as my expectation, I thought Online mode means always “latest”, if so, what the purpose of Online mode? |
@John-Hart Thx, I saw the doc before, it only says the difference of online/offline is online needs access to publish location, never mentions any difference about update behavior |
Behavior of auto-update not being available in online-only mode is not new to .NET 6.0 apps. .NET 4.X apps have had the same behavior as you can see in the screenshot attached: Auto-update is for apps that are installed locally on the machine (visible in Add Remove Programs and Start menu) which happens only when offline mode is also available for the app. |
@sujitnayak ok, the "updates" button is disabled for Online mode, I thought it means Online mode app is always up to date, that what I really misunderstand. since it has same behavior as .NET Framework, I have no question any more, thank you. |
Any update on this ? .Net 7 was released yesterday yet ApplicationDeployment class is still unrecognized. Do we need to install something else in order to get this working ? |
ClickOnce support for .NET ships separately from main .NET (i.e. .NET 7). It ships as a global tool. We will be releasing version 7.0.0 of dotnet-mage in the next few days. This feature is available in our preview release: https://www.nuget.org/packages/Microsoft.DotNet.Mage/7.0.0-preview.2.22317.2. For all previews you'd need to specify explicit version number, to install it, following the steps for the tool installation from the doc page: https://github.com/dotnet/deployment-tools/tree/main/Documentation/dotnet-mage Please note that this feature is already available in Visual Studio 2022 build 17.3 or later. Here's the relevant PR with more details about this feature and some examples: #208 |
@NikolaMilosavljevic Is there an alternate to UpdateAsync, a way to install the update in the backgroun? I understand the app has to be restarted anyway, but it provides a way to download and process update in the background without paying a cost on open and showing a dialog to the user whether to install the update or not. |
@NikolaMilosavljevic |
Yes, at the moment, those would be the only 2 solutions. You could use that sample wrapper class or create a new own. Reading environment variables would also work, if you only need to use a few. |
There is no alternative today, for silent update, which was provided by UpdateAsync in the past (for .NET FX apps). That experience requires running update in the app context, which isn't possible today as System.Deployment library is not available in .NET. We understand that this is an important scenario for some applications and will be looking into ways to close this gap in experience. |
I noticed that the ApplicationDeployment.cs class still missing the 2 methods that are available on ClickOnce for .NET 4.8 Framework:
Is there any plan to implement them or any alternative methods to them on .NET 7.0? Thanks in advanced, |
That is correct. The sample class adds support for obtaining properties and does not have any methods related to updating the app. We understand that this is an important scenario for some applications and will be looking into ways to close this gap in experience. |
Thank you very much for your prompt reply @NikolaMilosavljevic ! Thanks again! |
Those features are not planned for 7.0, which GA'd last week. dotnet-mage, which will GA in a day or two, always support building deployments for older .NET versions, unless that is not feasible. For instance, new features that we add in dotnet-mage version 8 would support .NET 8.0, and all previous .NET releases. |
Just following up @luronumen and your response:
Has there been any progress in restoring methods for updating ClickOnce apps ? Is there a timeline to include them in .NET 8.0 ? Thanks for continuing to develop ClickOnce ! |
are you guys not releasing a non preview version to a LTS NET version?. We are currently releasing to NET 6 and due to short-term support not releasing to NET 7. you should also target to NET 6 because it is LTS. |
CheckForDetailedUpdate |
Any update on the support for methods from the ApplicationDeployment class? Or somewhere there is a proposal we can track for this? I understand the technical challenges with the .Net/Core changes compared to framework, but surely there is a way... |
This issue (and the lack of workarounds) is preventing us to migrate to .NET7 |
Could we just have an idea of if/when this functionality will be restored? Please just say yes or no, so we can possibly take other ways. Thanks |
There are no immediate plans to add official support for in-app update functionality. There are some, perhaps less-than-ideal workarounds, provided in the comments of this issue. It is worth exploring and fine-tuning those options today. .NET applications can access Application deployment properties using methods described in this PR: #208 Besides here at GitHub, I would also suggest voicing these and similar requests through Developer Community site: https://developercommunity.visualstudio.com/home |
Hello @NikolaMilosavljevic , any update or possible planning yet to support the extra methods ? |
.NET (Core) applications deployed with ClickOnce cannot use
ApplicationDeployment
class for on-demand update check.Besides checking for new updates, this check can be used to ensure that the deployment is still available on the server and wasn't deleted. If application is doing silent updates, without this check, user won't be aware that application is not getting any updates.
Launcher could do the update check if application is configured to install new updates automatically. We need to find a way to communicate the result of this check to .NET (Core) application. We could potentially also include the result of any recent automatic update.
The text was updated successfully, but these errors were encountered: