Skip to content

Commit

Permalink
Merge branch 'release/1.0.6'
Browse files Browse the repository at this point in the history
* release/1.0.6:
  Bump version
  Update changelog
  Support 32-bit builds
  Add 'Contributers' document
  Add multi-resolution default icon (thanks to d4k0)
  Add note about x86 to the README
  Add a note to the README about overriding API key and GUI listen address
  Improve Settings dialog around API key and address
  Ignore ~ unless it appears at the start of a path
  • Loading branch information
canton7 committed Mar 8, 2015
2 parents 5443097 + 38a86c8 commit df3a6fb
Show file tree
Hide file tree
Showing 26 changed files with 215 additions and 48 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ packages/
*.nupkg

#Installer
installer/SyncTrayzor*.exe
installer/syncthing.exe
SyncTrayzorSetup*.exe
SyncTrayzorPortable*
syncthing.exe

*.gjq
*.tmp
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
Changelog
=========

v1.0.6
------

- Include high-quality icon (thanks to d4k0)
- Improve settings dialog around API key and GUI Host Address
- Add 32-bit build

v1.0.5
------

Expand Down
7 changes: 7 additions & 0 deletions Contributers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Contributers
============

The following individuals have contributed in same way towards making SyncTrayzor what it is is, and I'm very grateful to them.

- [Joel Kåberg](https://github.com/jkaberg): SyncTrayzor's first user! Caught bugs I would never have spotted.
- [d4k0](https://github.com/d4k0): Fixed some icon problems.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ Grab the latest standalone .zip from the [releases](https://github.com/canton7/S
Unzip, and run `SyncTrayzor.exe`. If you're updating, you'll need to copy the `data` folder across from your previous standalone installation.


What will SyncTrayzor do to Syncthing?
--------------------------------------

It's worth noting that SyncTrayzor will override the 'GUI Listen Address' and 'API Key' in Syncthing's configuration.
This is because it needs to fully control these values, in order to ensure that it can communicate with Syncthing.

However, you can set these values in File -> Settings, if you want to customise them.


What will SyncTrayzor do to my system?
--------------------------------------

Expand Down
97 changes: 71 additions & 26 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,71 @@ end

ISCC = '"C:\Program Files (x86)\Inno Setup 5\ISCC.exe"'

BIN_DIR = 'bin/x64/Release'
BIN_DIR_64 = 'bin/x64/Release'
BIN_DIR_86 = 'bin/x86/Release'

SRC_DIR = 'src/SyncTrayzor'
INSTALLER_DIR = 'installer'
INSTALLER = File.join(INSTALLER_DIR, 'SyncTrayzorSetup.exe')

PORTABLE_OUTPUT_DIR = File.absolute_path('SyncTrayzorPortable')
INSTALLER_64 = File.join(INSTALLER_DIR, 'x64')
INSTALLER_86 = File.join(INSTALLER_DIR, 'x86')

INSTALLER_64_OUTPUT = File.join(INSTALLER_64, 'SyncTrayzorSetup-x64.exe')
INSTALLER_86_OUTPUT = File.join(INSTALLER_86, 'SyncTrayzorSetup-x86.exe')

PORTABLE_OUTPUT_DIR_64 = File.absolute_path('SyncTrayzorPortable-x64')
PORTABLE_OUTPUT_DIR_86 = File.absolute_path('SyncTrayzorPortable-x86')

CONFIG = ENV['CONFIG'] || 'Release'
PLATFORM = ENV['PLATFORM'] || 'x64'

def cp_to_portable(src)
dest = File.join(PORTABLE_OUTPUT_DIR, src)
def cp_to_portable(ouput_dir, src)
dest = File.join(ouput_dir, src)
mkdir_p File.dirname(dest) unless File.exist?(File.dirname(dest))
cp src, dest
end

desc 'Build the project'
build :build do |b|
desc 'Build the project (64-bit)'
build :buildx64 do |b|
b.sln = 'src/SyncTrayzor.sln'
b.target = [:Clean, :Build]
b.prop 'Configuration', CONFIG
b.prop 'Platform', 'x64'
end

desc 'Build the project (32-bit)'
build :buildx86 do |b|
b.sln = 'src/SyncTrayzor.sln'
b.target = [:Clean, :Build]
b.prop 'Configuration', CONFIG
b.prop 'Platform', PLATFORM
b.prop 'Platform', 'x86'
end

desc 'Build both 64-bit and 32-bit binaries'
task :build => [:buildx64, :buildx86]

def create_installer(output_file, installer_dir, iss_name)
rm output_file if File.exist?(output_file)
sh ISCC, File.join(installer_dir, iss_name)
end

desc 'Create 64-bit installer'
task :installerx64 do
create_installer(INSTALLER_64_OUTPUT, INSTALLER_64, 'installer-x64.iss')
end

task :installer do
rm INSTALLER if File.exist?(INSTALLER)
sh ISCC, File.join(INSTALLER_DIR, 'installer.iss')
desc 'Create 32-bit installer'
task :installerx86 do
create_installer(INSTALLER_86_OUTPUT, INSTALLER_86, 'installer-x86.iss')
end

desc 'Create the portable release directory'
task :portable do
rm_rf PORTABLE_OUTPUT_DIR
mkdir_p PORTABLE_OUTPUT_DIR
desc 'Create 32-bit and 64-bit installers'
task :installer => [:installerx64, :installerx86]

Dir.chdir(BIN_DIR) do
def create_portable(bin_dir, output_dir, installer_platform_dir)
rm_rf output_dir
mkdir_p output_dir

Dir.chdir(bin_dir) do
files = FileList[
'*.exe',
'*.exe.config',
Expand All @@ -54,24 +84,24 @@ task :portable do
].exclude('*.vshost.*')

files.each do |file|
cp_to_portable(file)
cp_to_portable(output_dir, file)
end
end

cp File.join(SRC_DIR, 'Icons', 'default.ico'), PORTABLE_OUTPUT_DIR
cp File.join(SRC_DIR, 'Icons', 'default.ico'), output_dir

FileList['*.md', '*.txt'].each do |file|
cp_to_portable(file)
cp_to_portable(output_dir, file)
end

Dir.chdir(INSTALLER_DIR) do
Dir.chdir(installer_platform_dir) do
FileList['syncthing.exe', '*.dll'].each do |file|
cp_to_portable(file)
cp_to_portable(output_dir, file)
end
end

puts 'Rewriting app.config'
config_path = File.join(PORTABLE_OUTPUT_DIR, 'SyncTrayzor.exe.config')
config_path = File.join(output_dir, 'SyncTrayzor.exe.config')
doc = File.open(config_path, 'r') do |f|
doc = REXML::Document.new(f)
REXML::XPath.first(doc, '/configuration/applicationSettings//setting[@name="PortableMode"]/value').text = 'True'
Expand All @@ -82,11 +112,26 @@ task :portable do
end
end

desc 'Create the portable (x64) release directory'
task :portablex64 do
create_portable(BIN_DIR_64, PORTABLE_OUTPUT_DIR_64, INSTALLER_64)
end

desc 'Create the portable (x86) release directory'
task :portablex86 do
create_portable(BIN_DIR_86, PORTABLE_OUTPUT_DIR_86, INSTALLER_86)
end

desc 'Create portable release directories for x64 and x86'
task :portable => [:portablex64, :portablex86]

desc 'Build and package everything'
task :package => [:build, :installer, :portable]

desc 'Remove portable and installer'
task :clean do
rm_rf PORTABLE_OUTPUT_DIR if File.exist?(PORTABLE_OUTPUT_DIR)
rm INSTALLER if File.exist?(INSTALLER)
rm_rf PORTABLE_OUTPUT_DIR_64 if File.exist?(PORTABLE_OUTPUT_DIR_64)
rm_rf PORTABLE_OUTPUT_DIR_86 if File.exist?(PORTABLE_OUTPUT_DIR_86)
rm INSTALLER_64 if File.exist?(INSTALLER_64)
rm INSTALLER_86 if File.exist?(INSTALLER_86)
end
11 changes: 6 additions & 5 deletions installer/installer.iss → installer/x64/installer-x64.iss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#define AppExeName "SyncTrayzor.exe"
#define AppRoot ".."
#define AppRoot "..\.."
#define Arch "x64"
#define AppSrc AppRoot + "\src\SyncTrayzor"
#define AppBin AppRoot +"\bin\x64\Release"
#define AppBin AppRoot +"\bin\" + Arch + "\Release"
#define AppExe AppBin + "\SyncTrayzor.exe"
#define AppName GetStringFileInfo(AppExe, "ProductName")
#define AppVersion GetFileVersion(AppExe)
Expand All @@ -13,7 +14,7 @@

[Setup]
AppId={{c004dcef-b848-46a5-9c30-4dbf736396fa}
AppName={#AppName}
AppName={#AppName}-{#Arch}
AppVersion={#AppVersion}
;AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
Expand All @@ -25,7 +26,7 @@ DefaultGroupName={#AppName}
AllowNoIcons=yes
LicenseFile={#AppRoot}\LICENSE.txt
OutputDir="."
OutputBaseFilename={#AppName}Setup
OutputBaseFilename={#AppName}Setup-{#Arch}
SetupIconFile={#AppSrc}\Icons\default.ico
Compression=lzma2/max
SolidCompression=yes
Expand Down Expand Up @@ -55,7 +56,7 @@ Source: "{#AppRoot}\*.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppRoot}\*.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "syncthing.exe"; DestDir: "{app}"
Source: "dotNet451Setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled
Source: "..\dotNet451Setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
80 changes: 80 additions & 0 deletions installer/x86/installer-x86.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#define AppExeName "SyncTrayzor.exe"
#define AppRoot "..\.."
#define Arch "x86"
#define AppSrc AppRoot + "\src\SyncTrayzor"
#define AppBin AppRoot +"\bin\" + Arch + "\Release"
#define AppExe AppBin + "\SyncTrayzor.exe"
#define AppName GetStringFileInfo(AppExe, "ProductName")
#define AppVersion GetFileVersion(AppExe)
#define AppPublisher "SyncTrayzor"
#define AppURL "https://github.com/canton7/SyncTrayzor"
#define AppDataFolder "SyncTrayzor"
#define RunRegKey "Software\Microsoft\Windows\CurrentVersion\Run"


[Setup]
AppId={{c9bab27b-d754-4b62-ad8c-3509e1cac15c}
AppName={#AppName} ({#Arch})
AppVersion={#AppVersion}
;AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
AllowNoIcons=yes
LicenseFile={#AppRoot}\LICENSE.txt
OutputDir="."
OutputBaseFilename={#AppName}Setup-{#Arch}
SetupIconFile={#AppSrc}\Icons\default.ico
Compression=lzma2/max
SolidCompression=yes
PrivilegesRequired=admin

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

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

[Dirs]
Name: "{userappdata}\{#AppDataFolder}"

[Files]
Source: "{#AppBin}\*.exe"; Excludes: "*.vshost.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\{#AppExeName}.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.pak"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\*.dat"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#AppBin}\locales\*"; DestDir: "{app}\locales"; 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: "syncthing.exe"; DestDir: "{app}"
Source: "..\dotNet451Setup.exe"; DestDir: {tmp}; Flags: deleteafterinstall; Check: FrameworkIsNotInstalled

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon

[Run]
Filename: "{tmp}\dotNet451Setup.exe"; Parameters: "/passive /promptrestart"; Check: FrameworkIsNotInstalled; StatusMsg: "Microsoft .NET Framework 4.5.1 is being installed. Please wait..."
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
function FrameworkIsNotInstalled: Boolean;
var
exists: boolean;
release: cardinal;
begin
exists := RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', release);
result := not exists or (release < 378758);
end;
[UninstallDelete]
Type: filesandordirs; Name: "{userappdata}\{#AppDataFolder}"
Type: filesandordirs; Name: "{userappdata}\{#AppDataFolder}"
Binary file added installer/x86/msvcp110.dll
Binary file not shown.
Binary file added installer/x86/msvcr110.dll
Binary file not shown.
Binary file added installer/x86/vccorlib110.dll
Binary file not shown.
Binary file modified src/SyncTrayzor/Icons/default.ico
Binary file not shown.
Binary file added src/SyncTrayzor/Icons/default_tray.ico
Binary file not shown.
Binary file modified src/SyncTrayzor/Icons/stopped.ico
Binary file not shown.
Binary file removed src/SyncTrayzor/Icons/syncing_1.ico
Binary file not shown.
Binary file modified src/SyncTrayzor/Icons/syncing_2.ico
Binary file not shown.
Binary file modified src/SyncTrayzor/Icons/syncing_3.ico
Binary file not shown.
Binary file modified src/SyncTrayzor/Icons/syncing_4.ico
Binary file not shown.
9 changes: 4 additions & 5 deletions src/SyncTrayzor/NotifyIcon/TaskbarIconResources.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:s="https://github.com/canton7/Stylet"
xmlns:tb="http://www.hardcodet.net/taskbar">

<BitmapImage x:Key="TaskbarIdleIcon" UriSource="pack://application:,,,/Icons/default.ico"/>
<BitmapImage x:Key="TaskbarStoppedIcon" UriSource="pack://application:,,,/Icons/stopped.ico"/>
<BitmapImage x:Key="TaskbarSyncing1Icon" UriSource="pack://application:,,,/Icons/syncing_1.ico"/>

<BitmapImage x:Key="TaskbarStoppedIcon" UriSource="pack://application:,,,/Icons/default_tray.ico"/>
<BitmapImage x:Key="TaskbarSyncing1Icon" UriSource="pack://application:,,,/Icons/default_tray.ico"/>
<BitmapImage x:Key="TaskbarSyncing2Icon" UriSource="pack://application:,,,/Icons/syncing_2.ico"/>
<BitmapImage x:Key="TaskbarSyncing3Icon" UriSource="pack://application:,,,/Icons/syncing_3.ico"/>
<BitmapImage x:Key="TaskbarSyncing4Icon" UriSource="pack://application:,,,/Icons/syncing_4.ico"/>
Expand Down Expand Up @@ -44,7 +43,7 @@
</tb:TaskbarIcon.Resources>
<tb:TaskbarIcon.Style>
<Style TargetType="tb:TaskbarIcon">
<Setter Property="IconSource" Value="{StaticResource TaskbarIdleIcon}"/>
<Setter Property="IconSource" Value="{StaticResource TaskbarSyncing1Icon}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding SyncThingStarted}" Value="False">
<Setter Property="IconSource" Value="{StaticResource TaskbarStoppedIcon}"/>
Expand Down
25 changes: 20 additions & 5 deletions src/SyncTrayzor/Pages/SettingsView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,26 @@

<GroupBox DockPanel.Dock="Top" Header="Syncthing">
<DockPanel>
<CheckBox DockPanel.Dock="Top" IsChecked="{Binding StartSyncThingAutomatically}">Start Syncthing on application start</CheckBox>
<Label DockPanel.Dock="Top" Target="{Binding ElementName=SyncThingAddress}">Address:</Label>
<TextBox DockPanel.Dock="Top" x:Name="SyncThingAddress" Text="{Binding SyncThingAddress}"/>
<Label DockPanel.Dock="Top" Target="{Binding ElementName=SyncThingApiKey}">API Key:</Label>
<TextBox DockPanel.Dock="Top" x:Name="SyncThingApiKey" Text="{Binding SyncThingApiKey}"/>
<DockPanel.Resources>
<ToolTip x:Key="AddressOverride">
SyncTrayzor overrides the "GUI Listen Address" specified in Syncthing's configuration. However,
you can set it to whatever value you like here.
</ToolTip>
<ToolTip x:Key="APIKeyOverride">
SyncTrayzor overrides the API key specified in Syncthing's configuration. However,
you can set it to whatever value you like here.
</ToolTip>
</DockPanel.Resources>

<CheckBox DockPanel.Dock="Top" IsChecked="{Binding StartSyncThingAutomatically}">Start Syncthing when SyncTrayzor starts</CheckBox>

<Label DockPanel.Dock="Top" Target="{Binding ElementName=SyncThingAddress}" ToolTip="{StaticResource AddressOverride}">GUI Listen Address:</Label>
<TextBox DockPanel.Dock="Top" x:Name="SyncThingAddress" ToolTip="{StaticResource AddressOverride}" Text="{Binding SyncThingAddress}"/>

<Label DockPanel.Dock="Top" Target="{Binding ElementName=SyncThingApiKey}" ToolTip="{StaticResource APIKeyOverride}">API Key:</Label>
<TextBox DockPanel.Dock="Top" x:Name="SyncThingApiKey" Text="{Binding SyncThingApiKey}" ToolTip="{StaticResource APIKeyOverride}"/>

<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,5,0,0">You must restart Syncthing for changes in these settings to take effect</TextBlock>
</DockPanel>
</GroupBox>

Expand Down
2 changes: 1 addition & 1 deletion src/SyncTrayzor/Pages/ShellView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xmlns:xaml="clr-namespace:SyncTrayzor.Xaml"
Height="700" Width="1100"
Title="SyncTrayzor"
Icon="..\Icons\default.ico">
Icon="..\Icons\default_tray.ico">
<i:Interaction.Behaviors>
<xaml:ActivateBehaviour Activated="{Binding WindowActivated}"/>
</i:Interaction.Behaviors>
Expand Down
4 changes: 2 additions & 2 deletions src/SyncTrayzor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,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.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
[assembly: AssemblyVersion("1.0.6.0")]
[assembly: AssemblyFileVersion("1.0.6.0")]
Loading

0 comments on commit df3a6fb

Please sign in to comment.