Hi,
I bought last month your component and I'm trying do this:I need to do a verbose update in my wpf app. The application must display a message "An update is available. Download now?"after clicking yes a form will open with "download now" button and a progress bar. After downloading, an "Install now" button appear to do the update. Moreover I need a button "Update now" in the app that force to check for updates...this because may be the app will be updated more that one time a day and I see that on the second, third update the UpdateAvailable event is not invoked even f I set DaysBetweenChecks to 0.
Here is my approach:
automaticUpdater1.UpdateAvailable += new EventHandler(automaticUpdater1_UpdateAvailable); void automaticUpdater1_UpdateAvailable(object sender, EventArgs e) { .....here show messagebox "An update is available" is user press ok: Update update = new Update(); update.ShowDialog(); }
in the Update form:
private void window_Loaded(object sender, RoutedEventArgs e) { mainForm.automaticUpdater1.ProgressChanged += new wyDay.Controls.UpdateProgressChanged(automaticUpdater1_ProgressChanged); mainForm.automaticUpdater1.ReadyToBeInstalled += new EventHandler(automaticUpdater1_ReadyToBeInstalled); }
private void DownloadUpdate_Click(object sender, RoutedEventArgs e) { mainForm.automaticUpdater1.InstallNow(); }
void automaticUpdater1_ProgressChanged(object sender, int progress) { this.progress.Value = progress; }
void automaticUpdater1_ReadyToBeInstalled(object sender, EventArgs e) { btInstallNow.Visibility = System.Windows.Visibility.Visible; }
private void btInstallNowClick_Click(object sender, RoutedEventArgs e) { mainForm.automaticUpdater1.InstallNow(); }
Now the problem is:
if I force the update (as I said before the updater don't check it automatically because may be the second update during the same day ) with automaticUpdater1.ForceCheckForUpdate(true); the UpdateAvailable event is raised, the Update form open but when I click "download now" button nothing happens (no progress changed is raised) If I restart application, UpdateAvailable is raised automatically (without forcing) and all works fine.
Help me,Sergio CapozziPhotocity.it