浏览代码

Drop Syncthing 0.10, and don't replace binary in AppData

There's more thinking to be done around when we replace the Syncthing
binary in AppData, but it's not required right now.

This fixes a potential issue where people let Syncthing upgrade itself
to 0.11, but the installer's still in 0.10 mode, so their 0.11 version
gets overwritten by the installer. Not ideal.

We now only write the binary to AppData if it doesn't already exist.
This puts more responsibility on the user to keep this up to date,
but it should be auto-updated by default. In future we may want some
mechanism to run 'syncthing.exe -version' and check whether it's too
old: if it is, offer to replace it. However, there's no current
(known) 'too old to be compatible' version, so this isn't (yet) an
issue

Fixes #66
Antony Male 10 年之前
父节点
当前提交
f984ba0731
共有 5 个文件被更改,包括 5 次插入36 次删除
  1. 1 0
      .gitignore
  2. 1 1
      Rakefile
  3. 2 11
      installer/x64/installer-x64.iss
  4. 1 9
      installer/x86/installer-x86.iss
  5. 0 15
      src/SyncTrayzor/Services/Config/ConfigurationProvider.cs

+ 1 - 0
.gitignore

@@ -37,6 +37,7 @@ packages/
 SyncTrayzorSetup*.exe
 SyncTrayzorPortable*
 syncthing-*.exe
+syncthing.exe
 
 *.gjq
 *.tmp

+ 1 - 1
Rakefile

@@ -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
 

+ 2 - 11
installer/x64/installer-x64.iss

@@ -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}"
@@ -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
 

+ 1 - 9
installer/x86/installer-x86.iss

@@ -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}"
@@ -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
 

+ 0 - 15
src/SyncTrayzor/Services/Config/ConfigurationProvider.cs

@@ -112,21 +112,6 @@ namespace SyncTrayzor.Services.Config
                         throw new Exception(String.Format("Unable to find Syncthing at {0} or {1}", this.paths.SyncthingPath, this.paths.SyncthingBackupPath));
                     }
                 }
-                else if (installCountChanged)
-                {
-                    // If we hit this, then latestInstallCount is set to a real value
-                    logger.Info("Install Count changed, so updating Syncthing at {0} from {1}", this.paths.SyncthingPath, this.paths.SyncthingBackupPath);
-                    try
-                    {
-                        File.Copy(this.paths.SyncthingBackupPath, this.paths.SyncthingPath, true);
-                    }
-                    catch (IOException e)
-                    {
-                        // Syncthing.exe was probably running. We'll try again next time
-                        updateConfigInstallCount = false;
-                        logger.Error(String.Format("Failed to copy Syncthing from {0} to {1}", this.paths.SyncthingBackupPath, this.paths.SyncthingPath), e);
-                    }
-                }
             }
 
             if (updateConfigInstallCount)