debug versioning

This commit is contained in:
pointfeev 2022-06-11 22:37:32 -05:00
parent 6ca07b02de
commit 53a9291dbf
4 changed files with 53 additions and 6 deletions

View file

@ -1,12 +1,17 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31025.194
# Visual Studio Version 17
VisualStudioVersion = 17.2.32516.85
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreamInstaller", "CreamInstaller\CreamInstaller.csproj", "{6C94C882-7168-435E-B9E3-B4B9222BBF68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
@ -14,6 +19,16 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|ARM.ActiveCfg = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|ARM.Build.0 = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|ARM64.Build.0 = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|x64.ActiveCfg = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|x64.Build.0 = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|x86.ActiveCfg = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Debug|x86.Build.0 = Debug|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Release|Any CPU.Build.0 = Release|Any CPU
{6C94C882-7168-435E-B9E3-B4B9222BBF68}.Release|ARM.ActiveCfg = Release|Any CPU

View file

@ -5,7 +5,7 @@
<UseWindowsForms>True</UseWindowsForms>
<ApplicationIcon>Resources\ini.ico</ApplicationIcon>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<Version>3.5.2.0</Version>
<Version>3.5.2.1</Version>
<PackageIcon>Resources\ini.ico</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Copyright>2021, pointfeev (https://github.com/pointfeev)</Copyright>
@ -29,11 +29,14 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>embedded</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>$(DefineConstants)</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<Optimize>True</Optimize>
<DebugType>embedded</DebugType>
<DefineConstants>$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Gameloop.Vdf" Version="0.6.1" />

View file

@ -70,13 +70,24 @@ internal partial class MainForm : CustomForm
checkForUpdatesResult = await updateManager.CheckForUpdatesAsync(cancellationTokenSource.Token);
cancellationTokenSource.Dispose();
cancellationTokenSource = null;
#if !DEBUG
if (checkForUpdatesResult.CanUpdate)
{
#endif
latestVersion = checkForUpdatesResult.LastVersion;
versions = checkForUpdatesResult.Versions;
#if !DEBUG
}
#endif
}
#if DEBUG
catch (Exception e)
{
e.HandleException(form: this, caption: "Debug exception", acceptButtonText: "OK", cancelButtonText: null);
}
#else
catch { }
#endif
}
if (latestVersion is null)
{
@ -92,14 +103,19 @@ internal partial class MainForm : CustomForm
updateButton.Click += new(OnUpdate);
changelogTreeView.Visible = true;
Version currentVersion = new(Application.ProductVersion);
#if DEBUG
foreach (Version version in versions.Where(v => (v > currentVersion || v == latestVersion) && !changelogTreeView.Nodes.ContainsKey(v.ToString())))
#else
foreach (Version version in versions.Where(v => v > currentVersion && !changelogTreeView.Nodes.ContainsKey(v.ToString())))
#endif
{
TreeNode root = new($"v{version}")
{
Name = version.ToString()
};
changelogTreeView.Nodes.Add(root);
if (changelogTreeView.Nodes.Count > 0) changelogTreeView.Nodes[0].EnsureVisible();
if (changelogTreeView.Nodes.Count > 0)
changelogTreeView.Nodes[0].EnsureVisible();
_ = Task.Run(async () =>
{
HtmlNodeCollection nodes = await HttpClientManager.GetDocumentNodes(
@ -116,7 +132,8 @@ internal partial class MainForm : CustomForm
};
root.Nodes.Add(change);
root.Expand();
if (changelogTreeView.Nodes.Count > 0) changelogTreeView.Nodes[0].EnsureVisible();
if (changelogTreeView.Nodes.Count > 0)
changelogTreeView.Nodes[0].EnsureVisible();
});
}
});
@ -178,7 +195,14 @@ internal partial class MainForm : CustomForm
cancellationTokenSource.Dispose();
cancellationTokenSource = null;
}
#if DEBUG
catch (Exception ex)
{
ex.HandleException(form: this, caption: "Debug exception", acceptButtonText: "OK", cancelButtonText: null);
}
#else
catch { }
#endif
if (updateManager is not null && updateManager.IsUpdatePrepared(latestVersion))
{

View file

@ -14,8 +14,13 @@ namespace CreamInstaller;
internal static class Program
{
#if DEBUG
internal static readonly string ApplicationName = Application.CompanyName + " v" + Application.ProductVersion + "-debug: " + Application.ProductName;
internal static readonly string ApplicationNameShort = Application.CompanyName + " v" + Application.ProductVersion + "-debug";
#else
internal static readonly string ApplicationName = Application.CompanyName + " v" + Application.ProductVersion + ": " + Application.ProductName;
internal static readonly string ApplicationNameShort = Application.CompanyName + " v" + Application.ProductVersion;
#endif
internal static readonly Assembly EntryAssembly = Assembly.GetEntryAssembly();
internal static readonly Process CurrentProcess = Process.GetCurrentProcess();