It is possible to force update a running winform application without restart it using ClickOne publishing? - winforms

I try all the possible configuration in ClickOnce but the application only updates on restart.
I want the application to update after the application startup but in VS 2022 the update after startup is blocked as we can see in the following image:
I am using .net core 6 and my IDE is VS2022.

According to the documentations, checking for update before the application starts, is the default and only option available for .NET 3.1 and newer versions:
For .NET 3.1 and newer applications, checking updates before the application starts is the only update option supported.
ClickOnce update strategies
Here is a summary of main ClickOnce update strategies:
Automatic update - Check for updates after application startup
In this strategy, ClickOnce will check updates in the background when the application starts. Then, the next time when the user starts the application, based on the result of previous check-for-update, if an update was available, it shows a prompt to the user asking to download and install the updates.
Main use-case for this scenario is low-bandwidth networks or large applications when updates takes longer to download and install.
Automatic update - Check for updates before application startup
In this strategy, every time the user starts the application, the application first checks for an update and if an update is available, it downloads and applies the updates and then start the application.
It's the default strategy and as I mentioned above, it's the only available option for .NET 3.1 and above.
Main use-case for this scenario is high-bandwidth networks and also cases which you want to make the update mandatory.
Manual update - Provide a user interface for updates
In this strategy, developer writes code using the ApplicationDeployment class to check for updates; For example checking for update based on when users clicks on a menu item or button; or based on a custom user-defined schedule.
The main usage scenario for this strategy is when you want to have different strategies for different users, or custom scheduled updates for different users, or to have a manual check for update button/menu.
To learn more, take a look at the following doc articles:
Choose a ClickOnce update strategy
How ClickOnce performs application updates
How to: Check for application updates programmatically using the ClickOnce deployment API

Related

click once application slowness issue

We have a strange problem. We have a click-once deployed application at a customer site that is experiencing slowness. It happens every time they launch the application, regardless of whether new updates have been applied or not. So it has nothing to do with first time loading slowness. The target framework is .net 4.5 and the application itself is a wpf application.
If we execute the .exe directly from where the click-once install puts the files in, then there is no delay whatsoever.
As far as I can see there is nothing that we are doing that is special in code...that is specific to click-once installation.
Any ideas?
when a clickonce application starts up, it checks for updates. Where do you have the updates stored? That may be where the slowness is coming into play.
On the publish tab, under updates, you can specify how often your app will check for updates. It can check for updates after the application starts which will speed up start time, however, updates will not be installed until the next time your app runs.

Run application updates with non admin users

I'm using a windows installer package to distribute a winforms application to several clients and because some of them have changed their security policies I need to figure out a way to run the application updates (through the installer) for users without administration rights.
Find below some information regarding the update process:
- The installer is created using InstallAware
- During the update process the old version is uninstalled and the new version is installed.
- The installer needs admin rights because it writes to the registry and installs some windows services.
- The application is installed in the program files folder.
At this moment the solution that I'm implementing is create a new scheduler task, that runs a simple console application that check for new updates and if a new version exists it downloads the installer and executes it in silence mode (the entire installation will execute silently, without a user interface, or any user intervention. The default values of dialog controls will be used).
Some consideration about this solution:
- It's difficult to handle possible errors during the update process.
- It's not possible to alert the user that a update process is running (because the scheduler tasks runs with a different user is not possible interact with the logged user).
Has anyone ever implemented anything similar? Is this the best way to achieve my goal?
If the updates are patches, and you meet a certain set of requirements regarding the first install of the product and sign both the MSI and the patches there is a mechanism for limited users to apply patches, UAC Patching described here:
http://msdn.microsoft.com/en-us/library/aa372388(v=vs.85).aspx
If you search for LUA Patching (its original name) or Least-privilege patching there's more info out there, although it's fairly obscure. If the security policies that they have in place include setting DisableLUAPatching then you won't be able to use it.

Any way to push new version of WPF Application plus database changes (Sqlite) without using click once.

I am working on a WPF application. I need an intelligent mechanism for updating my software and some other stuff such as database (My database is Sqlite) and application pre-requisites. Also, in my update I should be able to push application as well as database changes. Click once wont suit my requirements. Whenever, a new version is available, I should be able to track it on application start and force the user to go for the new version only.
Once an application is Compiled that is it. You can make you application Data Driven and this would work, however you will have to account for all the changes you need ahead of time. Why don't you do the following:
Create your WPF application
Create a WCF service that runs on your server.
Have you WPF application poll the WCF service to check if an update occurs
Have your WPF application download the new version off your server and force the user to update.
When the application reopens make it run the webupdate version and not run the old version.
Problem to think about:
How do you want to handle if the user has no internet?

Silverlight 4 Out Of Browser: Check for Updates without installing?

I have created a Silverlight 4 application, that is running out of browser. As you will know, there is a function that is checking if a new version of the app is available and installing it.
But what if I want to only check for the update and not installing it?
Personally, I do not like applications that silently update themselves, downloading something from the internet. So I'd like to have the following mechanism.
- when the app starts, it checks if updates are available
- if so, I show a messagebox to the user, telling her that there is an update and that she can download and installing it via the update-button
- the user can now decide to update
Unfortunately, there seems to be no option to just checking for updates without actually downloading and installing it. Any ideas, how to achieve this?
Thanks in advance,
Frank
You can roll your own update detection, by having a small file on your server next to the XAP for your app, that contains the latest version. For example:
http://localhost/myawesomeapp.xap
http://localhost/myawesomeapp.xap.ver
When you want to check for updates without downloading them, you can always hit the .ver file, check the version listed in it and if newer then the current running app, show the Update button to the user.
Note that this approach also would allow you to create more advanced scenarios, like prompting the user to upgrade to a different version of the app (Pro for example) or that they need to upgrade their Silverlight to get the latest.
And if you have multiple apps, you can list all of them in that file and do cross-promotion between your apps.

Utility to get the latest version of a windows forms app from a network share

Is there any utility that will copy the "official" build of a windows forms app from a central network share and launch it (from a client desktop)? I want to make sure users get the latest version when I update the binaries on the central network share.
ClickOnce is user un-friendly so I'm looking for something else...
Is it possible you could revise your question to describe what it is you find unfriendly about ClickOnce? In my office we have found ClickOnce to be the most efficient and user-friendly way of updating and distributing applications desktop business apps that we have ever had. I'm wondering if the best way to resolve your question might be to address the issues you have with ClickOnce, rather than integrating/rolling another solution.
I've done this before by the following method:
1 - Keep the "official" build at a specific network location
2 - User launches program from their local machine
3 - At launch, program compares its' own file version # to the one on the server.
4 - If the two versions are different, copy the new version down from the server and relaunch.
Pretty simple, and it works as long as you are in an intranet environment.
Step 4 is the only tricky part. You can't replace a file while it's in use, so you have to either
1 - first rename the current (in-use) file and then copy down the new one. Since you will be updating many times, you'll also want to delete any existing renamed copies that are hanging around.
or
2 - Have the user launch a "helper" application that does the version check, updates if necessary, and then launches the real app. Of course then you have to deal with updating the helper app.
We have a tool that would do that, which has been in use before there was such a thing as Windows Update (or any other update.)
The problem with any sort of update of this fashion is the security level of the user. Many times you need to be administrator to perform certain functions.
Our solution is two part/one executable: 1. a service mode that runs local system or admin to perform such operations. 2. an executable which can be called by an app to fetch via UNC, HTTP, FTP the updates for an application and apply them.
The basic process is this:
1. Application checks its version number; we use a central database to list all applications and their version numbers.
2. If the application is a minor revision we give the user an opt out on the install; if it is a major revision we require an install.
3. Once the update is confirmed, we call the updater executable which in concert with its service mode product, retrieves the updates, installs them, and relaunches the application.
If you are interested, go to the website listed in my profile and send us a support request address to me and I will give you more details and the codebase if desired.
Check out this one:
.NET Client Applications: .NET Application Updater Component
It is a white paper which discuses in detail on what it takes to make an application auto-updatable.

Resources