Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth Skovhede <kenneth@hexad.dk>2016-04-26 11:32:21 +0300
committerKenneth Skovhede <kenneth@hexad.dk>2016-04-26 11:32:21 +0300
commitc5be6a1652b9519176c1110114539e5462fb39ec (patch)
treed67c0c364dab390d554c14d5fc76346a01ed1852
parentae6dc66aec3a410ef939f2efb7ea5bef010396c3 (diff)
Added release type to update manager to avoid relying on a valid manifest for the install
-rw-r--r--Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt1
-rw-r--r--Duplicati/Library/AutoUpdater/AutoUpdateSettings.cs13
-rw-r--r--Duplicati/Library/AutoUpdater/Duplicati.Library.AutoUpdater.csproj1
-rw-r--r--Duplicati/Library/AutoUpdater/UpdaterManager.cs20
-rw-r--r--build-release.sh1
5 files changed, 27 insertions, 9 deletions
diff --git a/Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt b/Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt
new file mode 100644
index 000000000..e4a4f36a3
--- /dev/null
+++ b/Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt
@@ -0,0 +1 @@
+Stable \ No newline at end of file
diff --git a/Duplicati/Library/AutoUpdater/AutoUpdateSettings.cs b/Duplicati/Library/AutoUpdater/AutoUpdateSettings.cs
index 9da1c9f48..76c06724a 100644
--- a/Duplicati/Library/AutoUpdater/AutoUpdateSettings.cs
+++ b/Duplicati/Library/AutoUpdater/AutoUpdateSettings.cs
@@ -28,6 +28,7 @@ namespace Duplicati.Library.AutoUpdater
private const string APP_NAME = "AutoUpdateAppName.txt";
private const string UPDATE_URL = "AutoUpdateURL.txt";
private const string UPDATE_KEY = "AutoUpdateSignKey.txt";
+ private const string UPDATE_CHANNEL = "AutoUpdateBuildChannel.txt";
private const string UPDATE_README = "AutoUpdateFolderReadme.txt";
private const string UPDATE_INSTALL_FILE = "AutoUpdateInstallIDTemplate.txt";
@@ -57,9 +58,10 @@ namespace Duplicati.Library.AutoUpdater
{
ReadResourceText(APP_NAME, OEM_APP_NAME);
ReadResourceText(UPDATE_URL, OEM_UPDATE_URL);
- ReadResourceText(UPDATE_KEY, OEM_UPDATE_URL);
+ ReadResourceText(UPDATE_KEY, OEM_UPDATE_KEY);
ReadResourceText(UPDATE_README, OEM_UPDATE_README);
ReadResourceText(UPDATE_INSTALL_FILE, OEM_UPDATE_INSTALL_FILE);
+ ReadResourceText(UPDATE_CHANNEL, null);
}
private static string ReadResourceText(string name, string oemname)
@@ -135,9 +137,13 @@ namespace Duplicati.Library.AutoUpdater
}
}
+ if (string.IsNullOrWhiteSpace(channelstring))
+ channelstring = BuildUpdateChannel;
+
if (string.IsNullOrWhiteSpace(channelstring))
channelstring = UpdaterManager.BaseVersion.ReleaseType;
+
// Update from older builds
if (string.Equals(channelstring, "preview", StringComparison.InvariantCultureIgnoreCase))
channelstring = ReleaseType.Experimental.ToString();
@@ -157,6 +163,11 @@ namespace Duplicati.Library.AutoUpdater
get { return ReadResourceText(APP_NAME, OEM_APP_NAME); }
}
+ public static string BuildUpdateChannel
+ {
+ get { return ReadResourceText(UPDATE_CHANNEL, null); }
+ }
+
public static string UpdateFolderReadme
{
get { return ReadResourceText(UPDATE_README, OEM_UPDATE_README); }
diff --git a/Duplicati/Library/AutoUpdater/Duplicati.Library.AutoUpdater.csproj b/Duplicati/Library/AutoUpdater/Duplicati.Library.AutoUpdater.csproj
index 1c3e54436..20e96c3b4 100644
--- a/Duplicati/Library/AutoUpdater/Duplicati.Library.AutoUpdater.csproj
+++ b/Duplicati/Library/AutoUpdater/Duplicati.Library.AutoUpdater.csproj
@@ -69,6 +69,7 @@
<EmbeddedResource Include="AutoUpdateURL.txt" />
<EmbeddedResource Include="AutoUpdateFolderReadme.txt" />
<EmbeddedResource Include="AutoUpdateInstallIDTemplate.txt" />
+ <EmbeddedResource Include="AutoUpdateBuildChannel.txt" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
diff --git a/Duplicati/Library/AutoUpdater/UpdaterManager.cs b/Duplicati/Library/AutoUpdater/UpdaterManager.cs
index 59f3adb27..f5f270053 100644
--- a/Duplicati/Library/AutoUpdater/UpdaterManager.cs
+++ b/Duplicati/Library/AutoUpdater/UpdaterManager.cs
@@ -207,18 +207,22 @@ namespace Duplicati.Library.AutoUpdater
{
}
- if (selfVersion == null)
- selfVersion = new UpdateInfo() {
- Displayname = "Current",
- Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
- ReleaseTime = new DateTime(0),
- ReleaseType =
+ if (selfVersion == null)
+ {
+ selfVersion = new UpdateInfo() {
+ Displayname = "Current",
+ Version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
+ ReleaseTime = new DateTime(0),
+ ReleaseType =
#if DEBUG
"Debug"
#else
- "Nightly"
+ string.IsNullOrWhiteSpace(AutoUpdateSettings.BuildUpdateChannel) ? "Nightly" : AutoUpdateSettings.BuildUpdateChannel
#endif
- };
+ };
+
+
+ }
if (baseVersion == null)
baseVersion = selfVersion;
diff --git a/build-release.sh b/build-release.sh
index aca6ccf7a..68070365d 100644
--- a/build-release.sh
+++ b/build-release.sh
@@ -77,6 +77,7 @@ if [ ! "x${RELEASE_CHANGEINFO_NEWS}" == "x" ]; then
fi
echo "${RELEASE_NAME}" > "Duplicati/License/VersionTag.txt"
+echo "${RELEASE_TYPE}" > "Duplicati/Library/AutoUpdater/AutoUpdateBuildChannel.txt"
echo "${UPDATE_MANIFEST_URLS}" > "Duplicati/Library/AutoUpdater/AutoUpdateURL.txt"
cp "Updates/release_key.txt" "Duplicati/Library/AutoUpdater/AutoUpdateSignKey.txt"