Skip to content

Commit

Permalink
fix broken updater
Browse files Browse the repository at this point in the history
  • Loading branch information
argorar committed Feb 26, 2022
1 parent 2d1f693 commit b0ccecc
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 47 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ See user details in tab *General*. If you are creating several gfys of the same
## Changelog

#### Version 3.17.1
* fix broken WebMConverter.Updater.exe
* fix a bug in change rate form, press enter after changes values doesn't save them
* fix a bug in resize form, it doesn't load the values saved previously

Expand Down
2 changes: 2 additions & 0 deletions Updater/CheckUpdate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ public static bool CheckUpdate(string currentVerString, out string output)

if (latestVersion > currentVersion)
{

output = latestVersion.ToString();
output += Environment.NewLine;

return true;
}
return false;
Expand Down
33 changes: 23 additions & 10 deletions Updater/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.Diagnostics;
using System.Net;
using System.Runtime.InteropServices;
using System.Windows.Forms;

namespace WebMConverter.Updater
Expand All @@ -9,12 +11,18 @@ static partial class Program
public const string VersionUrl = @"https://argorar.github.io/WebMConverter/NewUpdate/latest";
public const string ProgramUrl = @"https://argorar.github.io/WebMConverter/NewUpdate/{0}.zip";

[DllImport("user32.dll")]
static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static int Main(string[] args)
{
IntPtr h = Process.GetCurrentProcess().MainWindowHandle;
ShowWindow(h, 0);
Application.EnableVisualStyles();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
Expand All @@ -26,18 +34,23 @@ static int Main(string[] args)
}

var mode = args[0];
if (mode.Equals("check"))
switch (mode)
{
var current = args[1];
string output;
var success = CheckUpdate(current, out output);
return success ? 0 : 1;
case "check":
var current = args[1];
string output;

var success = CheckUpdate(current, out output);
Console.Write(output);

return success ? 0 : 1;

case "update":
Application.Run(new UpdateUI());
return 0;
}
else if (mode.Equals("update"))
{
Application.Run(new UpdateUI());
return 0;
}

Console.WriteLine("Invalid mode");
return 1;
}
}
Expand Down
4 changes: 2 additions & 2 deletions Updater/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.1")]
[assembly: AssemblyFileVersion("1.2.0.1")]
[assembly: AssemblyVersion("1.2.1.0")]
[assembly: AssemblyFileVersion("1.2.1.0")]
26 changes: 13 additions & 13 deletions Updater/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Updater/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions Updater/UpdateUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions Updater/Updater.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>82919fbf</NuGetPackageImportStamp>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
Expand All @@ -24,20 +25,18 @@
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<WarningLevel>0</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -54,6 +53,12 @@
<PropertyGroup>
<ApplicationIcon>icon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>firma.pfx</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Semver, Version=1.1.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\semver.1.1.2\lib\net45\Semver.dll</HintPath>
Expand Down Expand Up @@ -89,7 +94,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<None Include="firma.pfx" />
<None Include="packages.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
3 changes: 0 additions & 3 deletions Updater/app.config

This file was deleted.

0 comments on commit b0ccecc

Please sign in to comment.