Skip to content

Commit

Permalink
Merge branch 'release/1.0.17'
Browse files Browse the repository at this point in the history
  • Loading branch information
canton7 committed May 7, 2015
2 parents 9f92378 + aa02d28 commit 2f527b3
Show file tree
Hide file tree
Showing 48 changed files with 2,479 additions and 224 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ packages/
SyncTrayzorSetup*.exe
SyncTrayzorPortable*
syncthing-*.exe
syncthing.exe

*.gjq
*.tmp
Expand Down
19 changes: 15 additions & 4 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
Changelog
=========

v1.0.17
-------

- Fix crash when renaming a file whose path exceeds the Windows path length limit (#72)
- Fix 'Open Folder' button in Syncthing UI (#65)
- Ensure that folder list in Settings does not exceed screen height (#76)
- Start minimized after automatic upgrade (#59)
- Add italian translation (thanks stukdev)
- Improve text in icon context menu (#71)
- Console will scroll to end after resize (#67)

v1.0.16
-------

Expand Down Expand Up @@ -46,7 +57,7 @@ v1.0.12
- Add option to hide the console (#41)
- Obfuscate Device IDs in log files, as well as in the console
- Logging will take less space if Syncthing is spamming messages (#42)
- Updated translations (all langauges)
- Updated translations (all languages)
- New translations:
- Czech (thanks Václav Obrtlík)
- Greek (thanks alexxtasi and Wasilis Mandratzis-Walz)
Expand Down Expand Up @@ -84,8 +95,8 @@ v1.0.9
- Fix bug with directory watcher and paths containing a tilde (~)
- Fix resolution issue with taskbar icon
- Add 'device connected/disconnected' tray icon balloon messages
- Add Dutch transation (thanks Heimen Stoffels!)
- Small redution in memory usage
- Add Dutch translation (thanks Heimen Stoffels!)
- Small reduction in memory usage
- Add menu item to restart Syncthing

v1.0.8
Expand Down Expand Up @@ -156,7 +167,7 @@ v1.0.1
------

- Add support for new ItemFinished event
- Handle lots of log messages in quick successino
- Handle lots of log messages in quick succession

v1.0.0
------
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Features include:
Installation
------------

SyncTrayzor is packged as both an installer and a standalone zip.
SyncTrayzor is packaged as both an installer and a standalone zip. It will run on Windows Vista, 7, and 8.

### Installer

Expand All @@ -46,7 +46,7 @@ Something went wrong!

First, what went wrong? Remember that SyncTrayzor is a wrapper around [Syncthing](http://github.com/syncthing/syncthing).
Syncthing is the file synchronization program, which has a web interface.
SyncTrayzor is the tray utilty, looks like a normal Windows program, and has menus and suchlike, and a big area where Syncthing's web interface is displayed.
SyncTrayzor is the tray utility, looks like a normal Windows program, and has menus and suchlike, and a big area where Syncthing's web interface is displayed.

- If you're having problems connection to other devices, your files aren't synchronizing, or you're getting error messages in the console area, [raise an issue with Syncthing](http://github.com/syncthing/syncthing) or [post on the Syncthing forums](http://discourse.syncthing.net).
- If SyncTrayzor isn't talking to Syncthing, you're getting error dialogs, it's not auto-starting, etc, [raise an issue with SyncTrayzor](http://github.com/canton7/SyncTrayzor).
Expand Down
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PORTABLE_DIR = 'portable'

PFX = ENV['PFX'] || File.join(INSTALLER_DIR, 'SyncTrayzorCA.pfx')

PORTABLE_SYNCTHING_VERSION = '0.10'
PORTABLE_SYNCTHING_VERSION = '0.11'

class ArchDirConfig
attr_reader :arch
Expand All @@ -39,7 +39,7 @@ class ArchDirConfig
@installer_iss = File.join(@installer_dir, "installer-#{@arch}.iss")
@portable_output_dir = "SyncTrayzorPortable-#{@arch}"
@portable_output_file = File.join(PORTABLE_DIR, "SyncTrayzorPortable-#{@arch}.zip")
@syncthing_binaries = { '0.10' => 'syncthing-0.10.x.exe', '0.11' => 'syncthing-0.11.x.exe' }
@syncthing_binaries = { '0.11' => 'syncthing.exe' }
end
end

Expand Down
13 changes: 2 additions & 11 deletions installer/x64/installer-x64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,8 @@ TouchDate=current
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[CustomMessages]
SyncthingVersion=%nPlease select the Syncthing version.%n%nv0.11 and v0.10 are incompatible. All of your devices must either use v0.11 or v0.10.%n

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "syncthing0p11"; Description: "Syncthing v0.11 (recommended)"; GroupDescription: "{cm:SyncthingVersion}"; Flags: exclusive
Name: "syncthing0p10"; Description: "Syncthing v0.10"; GroupDescription: "{cm:SyncthingVersion}"; Flags: exclusive unchecked

Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Dirs]
Name: "{userappdata}\{#AppDataFolder}"
Expand All @@ -61,10 +55,7 @@ Source: "{#AppSrc}\Icons\default.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion

; It's important to touch, otherwise SyncTrayzor won't pick up on the modification, and won't copy it into %APPDATA%
Source: "syncthing-0.10.x.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Tasks: "syncthing0p10"; Flags: ignoreversion touch
Source: "syncthing-0.11.x.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Tasks: "syncthing0p11"; Flags: ignoreversion touch
Source: "syncthing.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Flags: ignoreversion

Source: "..\dotNet451Setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled

Expand Down
10 changes: 1 addition & 9 deletions installer/x86/installer-x86.iss
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,8 @@ TouchDate=current
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[CustomMessages]
SyncthingVersion=%nPlease select the Syncthing version.%n%nv0.11 and v0.10 are incompatible. All of your devices must either use v0.11 or v0.10.%n

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "syncthing0p11"; Description: "Syncthing v0.11 (recommended)"; GroupDescription: "{cm:SyncthingVersion}"; Flags: exclusive
Name: "syncthing0p10"; Description: "Syncthing v0.10"; GroupDescription: "{cm:SyncthingVersion}"; Flags: exclusive unchecked

[Dirs]
Name: "{userappdata}\{#AppDataFolder}"
Expand All @@ -58,10 +53,7 @@ Source: "{#AppSrc}\Icons\default.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion

; It's important to touch, otherwise SyncTrayzor won't pick up on the modification, and won't copy it into %APPDATA%
Source: "syncthing-0.10.x.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Tasks: "syncthing0p10"; Flags: ignoreversion touch
Source: "syncthing-0.11.x.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Tasks: "syncthing0p11"; Flags: ignoreversion touch
Source: "syncthing.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Flags: ignoreversion

Source: "..\dotNet451Setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled

Expand Down
17 changes: 14 additions & 3 deletions server/version_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*
* Clients request this with their current version, arch, and variant (portable, etc)
* and this gives them a version to upgrade to (if any), along with the method of
* ugprading to it (manual navigation to github release page, automatic silent upgrade,
* upgrading to it (manual navigation to Github release page, automatic silent upgrade,
* etc).
*
* $versions is a record of all of the current releases, which we might want to upgrade
* people to. It has the struture:
* people to. It has the structure:
* [
* version => [
* variant => [
Expand Down Expand Up @@ -41,7 +41,7 @@
* ]
*
* old_version: version being upgraded from
* new_version: version to upgrade ot
* new_version: version to upgrade to
* formatter_version: formatter version to use (in $response_formatters)
* overrides: optional overrides, used by the formatter
*/
Expand All @@ -65,6 +65,16 @@ function get_with_wildcard($src, $value, $default = null)
}

$versions = [
'1.0.17' => [
'installed' => [
'direct_download_url' => [
'x64' => 'https://github.com/canton7/SyncTrayzor/releases/download/v1.0.17/SyncTrayzorSetup-x64.exe',
'x86' => 'https://github.com/canton7/SyncTrayzor/releases/download/v1.0.17/SyncTrayzorSetup-x86.exe',
],
],
'release_page_url' => 'https://github.com/canton7/SyncTrayzor/releases/tag/v1.0.17',
'release_notes' => "- Fix crash when renaming a file whose path exceeds the Windows path length limit (#72)\n- Fix 'Open Folder' button in Syncthing UI (#65)\n- Ensure that folder list in Settings does not exceed screen height (#76)\n- Start minimized after automatic upgrade (#59)\n- Add italian translation (thanks stukdev)\n- Improve text in icon context menu (#71)\n- Console will scroll to end after resize (#67)",
],
'1.0.16' => [
'installed' => [
'direct_download_url' => [
Expand Down Expand Up @@ -102,6 +112,7 @@ function get_with_wildcard($src, $value, $default = null)
];

$upgrades = [
'1.0.16' => ['to' => 'latest', 'formatter' => '2'],
'1.0.15' => ['to' => 'latest', 'formatter' => '2'],
'1.0.14' => ['to' => 'latest', 'formatter' => '2'],
'1.0.13' => ['to' => 'latest', 'formatter' => '1'],
Expand Down
1 change: 1 addition & 0 deletions src/ProcessRunner/ProcessRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<Compile Include="Options.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="StringExtensions.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
Expand Down
21 changes: 18 additions & 3 deletions src/ProcessRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static int Main(string[] args)
var startInfo = new ProcessStartInfo()
{
FileName = remainder[0],
Arguments = String.Join(" ", remainder.Skip(1).Select(x => x.Contains(' ') ? String.Format("\"{0}\"", x) : x)),
Arguments = StringExtensions.JoinCommandLine(remainder.Skip(1)),
UseShellExecute = shell,
CreateNoWindow = noWindow,
};
Expand All @@ -71,13 +71,28 @@ static int Main(string[] args)
startInfo.UseShellExecute = true;
}

string launchFilename = null;
string launchArguments = null;

if (!String.IsNullOrWhiteSpace(launch))
{
var parts = StringExtensions.SplitCommandLine(launch);
launchFilename = parts.First();
launchArguments = StringExtensions.JoinCommandLine(parts.Skip(1));
}

try
{
var process = Process.Start(startInfo);
if (!String.IsNullOrWhiteSpace(launch))
if (!String.IsNullOrWhiteSpace(launchFilename))
{
process.WaitForExit();
Process.Start(launch);
var launchStartInfo = new ProcessStartInfo()
{
FileName = launchFilename,
Arguments = launchArguments,
};
Process.Start(launchStartInfo);
}
}
catch (Win32Exception e)
Expand Down
4 changes: 2 additions & 2 deletions src/ProcessRunner/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.16.0")]
[assembly: AssemblyFileVersion("1.0.16.0")]
[assembly: AssemblyVersion("1.0.17.0")]
[assembly: AssemblyFileVersion("1.0.17.0")]
57 changes: 57 additions & 0 deletions src/ProcessRunner/StringExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProcessRunner
{
// Stolen from http://stackoverflow.com/a/298990/1086121
public static class StringExtensions
{
public static IEnumerable<string> SplitCommandLine(string commandLine)
{
bool inQuotes = false;

return commandLine.Split(c =>
{
if (c == '\"')
inQuotes = !inQuotes;

return !inQuotes && c == ' ';
})
.Select(arg => arg.Trim().TrimMatchingQuotes('\"'))
.Where(arg => !string.IsNullOrEmpty(arg));
}

public static IEnumerable<string> Split(this string str, Func<char, bool> controller)
{
int nextPiece = 0;

for (int c = 0; c < str.Length; c++)
{
if (controller(str[c]))
{
yield return str.Substring(nextPiece, c - nextPiece);
nextPiece = c + 1;
}
}

yield return str.Substring(nextPiece);
}

public static string TrimMatchingQuotes(this string input, char quote)
{
if ((input.Length >= 2) &&
(input[0] == quote) && (input[input.Length - 1] == quote))
return input.Substring(1, input.Length - 2);

return input;
}

public static string JoinCommandLine(IEnumerable<string> input)
{
return String.Join(" ", input.Select(x => x.Contains(' ') ? String.Format("\"{0}\"", x.Replace("\"", "\\\"")) : x));
}
}
}
25 changes: 23 additions & 2 deletions src/SyncTrayzor/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ namespace SyncTrayzor
public class Bootstrapper : Bootstrapper<ShellViewModel>
{
private bool exiting;
private bool startMinimized;

protected override void OnStart()
{
this.startMinimized = this.Args.Contains("-minimized");
}

protected override void ConfigureIoC(IStyletIoCBuilder builder)
{
Expand Down Expand Up @@ -111,7 +117,14 @@ protected override void Configure()

// Horrible workaround for a CefSharp crash on logout/shutdown
// https://github.com/cefsharp/CefSharp/issues/800#issuecomment-75058534
this.Application.SessionEnding += (o, e) => Process.GetCurrentProcess().Kill();
// Also handles Restart Manager requests - sent by the installer. We need to shutdown syncthing and Cef in this case
this.Application.SessionEnding += (o, e) =>
{
var manager = this.Container.Get<ISyncThingManager>();
manager.StopAsync().Wait(250);
manager.Kill();
Process.GetCurrentProcess().Kill();
};

MessageBoxViewModel.ButtonLabels = new Dictionary<MessageBoxResult, string>()
{
Expand All @@ -126,7 +139,7 @@ protected override void Configure()

protected override void Launch()
{
if (this.Args.Contains("-minimized"))
if (this.startMinimized)
this.Container.Get<INotifyIconManager>().EnsureIconVisible();
else
base.Launch();
Expand All @@ -137,6 +150,14 @@ protected override void OnLaunch()
var config = this.Container.Get<IConfigurationProvider>().Load();
if (config.StartSyncthingAutomatically && !this.Args.Contains("-noautostart"))
((ShellViewModel)this.RootViewModel).Start();

// If we've just been upgraded, and we're minimized, show a bit of toast explaining the fact
if (this.startMinimized && this.Container.Get<IConfigurationProvider>().WasUpgraded)
{
var updatedVm = this.Container.Get<NewVersionInstalledToastViewModel>();
updatedVm.Version = this.Container.Get<IAssemblyProvider>().Version;
this.Container.Get<INotifyIconManager>().ShowBalloonAsync(updatedVm, timeout: 5000);
}
}

protected override void OnUnhandledException(DispatcherUnhandledExceptionEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion src/SyncTrayzor/NotifyIcon/BalloonConductor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void CloseItem(object item, bool? dialogResult = null)
if (this.taskbarIcon.CustomBalloon.Child != this.view)
return;

this.tcs.SetResult(dialogResult);
this.tcs.TrySetResult(dialogResult);
this.taskbarIcon.CloseBalloon();
}
}
Expand Down
Loading

0 comments on commit 2f527b3

Please sign in to comment.