Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Fix issue #92
Browse files Browse the repository at this point in the history
  • Loading branch information
aleab committed Aug 31, 2018
1 parent 8c7cecf commit 4b3d18e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 4 additions & 0 deletions InstallationScript/Install.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ Section "${APPNAME} (required)"
File "Toastify.exe"
File "Toastify.exe.config"
File "Toastify.pdb"
File "Castle.Core.dll"
File "Castle.Windsor.dll"
File "GoogleMeasurementProtocol.dll"
File "log4net.dll"
File "ManagedWinapi.dll"
Expand Down Expand Up @@ -156,6 +158,8 @@ Section "un.Toastify"
Delete "$INSTDIR\Toastify.pdb"
Delete "$INSTDIR\ToastifyAPI.dll"
Delete "$INSTDIR\ToastifyAPI.pdb"
Delete "$INSTDIR\Castle.Core.dll"
Delete "$INSTDIR\Castle.Windsor.dll"
Delete "$INSTDIR\GoogleMeasurementProtocol.dll"
Delete "$INSTDIR\log4net.dll"
Delete "$INSTDIR\ManagedWinapi.dll"
Expand Down
13 changes: 12 additions & 1 deletion Toastify/src/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@ public static void Main(string[] args)
catch (Exception e)
{
Debug.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {e}\n");
File.AppendAllText(Path.Combine(App.LocalApplicationData, "log.log"), $@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {e}\n");
try
{
File.AppendAllText(Path.Combine(App.LocalApplicationData, "log.log"), $@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {e}{Environment.NewLine}");
}
catch (Exception ee)
{
MessageBox.Show(ee.ToString(), "FATAL ERROR!", MessageBoxButton.OK, MessageBoxImage.Error);
}
}

logger.Info($"Architecture: IntPtr = {IntPtr.Size * 8}bit, Is64BitProcess = {Environment.Is64BitProcess}, Is64BitOS = {Environment.Is64BitOperatingSystem}");
Expand Down Expand Up @@ -103,11 +110,15 @@ private static void ProcessCommandLineArguments(string[] args)
{
try
{
if (args != null)
File.AppendAllText(Path.Combine(App.LocalApplicationData, "log.log"), $@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - args: {string.Join(" ", args)}{Environment.NewLine}");
AppArgs = args != null && args.Length > 0 ? Args.Parse<MainArgs>(args) : new MainArgs();
}
catch (Exception e)
{
File.AppendAllText(Path.Combine(App.LocalApplicationData, "log.log"), $@"{DateTime.Now:yyyy-MM-dd HH:mm:ss} - {e.Message}{Environment.NewLine}");
logger.Warn("Invalid command-line arguments. Toastify will ignore them all.", e);

MessageBox.Show("Invalid command-line arguments. Toastify will ignore them all.", "Invalid arguments", MessageBoxButton.OK, MessageBoxImage.Warning);
AppArgs = new MainArgs();
}
Expand Down

0 comments on commit 4b3d18e

Please sign in to comment.