Skip to content

Commit

Permalink
enable online-update functionality
Browse files Browse the repository at this point in the history
+ enabled update function; changed source to github.com
  • Loading branch information
c3rebro committed May 18, 2022
1 parent df82281 commit 3655237
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 16 deletions.

This file was deleted.

18 changes: 12 additions & 6 deletions RFiDGear/3rdParty/RedCell/RedCell.Diagnostics.Update/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ private void Check(object state)
{
try
{
if (IsUserNotified && !AllowUpdate)
return;

if (AllowUpdate && !_updating)
{
_timer.Change(5000, DefaultCheckInterval * 1000);
Expand Down Expand Up @@ -232,6 +229,12 @@ private void Check(object state)
NewVersionAvailable(this, null);
return;
}

if (IsUserNotified && !AllowUpdate)
{
StopMonitoring();
return;
}
}
catch (Exception e)
{
Expand All @@ -242,7 +245,7 @@ private void Check(object state)
/// <summary>
/// Updates this instance.
/// </summary>
private void Update()
public void Update()
{

Log.Write("Updating '{0}' files.", this._remoteConfig.Payloads.Length);
Expand Down Expand Up @@ -297,6 +300,8 @@ private void Update()
using (var zip = ZipFile.Read(zipfile))
zip.ExtractAll(Path.Combine(appDataPath, WorkPath), ExtractExistingFileAction.Throw);
File.Delete(zipfile);

AllowUpdate = true;
}
catch (Exception e)
{
Expand All @@ -309,9 +314,10 @@ private void Update()
if (IsUserNotified && AllowUpdate)
{
Process p = new Process();
ProcessStartInfo info = new ProcessStartInfo(Path.Combine(appDataPath, WorkPath, "RFiDGearBundleSetup.exe"))
ProcessStartInfo info = new ProcessStartInfo()
{
//info.Arguments = string.Format("/i {0}", Path.Combine(appDataPath, WorkPath, "RFiDGearBundleSetup.exe"));
FileName = "msiexec.exe",
Arguments = string.Format("/i \"{0}\" /lv \"c:\\temp\\rfidgeardeploy.log\"", Path.Combine(appDataPath, WorkPath, "Setup.msi")),
UseShellExecute = false
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ public class SettingsReaderWriter : IDisposable

private readonly string _settingsFileFileName = "settings.xml";
private readonly string _updateConfigFileFileName = "update.xml";
private readonly string _updateURL = @"http://hyperstack.de/rfidgear/update.xml";
private readonly string _updateURL = @"https://github.com/c3rebro/RFiDGear/releases/latest/download/update.xml";
private readonly int _updateInterval = 900;
private readonly string _securityToken = "D68EF3A7-E787-4CC4-B020-878BA649B4CD";
private readonly string _payload = "update.zip";
private readonly string _baseUri = @"http://hyperstack.de/rfidgear/download/";
private readonly string _baseUri = @"https://github.com/c3rebro/RFiDGear/releases/latest/download/";

private readonly Version Version = Assembly.GetExecutingAssembly().GetName().Version;

Expand Down
Binary file added RFiDGear/Resources/animatedChip1Orig.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion RFiDGear/ViewModel/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3290,7 +3290,7 @@ private void AskForUpdateNow(object sender, EventArgs e)
Buttons = MessageBoxButton.YesNo,
Image = MessageBoxImage.Question
}.Show(this.Dialogs) == MessageBoxResult.Yes)
(sender as Updater).AllowUpdate = true;
(sender as Updater).Update();
else
{
(sender as Updater).AllowUpdate = false;
Expand Down
4 changes: 2 additions & 2 deletions update.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<Manifest version="1">
<CheckInterval>900</CheckInterval>
<RemoteConfigUri>http://eventmessenger.hyperstack.de/update.xml</RemoteConfigUri>
<RemoteConfigUri>https://github.com/c3rebro/RFiDGear/releases/latest/download/update.xml</RemoteConfigUri>
<SecurityToken>D68EF3A7-E787-4CC4-B020-878BA649B4CD</SecurityToken>
<BaseUri>http://eventmessenger.hyperstack.de/download/</BaseUri>
<BaseUri>https://github.com/c3rebro/RFiDGear/releases/latest/download/<BaseUri>
<Payload>update.zip</Payload>
</Manifest>
Binary file added zipped.rfPrj
Binary file not shown.

0 comments on commit 3655237

Please sign in to comment.