-
Notifications
You must be signed in to change notification settings - Fork 760
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
Once download complete , autoupdater not close the running programm first. the update failed #11
Comments
If you see the source code it just does that. Which type of application are you developing (WPF, Winforms, Console etc.)? |
I am sure it does not close program, the updater hang up . |
can you please provide an api to force exit the parent process/application |
for Example. Autoupdate.OnDownloadComplete(()=>Application.Exit()) |
The problem is this . you really should close the running parent programm, then you can run zip extract . or the zip extract would not override the running files |
If you see above those lines are dedicated to doing just that. Close currently running application. |
sorry. it not works. but i found other solution
On Thu, May 4, 2017 at 8:11 PM +0800, "Ravi Patel" <[email protected]> wrote:
https://github.com/ravibpatel/AutoUpdater.NET/blob/master/AutoUpdater.NET/DownloadUpdateDialog.cs#L74-L90
If you see above those lines are dedicated to doing just that. Close currently running application.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I have the same problem with a WPF app (using currently click once, but autoupdater is only used when not clickonce-launched), and if I don't kill manually the application, autoupdater is not able to kill it. I'm wondering if there's an event I should use to kill my application gracefully by itself. (I think I can send you my application if needed to check what is happening..) |
@guillaumejay Yeah, if you can provide me with the application I can see what is the issue. |
Would it be relevant if I only send (where) you the relevant exe (and its dll) ? We worked a bit and found two things :
|
@guillaumejay As long as I can test AutoUpdate part it's completely fine if you send only relevant exe and DLL. |
I sent you a message using uservoice. Thanks for any help you can bring. |
I want to confirm this issue, as I am experiencing it as well. WPF application, .net 4.0 Client profile - If I manage to click the update button before the application starts, all runs well, once my Initialize function goes through, the update fails and the old version is restarted. |
@JasonXtreme Do you use CefSharp? |
@ravibpatel I do not. I downloaded the source code, found the issue was within ZipExtractor - where you check for (speaking from memory, on my phone) Process.StartInfo.FileName.Equals(args[2]), the FileName was consistently empty (for all 170 processes). Changing StartInfo to MainModule fixed it for me. |
Nice find. Just read the MSDN and found out the reason for this. My bad for not reading the full doc. "If you did not use the Start method to start a process, the StartInfo property does not reflect the parameters used to start the process. For example, if you use GetProcesses to get an array of processes running on the computer, the StartInfo property of each Process does not contain the original file name or arguments used to start the process." Can you open a pull request with that particular change so I can add you as a contributor? |
Great, I hope it will solve my problem.
…On Fri, Jun 9, 2017 at 6:11 PM, Ravi Patel ***@***.***> wrote:
Nice find. Just read the MSDN and found out the reason for this. My bad
for not reading the full doc.
"If you did not use the Start method to start a process, the StartInfo
property does not reflect the parameters used to start the process. For
example, if you use GetProcesses to get an array of processes running on
the computer, the StartInfo property of each Process does not contain the
original file name or arguments used to start the process."
Can you open a pull request with that particular change so I can add you
as a contributor?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE-uVmoNJ-XEpUTPIjAsfoF5uIlmKsf1ks5sCW62gaJpZM4NO540>
.
|
Gladly, but it won't be before monday. Cheers!
…On Jun 9, 2017 18:11, "Ravi Patel" ***@***.***> wrote:
Nice find. Just read the MSDN and found out the reason for this. My bad
for not reading the full doc.
"If you did not use the Start method to start a process, the StartInfo
property does not reflect the parameters used to start the process. For
example, if you use GetProcesses to get an array of processes running on
the computer, the StartInfo property of each Process does not contain the
original file name or arguments used to start the process."
Can you open a pull request with that particular change so I can add you
as a contributor?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABlXXUc2BoVhmQkXt29iL-aZcwpLJmysks5sCW62gaJpZM4NO540>
.
|
@guillaumejay I afraid it won't fix your problem. I created a minimal application using CefSharp and Environment.Exit() can't kill it. I am working on a workaround. I will email you a fix when I have it. |
Did you manually call cef.Shutdown too ?
…On Sat, Jun 10, 2017 at 7:12 AM, Ravi Patel ***@***.***> wrote:
@guillaumejay <https://github.com/guillaumejay> I afraid it won't fix
your problem. I created a minimal application using CefSharp and
Environment.Exit() can't kill it. I am working on a workaround. I will
email you a fix when I have it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE-uVr_Fjf_gJqj5p_L80LlmEeE7tTU2ks5sCiWrgaJpZM4NO540>
.
|
@guillaumejay No, but when I tried with Event Application.Current.Shutdown() can kill the application. |
I have the same problem. |
@stebla27 I got the fix. Just download the Beta from here and try it out. You need to handle ApplicationExitEvent though. I am still working on it so you don't have to do it in future. AutoUpdater.Start("http:https://rbsoft.org/updates/AutoUpdaterTest.xml");
AutoUpdater.ApplicationExitEvent += delegate
{
Application.Current.Shutdown();
}; |
@ravibpatel |
@stebla27 There is event already available for this purpose. See Handling updates manually section. You can do whatever you want to do before downloading and installing the update in this event. ApplicationExitEvent is not so bad but the idea of adding an another line for it to work bothers me. It should me nice if the developer can add AutoUpdate functionality using just one line. |
The problems unfortunately still exists. |
@stebla27 It was happening with the beta I provided earlier too? |
@ravibpatel: As it does not happen on all PCs and it is a timing issue I'm not 100% sure. But with the beta I got no customer reports. After upgrading to the official nuget package (including your fix) the behaviour is just like before. |
@stebla27 Problem with the beta is if user use Remind later option then it throws an error when ApplicationExitEvent is called. |
@stebla27 Which .NET Framework you use and is your application using any third party libraries other than this? |
@ravibpatel .Net Framework 4.5.2 |
@stebla27 Where you call the Start method (constructor of MainWindow)? |
@ravibpatel Yes in constructor of MainWindow. |
@ravibpatel Regarding the "Remind later" option |
@stebla27 Can't reproduce the Remind Later exception. Did you get the stack trace for the error? Can you share me the location of your XML file? If you can't do it here, you can share it on http:https://rbsoft.uservoice.com. |
@ravibpatel Unfortunately I have no stack trace. Only the information that exception occurred in UpdateForm.Designer.cs. |
@stebla27 Can you try the beta from below to see if it fixes your problem? https://www.dropbox.com/s/xg2543cmlcff04a/AutoUpdater.NET.zip?dl=0 |
@ravibpatel: The problem is I can't reproduce it on my machine. I've only see it on customer platforms and here I can't really test.
Should there an additional check if application is already closed? |
@ravibpatel : Ok, waiting for the process to exit is OK. You don't need a retry behaviour here. Example:
|
I tested AutoUpdater on Windows Embedded POSReady 2009 Version 2.0 SP3(could be seen as XP) with .NET 4.0, and the issue still exists. Although it could success after I tried clicking update button for a few times(maybe 3~5 times), it still can't be acceptable to use.
inside the Main UI and after |
Once download complete , autoupdater not close the running programm first. the update failed
The autoupdater just restat running programm, and it still old version , not update to latest version.
so why not close running program, then update, then start new program.
The text was updated successfully, but these errors were encountered: