Skip to content

Commit

Permalink
Now it is possible to run AutoUpdater without XML url but it requires…
Browse files Browse the repository at this point in the history
… handling ParseUpdateInfoEvent in that case.

Added more space for Remind Later button when current locale is Spanish.

This closes #432 and closes #708.
  • Loading branch information
ravibpatel committed Sep 13, 2024
1 parent 7fef4e1 commit d3ea38f
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 271 deletions.
484 changes: 242 additions & 242 deletions AutoUpdater.NET/AutoUpdater.NET.csproj

Large diffs are not rendered by default.

35 changes: 21 additions & 14 deletions AutoUpdater.NET/AutoUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,25 +405,32 @@ private static object CheckUpdate(Assembly mainAssembly)

PersistenceProvider ??= new RegistryPersistenceProvider(registryLocation);

BaseUri = new Uri(AppCastURL);

UpdateInfoEventArgs args;
using (MyWebClient client = GetWebClient(BaseUri, BasicAuthXML))
string xml = null;

if (AppCastURL != null)
{
string xml = client.DownloadString(BaseUri);
BaseUri = new Uri(AppCastURL);
using MyWebClient client = GetWebClient(BaseUri, BasicAuthXML);
xml = client.DownloadString(BaseUri);
}

if (ParseUpdateInfoEvent == null)
{
var xmlSerializer = new XmlSerializer(typeof(UpdateInfoEventArgs));
var xmlTextReader = new XmlTextReader(new StringReader(xml)) { XmlResolver = null };
args = (UpdateInfoEventArgs)xmlSerializer.Deserialize(xmlTextReader);
}
else
if (ParseUpdateInfoEvent == null)
{
if (string.IsNullOrEmpty(xml))
{
var parseArgs = new ParseUpdateInfoEventArgs(xml);
ParseUpdateInfoEvent(parseArgs);
args = parseArgs.UpdateInfo;
throw new Exception("It is required to handle ParseUpdateInfoEvent when XML url is not specified.");
}

var xmlSerializer = new XmlSerializer(typeof(UpdateInfoEventArgs));
var xmlTextReader = new XmlTextReader(new StringReader(xml)) { XmlResolver = null };
args = (UpdateInfoEventArgs)xmlSerializer.Deserialize(xmlTextReader);
}
else
{
var parseArgs = new ParseUpdateInfoEventArgs(xml);
ParseUpdateInfoEvent(parseArgs);
args = parseArgs.UpdateInfo;
}

if (string.IsNullOrEmpty(args?.CurrentVersion) || string.IsNullOrEmpty(args.DownloadURL))
Expand Down
10 changes: 8 additions & 2 deletions AutoUpdater.NET/UpdateForm.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,15 @@
<value>Notas de la versión :</value>
</data>
<data name="buttonUpdate.Text" xml:space="preserve">
<value>actualizar</value>
<value>Actualizar</value>
</data>
<data name="buttonRemindLater.Text" xml:space="preserve">
<data name="buttonRemindLater.Location" type="System.Drawing.Point, System.Drawing">
<value>300, 573</value>
</data>
<data name="buttonRemindLater.Size" type="System.Drawing.Size, System.Drawing">
<value>175, 28</value>
</data>
<data name="buttonRemindLater.Text" xml:space="preserve">
<value>Recuérdame más tarde</value>
</data>
<data name="buttonSkip.Text" xml:space="preserve">
Expand Down
14 changes: 7 additions & 7 deletions AutoUpdater.NET/build/Autoupdater.NET.Official.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<id>Autoupdater.NET.Official</id>
<version>1.9.2.0</version>
<version>1.9.3.0</version>
<title>AutoUpdater.NET</title>
<authors>rbsoft</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
Expand All @@ -18,22 +18,22 @@
<tags>autoupdate updater c# vb wpf winforms</tags>
<dependencies>
<group targetFramework=".NETFramework4.6.2">
<dependency id="Microsoft.Web.WebView2" version="1.0.2592.51" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Web.WebView2" version="1.0.2739.15" exclude="Build,Analyzers"/>
</group>
<group targetFramework=".NETCoreApp3.1">
<dependency id="Microsoft.Web.WebView2" version="1.0.2592.51" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Web.WebView2" version="1.0.2739.15" exclude="Build,Analyzers"/>
</group>
<group targetFramework="net5.0-windows7.0">
<dependency id="Microsoft.Web.WebView2" version="1.0.2592.51" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Web.WebView2" version="1.0.2739.15" exclude="Build,Analyzers"/>
</group>
<group targetFramework="net6.0-windows7.0">
<dependency id="Microsoft.Web.WebView2" version="1.0.2592.51" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Web.WebView2" version="1.0.2739.15" exclude="Build,Analyzers"/>
</group>
<group targetFramework="net7.0-windows7.0">
<dependency id="Microsoft.Web.WebView2" version="1.0.2592.51" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Web.WebView2" version="1.0.2739.15" exclude="Build,Analyzers"/>
</group>
<group targetFramework="net8.0-windows7.0">
<dependency id="Microsoft.Web.WebView2" version="1.0.2592.51" exclude="Build,Analyzers"/>
<dependency id="Microsoft.Web.WebView2" version="1.0.2739.15" exclude="Build,Analyzers"/>
</group>
</dependencies>
<frameworkReferences>
Expand Down
2 changes: 2 additions & 0 deletions ZipExtractor/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ private void FormMain_Shown(object sender, EventArgs e)
_logBuilder.AppendLine("BackgroundWorker started successfully.");
ControlBox = false;
// Ensures that the last character on the extraction path
// is the directory separator char.
// Without this, a malicious zip file could try to traverse outside of the expected
Expand Down
8 changes: 4 additions & 4 deletions ZipExtractor/ZipExtractor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<Company>RBSoft</Company>
<Product>ZipExtractor</Product>
<Copyright>Copyright © 2012-2024 RBSoft</Copyright>
<Version>1.5.2.0</Version>
<AssemblyVersion>1.5.2.0</AssemblyVersion>
<FileVersion>1.5.2.0</FileVersion>
<ApplicationVersion>1.5.2.0</ApplicationVersion>
<Version>1.5.3.0</Version>
<AssemblyVersion>1.5.3.0</AssemblyVersion>
<FileVersion>1.5.3.0</FileVersion>
<ApplicationVersion>1.5.3.0</ApplicationVersion>
<ApplicationIcon>ZipExtractor.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
<SignAssembly>true</SignAssembly>
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: 1.9.2.{build}
version: 1.9.3.{build}
environment:
my_version: 1.9.2
my_version: 1.9.3
my_secret:
secure: vbPRaZLQYpGPr4BrZZ4p6TofpSZMud+FKtlpqjgO8aA=
skip_branch_with_pr: true
Expand Down

0 comments on commit d3ea38f

Please sign in to comment.