Comments (5)
Ah, I see. You're using WPF, that's the problem. But, in any case, that wouldn't have been the necessary event. ;)
Version 3.x of nUpdate requires a small workaround for WPF as nUpdate, by default, calls Application.Exit
which will not close the host application correctly. The library was originally invented to serve only for Windows Forms.
To fix that, create a new class and add this content:
using nUpdate.Updating;
public class WPFUpdateManager : UpdateManager
{
public WPFUpdateManager(Uri updateConfigurationFileUri, string publicKey, CultureInfo languageCulture) : base(updateConfigurationFileUri, publicKey, languageCulture)
{ }
public override void TerminateApplication()
{
Environment.Exit(0);
}
}
Then use that class instead of UpdateManager
. This should fix your problem.
This will be fixed in v4 as WPF will become fully supported then.
from nupdate.
Hi,
there are a bunch of misunderstandings here with regards to the UpdaterUI
class.
First: You must set your properties before starting the update process.
The line manager.RestartHostApplication = false;
should consequently be placed above the call of updaterUI.ShowUserInterface()
. The reason is that the class UpdaterUI
does everything automatically in this method (seaching, downloading and installing) and thus, your program will be terminated at the end of this method, not taking care of your property. In any case, the UpdateManager
instance must already be fully initialized when you're handling it over as argument to the constructor of UpdaterUI
as this one keeps its instance in a backing field not noticing any further changes.
The second problem, that is also responsable for the event not being fired, can be split into two parts:
The UpdaterUI
class, as already mentioned, implements the whole update process over the UpdaterManager
, so that the user does not have to do anything else than calling ShowUserInterface()
.
Now, there are two configurations of nUpdate. The one is ProvideTAP
(offering the Taskbased asynchronous pattern) which you may be using, I think, and the other one is WithoutTAP
(offering the Eventbased asynchronous pattern only). WithoutTAP
will be removed in v4 btw.
Now, the UpdaterUI
is determining the used configuration and either uses Tasks + async/await, or async methods with events then. But, in any case, even if you use EAP, the class is not designed to fire any events aiming that the user should handle them. The reason is, as already described, that everything is done automatically and there is no need for subscription of events. The events should only be used when you're implementing a custom UI or no UI at all. That would mean that you only use the UpdateManager
itself and in this case you may implement the updating process using events.
tl;dr: UpdaterUI
is a finished implementation of the UpdateManager
for offering the user an integrated user interface and besides that, the user does not have to do anything else. You can also have a look at it on GitHub to see how this is working internally.
Happy Easter,
Dominic
from nupdate.
Much thanks for your answer!
My root problem is, that nUpdate does not close my application while installing, therefore the user have to do it manually. This is the reason why im trying to catch the event.
May you help me a little bit out.
from nupdate.
This works!
Thanks alot!
from nupdate.
See also: #31
This issue is now fixed and thus, a workaround is no longer necessary.
from nupdate.
Related Issues (20)
- Question: Merging Files HOT 10
- Updater doesnt work (Path may contain an empty string or just a space.) HOT 5
- Update window style issue HOT 1
- Errors uploading package, deleting package, checking configuration file HOT 19
- "update.json" file is inaccessible
- ios
- Can I use this project in my c++ project? HOT 1
- Thanks for reaching out!
- nUpdate Administration: Operations not responsive HOT 2
- Provide a usage example directly inside readme HOT 1
- is this project still alive? HOT 2
- Software is already up-to-date HOT 5
- Question: Invalid signature data found HOT 8
- SFTP Support HOT 2
- Agenda HOT 1
- Using no user interface HOT 1
- Problems reading the "updates.json" from ftp HOT 5
- Opens program after successful update HOT 2
- Please make a youtube tutorail how to use nUpdater #feature
- Sign "nUpdateInstaller" with a Certificate HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nupdate.