Skip to content

Commit

Permalink
Merge branch 'release/1.1.16'
Browse files Browse the repository at this point in the history
* release/1.1.16:
  Update version_check.php
  Update changelog
  Tweak the update times
  Update DotNetVersionFinder
  Handle errors when trying to talk to existing SyncTrayzor instance
  Set up the IApplicationPathsProvider earlier
  • Loading branch information
canton7 committed May 20, 2017
2 parents 8e7bc72 + 8ebfe80 commit d9fc454
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 26 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

v1.1.16
-------

- Fix some crashes on startup
- Fix bug where 'show logs' link on the crash screen would cause another crash
- Reduce how often SyncTrayzor checks for updates

v1.1.15
-------

Expand Down
5 changes: 3 additions & 2 deletions server/version_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function get_with_wildcard($src, $value, $default = null)
}

$versions = [
'1.1.15' => [
'1.1.16' => [
'installed' => [
'direct_download_url' => [
'x64' => 'https://github.com/canton7/SyncTrayzor/releases/download/v{version}/SyncTrayzorSetup-x64.exe',
Expand All @@ -81,11 +81,12 @@ function get_with_wildcard($src, $value, $default = null)
'sha1sum_download_url' => 'https://github.com/canton7/SyncTrayzor/releases/download/v{version}/sha1sum.txt.asc',
'sha512sum_download_url' => 'https://github.com/canton7/SyncTrayzor/releases/download/v{version}/sha512sum.txt.asc',
'release_page_url' => 'https://github.com/canton7/SyncTrayzor/releases/tag/v{version}',
'release_notes' => "- Add a network usage graph to the tray icon popup\n- Add command-line parameters to start and stop Syncthing programatically\n- Fix problems setting up auto-start on some machines\n- Support custom file browsers (instead of Explorer)",
'release_notes' => "- Fix some crashes on startup\n- Fix bug where 'show logs' link on the crash screen would cause another crash\n- Reduce how often SyncTrayzor checks for updates",
]
];

$upgrades = [
'1.1.15' => ['to' => 'latest', 'formatter' => '5'],
'1.1.14' => ['to' => 'latest', 'formatter' => '5'],
'1.1.13' => ['to' => 'latest', 'formatter' => '5'],
'1.1.12' => ['to' => 'latest', 'formatter' => '5'],
Expand Down
39 changes: 24 additions & 15 deletions src/SyncTrayzor/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,30 +102,39 @@ protected override void Configure()
var assembly = this.Container.Get<IAssemblyProvider>();
logger.Debug("SyncTrazor version {0} ({1}) started at {2} (.NET version: {3})", assembly.FullVersion, assembly.ProcessorArchitecture, assembly.Location, DotNetVersionFinder.FindDotNetVersion());

// This needs to happen before anything which might cause the unhandled exception stuff to be shown, as that wants to know
// where to find the log file.
this.Container.Get<IApplicationPathsProvider>().Initialize(pathConfiguration);

var client = this.Container.Get<IIpcCommsClientFactory>().TryCreateClient();
if (client != null)
{
if (this.options.StartSyncthing || this.options.StopSyncthing)
try
{
if (this.options.StartSyncthing)
client.StartSyncthing();
else if (this.options.StopSyncthing)
client.StopSyncthing();
if (!this.options.StartMinimized)
client.ShowMainWindow();
Environment.Exit(0);
if (this.options.StartSyncthing || this.options.StopSyncthing)
{
if (this.options.StartSyncthing)
client.StartSyncthing();
else if (this.options.StopSyncthing)
client.StopSyncthing();
if (!this.options.StartMinimized)
client.ShowMainWindow();
Environment.Exit(0);
}

if (AppSettings.Instance.EnforceSingleProcessPerUser)
{
if (!this.options.StartMinimized)
client.ShowMainWindow();
Environment.Exit(0);
}
}

if (AppSettings.Instance.EnforceSingleProcessPerUser)
catch (Exception e)
{
if (!this.options.StartMinimized)
client.ShowMainWindow();
Environment.Exit(0);
logger.Error(e, $"Failed to talk to {client}: {e.Message}. Pretending that it doesn't exist...");
}
}

this.Container.Get<IApplicationPathsProvider>().Initialize(pathConfiguration);

var configurationProvider = this.Container.Get<IConfigurationProvider>();
configurationProvider.Initialize(AppSettings.Instance.DefaultUserConfiguration);
var configuration = this.Container.Get<IConfigurationProvider>().Load();
Expand Down
2 changes: 0 additions & 2 deletions src/SyncTrayzor/Services/Config/ApplicationPathsProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,5 @@ public void Initialize(PathConfiguration pathConfiguration)
logger.Debug("DefaultSyncthingPath: {0}", this.DefaultSyncthingPath);
logger.Debug("DefaultSyncthingHomePath: {0}", this.DefaultSyncthingHomePath);
}


}
}
5 changes: 5 additions & 0 deletions src/SyncTrayzor/Services/Ipc/IpcCommsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,10 @@ private void ProcessResponse(string response)

throw new UnknownIpcCommandException($"Remote side replied with {response}");
}

public override string ToString()
{
return $"<IpcCommsClient PID={this.pid}>";
}
}
}
8 changes: 4 additions & 4 deletions src/SyncTrayzor/Services/UpdateManagement/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public class UpdateManager : IUpdateManager
{
private static readonly Logger logger = LogManager.GetCurrentClassLogger();

private static readonly TimeSpan deadTimeAfterStarting = TimeSpan.FromSeconds(60);
private static readonly TimeSpan deadTimeAfterStarting = TimeSpan.FromMinutes(5);
// We'll never check more frequently than this, ever
private static readonly TimeSpan updateCheckDebounceTime = TimeSpan.FromMinutes(30);
private static readonly TimeSpan updateCheckDebounceTime = TimeSpan.FromHours(1);
// If 'remind me later' is active, we'll check this frequently
private static readonly TimeSpan remindMeLaterTime = TimeSpan.FromHours(24);
private static readonly TimeSpan remindMeLaterTime = TimeSpan.FromDays(3);
// How often the update checking timer should fire. Having it fire too often is OK: we won't
// take action
private static readonly TimeSpan updateCheckingTimerInterval = TimeSpan.FromHours(3);
private static readonly TimeSpan updateCheckingTimerInterval = TimeSpan.FromHours(8);

private readonly IApplicationState applicationState;
private readonly IApplicationWindowState applicationWindowState;
Expand Down
9 changes: 6 additions & 3 deletions src/SyncTrayzor/Utils/DotNetVersionFinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ public static class DotNetVersionFinder
{
{ 378389, "4.5" },
{ 378675, "4.5.1 on Windows 8.1 or Windows Server 2012 R2" },
{ 378758, "4.5.1 on WIndows 8, Wwndows 7 SPI1, or Windows Vista SP2" },
{ 378758, "4.5.1 on WIndows 8, Windows 7 SPI1, or Windows Vista SP2" },
{ 379893, "4.5.2" },
{ 393295, "4.6 on Windows 10" },
{ 393297, "4.6 on all other OS versions" },
{ 393297, "4.6 on non-Windows 10" },
{ 394254, "4.6.1 on Windows 10 November Update systems" },
{ 394271, "4.6.1 on all other OS versions" },
{ 394271, "4.6.1 on non-Windows 10 November Update systems" },
{ 394802, "4.6.2 on Windows 10 Anniversary Update systems" },
{ 394806, "4.6.2 on non-Windows 10 Anniversary Update systems" },
{ 460798, "4.7 on Windows 10 Creators Update systems" },
};

public static string FindDotNetVersion()
Expand Down

0 comments on commit d9fc454

Please sign in to comment.