Skip to content

Commit

Permalink
Merge branch 'release/1.1.26'
Browse files Browse the repository at this point in the history
  • Loading branch information
canton7 committed Dec 31, 2020
2 parents 55e739e + 0e057bb commit f5160b7
Show file tree
Hide file tree
Showing 105 changed files with 95 additions and 51 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ deploy
*.pvk
/src/SyncTrayzor/Icons/*.png
security/private_key.asc
chocolatey/tools/LICENSE.txt
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

v1.1.26
-------

- Fix the problems in v1.1.25 (#594, #595, #596, #597)
- Uninstaller tries to remove autostart registry keys (#586)

v1.1.25
-------

Expand Down
7 changes: 5 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ namespace :portable do
files = FileList['**/*'].exclude(
'*.xml', '*.vshost.*', '*.log', '*.Installer.config', '*/FluentValidation.resources.dll',
'*/System.Windows.Interactivity.resources.dll', 'syncthing.exe', 'data/*', 'logs',
'ffmpegsumo.dll', 'd3dcompiler_43.dll', 'd3dcompiler_47.dll', 'libEGL.dll', 'libGLESv2.dll', 'pdf.dll')
'd3dcompiler_47.dll', 'libEGL.dll', 'libGLESv2.dll', 'swiftshader/libEGL.dll', 'swiftshader/libGLESv2.dll',)

files.each do |file|
cp_to_portable(portable_dir, file)
Expand All @@ -194,10 +194,12 @@ namespace :portable do
cp_to_portable(portable_dir, file)
end

Dir.chdir(arch_config.installer_dir) do
Dir.chdir(File.join(arch_config.installer_dir, 'ucrt')) do
FileList['*.dll'].each do |file|
cp_to_portable(portable_dir, file)
end
end
Dir.chdir(arch_config.installer_dir) do
cp_to_portable(portable_dir, arch_config.syncthing_binaries[PORTABLE_SYNCTHING_VERSION], 'syncthing.exe')
end

Expand Down Expand Up @@ -253,6 +255,7 @@ desc 'Build chocolatey package'
task :chocolatey do
chocolatey_dir = File.dirname(CHOCOLATEY_NUSPEC)
cp Dir[File.join(DEPLOY_DIR, 'SyncTrayzorSetup-*.exe')], File.join(chocolatey_dir, 'tools')
cp 'LICENSE.txt', File.join(chocolatey_dir, 'tools')
Dir.chdir(chocolatey_dir) do
sh "choco pack"
end
Expand Down
7 changes: 7 additions & 0 deletions chocolatey/tools/VERIFICATION.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.

This package is published by the developer of SyncTrayzor.
Binaries are identical to the setup binaries available at the GitHub release page:
https://github.com/canton7/SyncTrayzor/releases
35 changes: 32 additions & 3 deletions installer/common.iss
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

#define AppExeName "SyncTrayzor.exe"
#define AppRoot "..\.."
#define AppSrc AppRoot + "\src\SyncTrayzor"
Expand Down Expand Up @@ -67,12 +66,12 @@ Name: "{userappdata}\{#AppDataFolder}"
; Near the beginning, as it's extracted first and this makes it cheaper
Source: "..\{#DotNetInstallerExe}"; DestDir: {tmp}; Flags: dontcopy nocompression noencryption

Source: "{#AppBin}\*"; DestDir: "{app}"; Excludes: "*.xml,*.vshost.*,*.config,*.log,FluentValidation.resources.dll,System.Windows.Interactivity.resources.dll,syncthing.exe,data,logs,ffmpegsumo.dll,d3dcompiler_43.dll,d3dcompiler_47.dll,libEGL.dll,libGLESv2.dll,pdf.dll"; Flags: ignoreversion recursesubdirs
Source: "{#AppBin}\*"; DestDir: "{app}"; Excludes: "*.xml,*.vshost.*,*.config,*.log,FluentValidation.resources.dll,System.Windows.Interactivity.resources.dll,syncthing.exe,data,logs,cef_extensions.pak,d3dcompiler_47.dll,libEGL.dll,libGLESv2.dll,swiftshader/libEGL.dll,swiftshader/libGLESv2.dll"; Flags: ignoreversion recursesubdirs
Source: "{#AppBin}\SyncTrayzor.exe.Installer.config"; DestDir: "{app}"; DestName: "SyncTrayzor.exe.config"; Flags: ignoreversion
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
Source: "ucrt\*.dll"; DestDir: "{app}"; Flags: ignoreversion; OnlyBelowVersion: 10.0
Source: "syncthing.exe"; DestDir: "{app}"; DestName: "syncthing.exe"; Flags: ignoreversion

[Icons]
Expand Down Expand Up @@ -282,8 +281,38 @@ begin
end;
end;
// We won't be able to find keys for users other than the one running the installer, but try and do
// a best-effort attempt to cleaning ourselves up.
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
keyValueNames: TArrayOfString;
keyValue: String;
i: Integer;
begin
if CurUninstallStep = usPostUninstall then
begin
if RegGetValueNames(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run', keyValueNames) then
begin
for i := 0 to GetArrayLength(keyValueNames)-1 do
begin
if Pos('SyncTrayzor', keyValueNames[i]) = 1 then
begin
if RegQueryStringValue(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run', keyValueNames[i], keyValue) then
begin
if Pos(ExpandConstant('"{app}\{#AppExeName}"'), keyValue) = 1 then
begin
RegDeleteValue(HKEY_CURRENT_USER, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run', keyValueNames[i]);
end;
end;
end
end;
end;
end;
end;
[UninstallDelete]
Type: files; Name: "{app}\ProcessRunner.exe.old"
Type: files; Name: "{app}\InstallCount.txt"
Type: filesandordirs; Name: "{userappdata}\{#AppDataFolder}"
Type: filesandordirs; Name: "{localappdata}\{#AppDataFolder}"

Binary file removed installer/x64/msvcp120.dll
Binary file not shown.
Binary file removed installer/x64/msvcr120.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added installer/x64/ucrt/api-ms-win-crt-heap-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added installer/x64/ucrt/api-ms-win-crt-math-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added installer/x64/ucrt/ucrtbase.dll
Binary file not shown.
Binary file removed installer/x64/vccorlib120.dll
Binary file not shown.
Binary file removed installer/x86/msvcp120.dll
Binary file not shown.
Binary file removed installer/x86/msvcr120.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added installer/x86/ucrt/api-ms-win-crt-math-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added installer/x86/ucrt/api-ms-win-crt-time-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added installer/x86/ucrt/ucrtbase.dll
Binary file not shown.
Binary file removed installer/x86/vccorlib120.dll
Binary file not shown.
8 changes: 4 additions & 4 deletions server/version_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
*/

set_error_handler('error_handler');
date_default_timezone_set('UCT');
date_default_timezone_set('UTC');
header('Content-Type: application/json');

function error_handler($severity, $message, $filename, $lineno)
Expand All @@ -65,7 +65,7 @@ function get_with_wildcard($src, $value, $default = null)
}

$versions = [
'1.1.25' => [
'1.1.26' => [
'base_url' => 'https://github.com/canton7/SyncTrayzor/releases/download',
'installed' => [
'direct_download_url' => [
Expand All @@ -82,7 +82,7 @@ function get_with_wildcard($src, $value, $default = null)
'sha1sum_download_url' => "{base_url}/v{version}/sha1sum.txt.asc",
'sha512sum_download_url' => "{base_url}/v{version}/sha512sum.txt.asc",
'release_page_url' => 'https://github.com/canton7/SyncTrayzor/releases/tag/v{version}',
'release_notes' => "- Add touch support\n- Minor UI updates (#538, #540, #541, #543)",
'release_notes' => "- Add touch support\n- Minor UI updates (#538, #540, #541, #543)\n- Uninstaller tries to remove autostart registry keys (#586)",
],
'1.1.21' => [
'base_url' => 'https://synctrayzor.antonymale.co.uk/download',
Expand All @@ -106,7 +106,7 @@ function get_with_wildcard($src, $value, $default = null)
];

$upgrades = [
// No point in upgrading from 1.1.23 for something so minor
'1.1.25' => ['to' => 'latest', 'formatter' => '5', 'overrides' => ['release_notes' => "- Fix the problems in v1.1.25 (#594, #595, #596, #597)\n- Uninstaller tries to remove autostart registry keys (#586)"]],
'1.1.24' => ['to' => 'latest', 'formatter' => '5'],
'1.1.23' => ['to' => 'latest', 'formatter' => '5'],
'1.1.22' => ['to' => 'latest', 'formatter' => '5'],
Expand Down
33 changes: 0 additions & 33 deletions src/SyncTrayzor/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -87,37 +87,4 @@
<logger name="*" minlevel="Debug" writeTo="logfile" />
</rules>
</nlog>

<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Reactive.Core" publicKeyToken="94bc3704cddfc263" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.3000.0" newVersion="3.0.3000.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Text.Json" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
16 changes: 13 additions & 3 deletions src/SyncTrayzor/Bootstrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ protected override void Configure()
}

// Has to be done before the VMs are fetched from the container
var languageArg = this.Args.FirstOrDefault(x => x.StartsWith("-culture="));
if (languageArg != null)
Thread.CurrentThread.CurrentUICulture = new CultureInfo(languageArg.Substring("-culture=".Length));
if (this.options.Culture != null)
Thread.CurrentThread.CurrentUICulture = new CultureInfo(this.options.Culture);
else if (!configuration.UseComputerCulture)
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

Expand Down Expand Up @@ -249,6 +248,17 @@ protected override void OnUnhandledException(DispatcherUnhandledExceptionEventAr
}
}

if (this.Container == null)
{
// This happened very early on... Not much we can do.
MessageBox.Show(
$"An unexpected exception occurred during startup:\n\n{e.Exception.ToString()}",
"An unexpected exception occurred",
MessageBoxButton.OK,
MessageBoxImage.Error);
Environment.Exit(1);
}

// It's nicer if we try stopping the syncthing process, but if we can't, carry on
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,15 @@ public bool TryEvaluateFormat(IFormattingInfo formattingInfo)
var pluralCount = pluralWords.Count;
var pluralIndex = pluralRule(value, pluralCount);

if (pluralIndex < 0 || pluralWords.Count <= pluralIndex)
if (pluralIndex < 0)
{
throw new FormattingException(format, "Invalid pluralIndex <0", pluralIndex);
}
else if (pluralWords.Count <= pluralIndex)
{
// The plural rule should always return a value in-range!
throw new FormattingException(format, "Invalid number of plural parameters", pluralWords.Last().endIndex);
// Pick the last plural in this case: we don't want to crash because of a bad translation
pluralIndex = pluralWords.Count - 1;
}

// Output the selected word (allowing for nested formats):
Expand Down
2 changes: 1 addition & 1 deletion src/SyncTrayzor/NotifyIcon/TaskbarIconResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<BitmapImage x:Key="TaskbarSyncing4Icon" UriSource="pack://application:,,,/Icons/syncing_4.ico"/>

<tb:TaskbarIcon x:Key="TaskbarIcon" x:Name="TaskbarIcon"
Visibility="{Binding Visible, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"
Visibility="{Binding Visible, Converter={x:Static s:BoolToVisibilityConverter.Instance}, FallbackValue=Collapsed}"
DoubleClickCommand="{s:Action DoubleClick, ActionNotFound=Disable}"
MenuActivation="RightClick"
ToolTipText="SyncTrayzor">
Expand Down
1 change: 0 additions & 1 deletion src/SyncTrayzor/Pages/Settings/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
<DockPanel>
<GroupBox DockPanel.Dock="Top" Header="{l:Loc SettingsView_Section_SyncTrayzor}">
<DockPanel>
<CheckBox DockPanel.Dock="Top" Content="WOo yay this is a really long string and it isn't wrapping nooo make it even longer go on I dare you"/>
<CheckBox DockPanel.Dock="Top" IsChecked="{Binding MinimizeToTray.Value}" Content="{l:Loc SettingsView_MinimizeToTray}"/>
<CheckBox DockPanel.Dock="Top" IsChecked="{Binding CloseToTray.Value}" Content="{l:Loc SettingsView_CloseToTray}"/>
<CheckBox DockPanel.Dock="Top" IsChecked="{Binding NotifyOfNewVersions.Value}" Content="{l:Loc SettingsView_AlertOnNewVersion}"/>
Expand Down
12 changes: 12 additions & 0 deletions src/SyncTrayzor/Pages/ViewerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ protected override void OnInitialActivate()
// System proxy settings (which also specify a proxy for localhost) shouldn't affect us
settings.CefCommandLineArgs.Add("no-proxy-server", "1");
settings.CefCommandLineArgs.Add("disable-cache", "1");
settings.CefCommandLineArgs.Add("disable-extensions", "1");

if (configuration.DisableHardwareRendering)
{
Expand All @@ -128,6 +129,7 @@ protected override void OnInitialActivate()

private void InitializeBrowser(ChromiumWebBrowser webBrowser)
{
webBrowser.RequestHandler = new CustomRequestHandler();
webBrowser.ResourceRequestHandlerFactory = this;
webBrowser.LifeSpanHandler = this;
webBrowser.MenuHandler = this;
Expand Down Expand Up @@ -405,6 +407,16 @@ public void Dispose()
this.configurationProvider.ConfigurationChanged -= this.ConfigurationChanged;
}

private class CustomRequestHandler : RequestHandler
{
protected override bool OnCertificateError(IWebBrowser chromiumWebBrowser, IBrowser browser, CefErrorCode errorCode, string requestUrl, ISslInfo sslInfo, IRequestCallback callback)
{
// We shouldn't hit this because IgnoreCertificateErrors is true, but we do
callback.Continue(true);
return true;
}
}

private class CustomResourceRequestHandler : ResourceRequestHandler
{
private readonly ViewerViewModel parent;
Expand Down
4 changes: 3 additions & 1 deletion src/SyncTrayzor/Services/CommandLineOptionsParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class CommandLineOptionsParser
public bool StartMinimized { get; private set; }
public bool StartSyncthing { get; private set; }
public bool StopSyncthing { get; private set; }
public string Culture { get; private set; }

public CommandLineOptionsParser(IWindowManager windowManager)
{
Expand All @@ -33,7 +34,8 @@ public bool Parse(string[] args)
.Add("stop-syncthing", "\nIf another SyncTrayzor process is running, tell it to stop Syncthing. Otherwise, launch with Syncthing stopped regardless of configuration.", v => this.StopSyncthing = true)
.Add("noautostart", null, v => this.StopSyncthing = true, hidden: true)
.Add("minimized", "\nIf another SyncTrayzor process is running, this flag has no effect. Otherwise, start in the tray rather than in the foreground.", v => minimized = true)
.Add("show", "\nIf another SyncTrayzor process is running, tell it to show its main window. Otherwise, this flag has no effect.", v => show = true);
.Add("show", "\nIf another SyncTrayzor process is running, tell it to show its main window. Otherwise, this flag has no effect.", v => show = true)
.Add("culture=", "\nForce SyncTrayzor to use a particular language", v => this.Culture = v);

var unknownArgs = options.Parse(args);

Expand Down
5 changes: 4 additions & 1 deletion src/SyncTrayzor/SyncTrayzor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
<Version>1.5.2</Version>
</PackageReference>
<PackageReference Include="SmartFormat.NET">
<Version>2.5.3</Version>
<Version>2.0.0</Version>
</PackageReference>
<PackageReference Include="Stylet">
<Version>1.3.5</Version>
Expand All @@ -620,6 +620,9 @@
<PackageReference Include="System.Text.Json">
<Version>5.0.0</Version>
</PackageReference>
<PackageReference Include="VCRuntime.CefSharp.140">
<Version>1.0.4</Version>
</PackageReference>
<PackageReference Include="WindowsAPICodePack-Core">
<Version>1.1.2</Version>
</PackageReference>
Expand Down

0 comments on commit f5160b7

Please sign in to comment.