diff --git a/BabySmash.csproj b/BabySmash.csproj
index e819b09..32eb71e 100644
--- a/BabySmash.csproj
+++ b/BabySmash.csproj
@@ -37,7 +37,7 @@
BabySmash
true
publish.htm
- 57
+ 74
1.0.0.%2a
false
true
@@ -61,6 +61,9 @@
4
+
+ 3.0
+
3.5
diff --git a/Controller.cs b/Controller.cs
index ef4f9c3..412242a 100644
--- a/Controller.cs
+++ b/Controller.cs
@@ -40,6 +40,12 @@ namespace BabySmash
void deployment_CheckForUpdateCompleted(object sender, CheckForUpdateCompletedEventArgs e)
{
+ if (e.Error != null)
+ {
+ Debug.WriteLine(e.ToString());
+ return;
+ }
+
ClickOnceUpdateAvailable = e.UpdateAvailable;
if (ClickOnceUpdateAvailable)
{
@@ -59,8 +65,15 @@ namespace BabySmash
if (ApplicationDeployment.IsNetworkDeployed)
{
ApplicationDeployment deployment = ApplicationDeployment.CurrentDeployment;
- deployment.CheckForUpdateCompleted += new CheckForUpdateCompletedEventHandler(deployment_CheckForUpdateCompleted);
- deployment.CheckForUpdateAsync();
+ deployment.CheckForUpdateCompleted += deployment_CheckForUpdateCompleted;
+ try
+ {
+ deployment.CheckForUpdateAsync();
+ }
+ catch (InvalidOperationException e)
+ {
+ Debug.WriteLine(e.ToString());
+ }
}
foreach (WinForms.Screen s in WinForms.Screen.AllScreens)
@@ -91,7 +104,7 @@ namespace BabySmash
//m.Height = 600;
//m.Left = 900;
//m.Top = 500;
- //////TODO: END - COMMENT IN for Debugging
+ ////////TODO: END - COMMENT IN for Debugging
//TODO: Start - COMMENT OUT for Debugging
m.WindowState = WindowState.Maximized;
@@ -111,7 +124,7 @@ namespace BabySmash
//if someone made us a screensaver, then don't show the options dialog.
if ((args != null && args[0] != "/s") && String.CompareOrdinal(ext, ".SCR") != 0)
{
- ShowOptionsDialog(ClickOnceUpdateAvailable);
+ ShowOptionsDialog(!ApplicationDeployment.CurrentDeployment.IsFirstRun);
}
}
timer.Start();
@@ -317,6 +330,7 @@ namespace BabySmash
o.Topmost = true;
o.Focus();
o.updateButton.Visibility = UpdateAvailable ? Visibility.Visible : Visibility.Collapsed;
+ //o.updateProgress.Visibility = UpdateAvailable ? Visibility.Visible : Visibility.Collapsed;
o.ShowDialog();
Debug.Write("test");
foreach (MainWindow m in this.windows)
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 59c8aac..959687c 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -6,24 +6,24 @@
Height="500" Width="500" WindowStyle="None" HorizontalAlignment="Center" VerticalAlignment="Center"
AllowsTransparency="True">
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Welcome to BabySmash!We're adding new features weekly.
- This week added click animations and all new graphics!
- Try the many options and find the ones that are right for your baby!
- There's even more fun coming soon!
-
-
-
-
-
-
-
-
- None
- Laughter
- Speech
-
-
-
- Hand
- Arrow
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Force Letters to UPPERCASE
-
-
- Faces on Shapes
-
-
- Hardware Effects (DISABLED FOR NOW)
-
-
- Clickless Mouse Drawing
-
-
- Transparent Background (Requires Application Restart)
-
-
-
- Fade Shapes Away in
-
- secs.
-
-
- Thoughts or ideas?http://feedback.babysmash.com
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Options.xaml.cs b/Options.xaml.cs
index f3aa135..67e6f1f 100644
--- a/Options.xaml.cs
+++ b/Options.xaml.cs
@@ -2,6 +2,8 @@
using BabySmash.Properties;
using System.Diagnostics;
using System.Deployment.Application;
+using System.Windows.Controls;
+using System;
namespace BabySmash
{
@@ -44,14 +46,26 @@ namespace BabySmash
if (res == MessageBoxResult.Yes)
{
// Do the update
- deployment.Update();
- MessageBoxResult res2 = MessageBox.Show("Update complete, do you want to restart the application to apply the update?",
- "Application Updater", MessageBoxButton.YesNo);
- if (res2 == MessageBoxResult.Yes)
+ try
{
- // Restart the application to apply the update
- Application.Current.Shutdown();
- System.Windows.Forms.Application.Restart();
+
+ deployment.UpdateProgressChanged += deployment_UpdateProgressChanged;
+ deployment.UpdateCompleted += deployment_UpdateCompleted;
+
+ Canvas.SetZIndex(updateProgress, (int)9999);
+ Canvas.SetZIndex(updateButton, (int)1);
+ updateProgress.Value = 0;
+ updateButton.Visibility = Visibility.Collapsed;
+ updateProgress.Visibility = Visibility.Visible;
+ updateButton.IsEnabled = false;
+ okButton.IsEnabled = false;
+
+ deployment.UpdateAsync();
+ }
+ catch (Exception)
+ {
+ MessageBox.Show("Sorry, but an error has occurred while updating. Please try again or contact us a http://feedback.babysmash.com. We're still learning!",
+ "Application Updater", MessageBoxButton.OK);
}
}
}
@@ -66,5 +80,37 @@ namespace BabySmash
}
}
+
+ void deployment_UpdateCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
+ {
+ MessageBoxResult res2 = MessageBoxResult.None;
+ if (e.Error == null)
+ {
+ res2 = MessageBox.Show("Update complete, do you want to restart the application to apply the update?",
+ "Application Updater", MessageBoxButton.YesNo);
+ }
+ else
+ {
+ MessageBox.Show("Sorry, but an error has occured while updating. Please try again or contact us a http://feedback.babysmash.com. We're still learning!",
+ "Application Updater", MessageBoxButton.OK);
+ }
+ if (res2 == MessageBoxResult.Yes)
+ {
+ // Restart the application to apply the update
+ Application.Current.Shutdown();
+ System.Windows.Forms.Application.Restart();
+ }
+ Canvas.SetZIndex(updateProgress, (int)1);
+ Canvas.SetZIndex(updateButton, (int)9999);
+ updateButton.Visibility = Visibility.Visible;
+ updateProgress.Visibility = Visibility.Collapsed;
+ updateButton.IsEnabled = true;
+ okButton.IsEnabled = true;
+ }
+
+ void deployment_UpdateProgressChanged(object sender, DeploymentProgressChangedEventArgs e)
+ {
+ this.updateProgress.Value = e.ProgressPercentage;
+ }
}
}
\ No newline at end of file