Skip to content

Commit

Permalink
Use SemVer for check update
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastienwarin committed Nov 15, 2019
1 parent 28c4ac2 commit fc43020
Show file tree
Hide file tree
Showing 3 changed files with 598 additions and 2 deletions.
5 changes: 3 additions & 2 deletions SWYH/App.xaml.cs
Expand Up @@ -24,6 +24,7 @@
namespace SWYH
{
using OpenSource.UPnP.AV.RENDERER.CP;
using Semver;
using SWYH.Audio;
using SWYH.UPnP;
using System;
Expand Down Expand Up @@ -164,8 +165,8 @@ private void CheckNewVersion()
string lastVersionStr = wc.DownloadString(Constants.UPDATE_VERSION_URL);
if (!string.IsNullOrEmpty(lastVersionStr))
{
Version lastVersion = new Version(lastVersionStr);
Version currentVersion = new Version(fileVersion.FileVersion);
SemVersion lastVersion = SemVersion.Parse(lastVersionStr);
SemVersion currentVersion = SemVersion.Parse(fileVersion.FileVersion);
App.NeedUpdate = (lastVersion > currentVersion);
if (App.NeedUpdate)
{
Expand Down
1 change: 1 addition & 0 deletions SWYH/SWYH.csproj
Expand Up @@ -111,6 +111,7 @@
<Compile Include="Audio\WasapiProvider.cs" />
<Compile Include="Audio\WaveProviderToWaveStream.cs" />
<Compile Include="Constants.cs" />
<Compile Include="SemVer.cs" />
<Compile Include="Windows\HTTPLiveStreamWindow.xaml.cs">
<DependentUpon>HTTPLiveStreamWindow.xaml</DependentUpon>
</Compile>
Expand Down

0 comments on commit fc43020

Please sign in to comment.