Skip to content

Commit

Permalink
Merge branch 'release/1.0.23'
Browse files Browse the repository at this point in the history
* release/1.0.23: (51 commits)
  Update version_check.php
  Bump version
  Update changelog
  Update translations
  Fix string typo
  Be much more graceful when restarting for an update
  Be much more cautious about killing Syncthing
  Log shutdown reason
  Handle ApiException and HttpRequestException while starting Syncthing
  Add BouncyCastle to third-party contributers
  Ignore the private key
  Correct invocation of ChecksumUtil when downloading syncthing
  Bug-fixing new update verification
  Tidying up
  Update releases cert with a signature from Syncthing's release key
  Fix Rakefile issues
  In theory, modify the update downloader to handle new sha1sum scheme
  Add support for MetadataChanged/ItemMetadataChanged (whichever it turns out to be)
  Allow any item changed action/item type (future-proofing)
  Revert "Prepare for new 'metadata' item update action"
  ...
  • Loading branch information
canton7 committed Jun 18, 2015
2 parents 7152b3e + b7a5128 commit d5f78c8
Show file tree
Hide file tree
Showing 92 changed files with 2,661 additions and 4,342 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ syncthing.exe
*.gjq
*.tmp
Coverage
RefitStubs.cs
SyncTrayzorPortable
deploy
*.pfx
*.pvk
/src/SyncTrayzor/Icons/*.png
security/private_key.asc
2 changes: 1 addition & 1 deletion .tx/config
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ type = RESX

; Irritatingly, Transifex likes xx_XX, .NET likes xx-XX and there's no way
; (that I can find) to map between them
lang_map = nl_NL:nl,es_ES:es,ca@valencia:ca-ES-valencia
lang_map = nl_NL:nl,es_ES:es,ca@valencia:ca-ES-valencia,hu_HU:hu-HU,pt_BR:pt-BR,it_IT:it-IT
8 changes: 8 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
Changelog
=========

v1.0.23
-------

- Support for Syncthing v0.11.10
- Fix and improve file transfers window (#101, #106)
- Fix various crashes (#108, #112, #114, #155)
- Add option to disable hardware rendering (#104)

v1.0.22
-------

Expand Down
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Contributing to SyncTrayzor
===========================

When opening an issue, you **must** include the SyncTrayzor version and Syncthing version
For crashes, please provide the full stack trace that SyncTrayzor gave you.

If you're multi-lingual? SyncTrayzor needs you! Please read [Localization](https://github.com/canton7/SyncTrayzor/wiki/Localization).

Want to make a code contribution? Fantastic, and thank you! Please read [Contributing](https://github.com/canton7/SyncTrayzor/wiki/Contributing) first.
106 changes: 79 additions & 27 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ MSBUILD_LOGGER = ENV['MSBUILD_LOGGER']

SRC_DIR = 'src/SyncTrayzor'
INSTALLER_DIR = 'installer'
PORTABLE_DIR = 'portable'
DEPLOY_DIR = 'deploy'

SLN = 'src/SyncTrayzor.sln'

CHECKSUM_UTIL_CSPROJ = 'src/ChecksumUtil/ChecksumUtil.csproj'
CHECKSUM_UTIL_EXE = 'bin/ChecksumUtil/Release/ChecksumUtil.exe'
SYNCTHING_RELEASES_CERT = 'security/syncthing_releases_cert.asc'

CHECKSUM_FILE_PRIV_KEY = 'security/private_key.asc'

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

PORTABLE_SYNCTHING_VERSION = '0.11'
Expand All @@ -38,12 +44,16 @@ class ArchDirConfig
@installer_output = File.join(@installer_dir, "SyncTrayzorSetup-#{@arch}.exe")
@installer_iss = File.join(@installer_dir, "installer-#{@arch}.iss")
@portable_output_dir = "SyncTrayzorPortable-#{@arch}"
@portable_output_file = File.join(PORTABLE_DIR, "SyncTrayzorPortable-#{@arch}.zip")
@portable_output_file = File.join(DEPLOY_DIR, "SyncTrayzorPortable-#{@arch}.zip")
@syncthing_binaries = { '0.11' => 'syncthing.exe' }
end

def sha1sum_download_uri(version)
"https://github.com/syncthing/syncthing/releases/download/v#{version}/sha1sum.txt.asc"
end

def download_uri(version)
return "https://github.com/syncthing/syncthing/releases/download/v#{version}/syncthing-windows-#{@github_arch}-v#{version}.zip"
"https://github.com/syncthing/syncthing/releases/download/v#{version}/syncthing-windows-#{@github_arch}-v#{version}.zip"
end
end

Expand All @@ -59,25 +69,34 @@ def ensure_7zip
end
end

def build(sln, platform, rebuild = true)
tasks = rebuild ? 'Clean;Rebuild' : 'Build'
cmd = "\"#{MSBUILD}\" \"#{sln}\" /t:#{tasks} /p:Configuration=#{CONFIG};Platform=#{platform}"
if MSBUILD_LOGGER
cmd << " /logger:\"#{MSBUILD_LOGGER}\" /verbosity:minimal"
else
cmd << " /verbosity:quiet"
end

sh cmd
end

namespace :build do
ARCH_CONFIG.each do |arch_config|
desc "Build the project (#{arch_config.arch})"
task arch_config.arch do
cmd = "\"#{MSBUILD}\" \"#{SLN}\" /t:Clean;Rebuild /p:Configuration=#{CONFIG};Platform=#{arch_config.arch}"
if MSBUILD_LOGGER
cmd << " /logger:\"#{MSBUILD_LOGGER}\" /verbosity:minimal"
else
cmd << " /verbosity:quiet"
end

sh cmd
build(SLN, arch_config.arch)
end
end
end

desc 'Build both 64-bit and 32-bit binaries'
task :build => ARCH_CONFIG.map{ |x| :"build:#{x.arch}" }

task :"build-checksum-util" do
build(CHECKSUM_UTIL_CSPROJ, 'AnyCPU', false)
end

namespace :installer do
ARCH_CONFIG.each do |arch_config|
desc "Create the installer (#{arch_config.arch})"
Expand All @@ -89,6 +108,9 @@ namespace :installer do

rm arch_config.installer_output if File.exist?(arch_config.installer_output)
sh %Q{"#{ISCC}" #{arch_config.installer_iss}}

mkdir_p DEPLOY_DIR
mv arch_config.installer_output, DEPLOY_DIR
end
end
end
Expand All @@ -109,7 +131,7 @@ namespace :"sign-installer" do

args = "sign /f #{PFX} /t http://timestamp.verisign.com/scripts/timstamp.dll"
args << " /p #{ENV['PASSWORD']}" if ENV['PASSWORD']
args << " /v #{arch_config.installer_output}"
args << " /v #{File.join(DEPLOY_DIR, File.basename(arch_config.installer_output))}"

# Don't want to print out the pasword!
puts "Invoking signtool"
Expand Down Expand Up @@ -182,7 +204,9 @@ namespace :"update-syncthing" do
arch_config.syncthing_binaries.values_at(*SYNCTHING_VERSIONS_TO_UPDATE).each do |bin|
path = File.join(arch_config.installer_dir, bin)
raise "Could not find #{path}" unless File.exist?(path)
sh path, '-upgrade' do; end
Dir.mktmpdir do |tmp|
sh path, '-upgrade', "-home=#{tmp}" do; end
end

old_bin = "#{path}.old"
rm old_bin if File.exist?(old_bin)
Expand All @@ -194,28 +218,47 @@ end
desc 'Update syncthing binaries, all architectures'
task :"update-syncthing" => ARCH_CONFIG.map{ |x| :"update-syncthing:#{x.arch}" }

namespace :clean do
ARCH_CONFIG.each do |arch_config|
desc "Clean everything (#{arch_config.arch})"
task arch_config.arch do
rm_rf arch_config.portable_output_file if File.exist?(arch_config.portable_output_file)
rm arch_config.installer_output if File.exist?(arch_config.installer_output)
end
end
def create_checksums(checksum_file, password, algorithm, files)
rm checksum_file if File.exist?(checksum_file)

args = %Q{create "#{checksum_file}" #{algorithm} "#{CHECKSUM_FILE_PRIV_KEY}" "#{password}" } + files.map{ |x| "\"#{x}\"" }.join(' ')

# Don't want to print out the pasword!
puts "Invoking #{CHECKSUM_UTIL_EXE} for #{checksum_file}"
system %Q{"#{CHECKSUM_UTIL_EXE}" #{args}}
end

desc 'Create checksums files'
task :"create-checksums" => [:"build-checksum-util"] do
password = ENV['PASSWORD'] || '""'
checksum_file = File.join(DEPLOY_DIR, 'sha1sum.txt.asc')
files = Dir["#{DEPLOY_DIR}/*.{zip,exe}"]

create_checksums(File.join(DEPLOY_DIR, 'sha1sum.txt.asc'), password, 'sha1', files)
create_checksums(File.join(DEPLOY_DIR, 'md5sum.txt.asc'), password, 'md5', files)
end

desc 'Clean portable and installer, all architectures'
task :clean => ARCH_CONFIG.map{ |x| :"clean:#{x.arch}" }
task :clean do
rm_rf DEPLOY_DIR if File.exist?(DEPLOY_DIR)
end

namespace :package do
ARCH_CONFIG.each do |arch_config|
desc "Build installer and portable (#{arch_config.arch})"
task arch_config.arch => [:"clean:#{arch_config.arch}", :"update-syncthing:#{arch_config.arch}", :"build:#{arch_config.arch}", :"installer:#{arch_config.arch}", :"sign-installer:#{arch_config.arch}", :"portable:#{arch_config.arch}"]
task arch_config.arch =>
[
:"update-syncthing:#{arch_config.arch}",
:"build:#{arch_config.arch}",
:"installer:#{arch_config.arch}",
:"sign-installer:#{arch_config.arch}",
:"portable:#{arch_config.arch}"
]
end
end

desc 'Build installer and portable for all architectures'
task :package => ARCH_CONFIG.map{ |x| :"package:#{x.arch}" }
task :package => [:clean, *ARCH_CONFIG.map{ |x| :"package:#{x.arch}" }, :"create-checksums"]

desc "Bump version number"
task :version, [:version] do |t, args|
Expand All @@ -233,18 +276,27 @@ end
namespace :"download-syncthing" do
ARCH_CONFIG.each do |arch_config|
desc "Download syncthing (#{arch_config.arch})"
task arch_config.arch, [:version] do |t, args|
task arch_config.arch, [:version] => [:"build-checksum-util"] do |t, args|
ensure_7zip

Dir.mktmpdir do |tmp|
File.open(File.join(tmp, 'syncthing.zip'), 'wb') do |outfile|
download_file = File.join(tmp, File.basename(arch_config.download_uri(args[:version])))
File.open(download_file, 'wb') do |outfile|
open(arch_config.download_uri(args[:version]), { ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE }) do |infile|
outfile.write(infile.read)
end
end

File.open(File.join(tmp, 'sha1sum.txt.asc.'), 'w') do |outfile|
open(arch_config.sha1sum_download_uri(args[:version]), { ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE }) do |infile|
outfile.write(infile.read)
end
end

sh CHECKSUM_UTIL_EXE, 'verify', File.join(tmp, 'sha1sum.txt.asc'), 'sha1', SYNCTHING_RELEASES_CERT, download_file

Dir.chdir(tmp) do
sh %Q{"#{SZIP}" e syncthing.zip}
sh %Q{"#{SZIP}" e #{File.basename(download_file)}}
end

cp File.join(tmp, 'syncthing.exe'), File.join(arch_config.installer_dir, 'syncthing.exe')
Expand Down
24 changes: 5 additions & 19 deletions installer/x64/installer-x64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ SolidCompression=yes
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64
; Unintuitive - but we forcefully close SyncTrayzor ourselves (because the CEF subprocess doesn't exit when asked to)
; If we allow this, then the user gets a 'stopped programs?' prompt. If they hit 'no', then SyncTrayzor is still stopped, by us.
CloseApplications=no
CloseApplications=yes
RestartApplications=no
; If we try and close CefSharp.BrowserSubprocess.exe we'll fail - it doesn't respond well
; However if we close *just* SyncTrayzor, that will take care of shutting down CefSharp and syncthing
CloseApplicationsFilter=SyncTrayzor.exe
TouchDate=current

[Languages]
Expand Down Expand Up @@ -97,8 +99,6 @@ begin
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: integer;
begin
if CurStep = ssInstall then
begin
Expand All @@ -107,20 +107,6 @@ begin
{ We might be being run from ProcessRunner.exe, *and* we might be trying to update it. Funsies. Let's rename it (which Windows lets us do) }
DeleteFile(ExpandConstant('{app}\ProcessRunner.exe.old'));
RenameFile(ExpandConstant('{app}\ProcessRunner.exe'), ExpandConstant('{app}\ProcessRunner.exe.old'));
{ This is really evil, but CefSharp.BrowserSubprocess.exe doesn't like to exit if we ask it nicely, so we have to kill it }
ShellExec('open', 'taskkill.exe', '/f /t /im SyncTrayzor.exe', '', SW_HIDE, ewNoWait, ResultCode);
end
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
ResultCode: integer;
begin
if CurUninstallStep = usUninstall then
begin
{ This is really evil, but CefSharp.BrowserSubprocess.exe doesn't like to exit if we ask it nicely, so we have to kill it }
ShellExec('open', 'taskkill.exe', '/f /t /im SyncTrayzor.exe', '', SW_HIDE, ewNoWait, ResultCode);
end
end;
Expand Down
24 changes: 5 additions & 19 deletions installer/x86/installer-x86.iss
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ Compression=lzma2/max
;Compression=None
SolidCompression=yes
PrivilegesRequired=admin
; Unintuitive - but we forcefully close SyncTrayzor ourselves (because the CEF subprocess doesn't exit when asked to)
; If we allow this, then the user gets a 'stopped programs?' prompt. If they hit 'no', then SyncTrayzor is still stopped, by us.
CloseApplications=no
CloseApplications=yes
RestartApplications=no
; If we try and close CefSharp.BrowserSubprocess.exe we'll fail - it doesn't respond well
; However if we close *just* SyncTrayzor, that will take care of shutting down CefSharp and syncthing
CloseApplicationsFilter=SyncTrayzor.exe
TouchDate=current

[Languages]
Expand Down Expand Up @@ -95,8 +97,6 @@ begin
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: integer;
begin
if CurStep = ssInstall then
begin
Expand All @@ -105,20 +105,6 @@ begin
{ We might be being run from ProcessRunner.exe, *and* we might be trying to update it. Funsies. Let's rename it (which Windows lets us do) }
DeleteFile(ExpandConstant('{app}\ProcessRunner.exe.old'));
RenameFile(ExpandConstant('{app}\ProcessRunner.exe'), ExpandConstant('{app}\ProcessRunner.exe.old'));
{ This is really evil, but CefSharp.BrowserSubprocess.exe doesn't like to exit if we ask it nicely, so we have to kill it }
ShellExec('open', 'taskkill.exe', '/f /t /im SyncTrayzor.exe', '', SW_HIDE, ewNoWait, ResultCode);
end
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
ResultCode: integer;
begin
if CurUninstallStep = usUninstall then
begin
{ This is really evil, but CefSharp.BrowserSubprocess.exe doesn't like to exit if we ask it nicely, so we have to kill it }
ShellExec('open', 'taskkill.exe', '/f /t /im SyncTrayzor.exe', '', SW_HIDE, ewNoWait, ResultCode);
end
end;
Expand Down
Loading

0 comments on commit d5f78c8

Please sign in to comment.