Skip to content

Commit

Permalink
update the updator, add mc 1.21, bump to version 0.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
NoobNotFound committed Jun 17, 2024
1 parent fdabf68 commit b136172
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
21 changes: 10 additions & 11 deletions Emerald.App/Emerald.App.Package/Package.WinUI.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<EntryPointProjectUniqueName>..\Emerald.App\Emerald.App.csproj</EntryPointProjectUniqueName>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<PackageCertificateThumbprint>9CBDFA6FDB25BE48AA09759C40DFAB769CF9740A</PackageCertificateThumbprint>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>x86|x64|arm64</AppxBundlePlatforms>
<AppInstallerUri>D:\Projects\Emerald\Emerald.App\Emerald.App.Package\AppPackages\</AppInstallerUri>
Expand All @@ -66,31 +65,31 @@
<PackageCertificateKeyFile>Package.WinUI_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SkipOld|x64'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SkipOld|arm64'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|arm64'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='SkipOld|x86'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|arm64'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<AppxBundle>Auto</AppxBundle>
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
Expand Down
2 changes: 1 addition & 1 deletion Emerald.App/Emerald.App.Package/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Identity
Name="Riverside.Emerald"
Publisher="CN=NoobNotFound"
Version="0.7.8.0" />
Version="0.7.9.0" />

<Properties>
<DisplayName>Emerald</DisplayName>
Expand Down
1 change: 1 addition & 0 deletions Emerald.App/Emerald.App/Helpers/MCVersionsCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public ObservableCollection<MinecraftVersion> CreateVersions()
Collection.Add(LoadCustomVers());
}

AddItem("1.21");
AddItem("1.20");
AddItem("1.19");
AddItem("1.18");
Expand Down
13 changes: 9 additions & 4 deletions Emerald.App/Emerald.App/Helpers/Updater/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,18 @@ public async void CheckForUpdates(bool OnlyInformifHigherAvailable = false)
if (!rel.Assets.Any(x => x.Name.EndsWith("msixbundle") && x.Name.ToLower().Contains(this.Architecture.ToString().ToLower())))
{
TasksHelper.CompleteTask(id, false, "NoMsixUpdate");
goto Return;

if (!OnlyInformifHigherAvailable)
MessageBox.Show("Error".Localize(), "NoMsixUpdate".Localize(), Enums.MessageBoxButtons.Ok);

goto Return;
}
var asset = rel.Assets.First(x => x.Name.EndsWith("msixbundle") && x.Name.ToLower().Contains(this.Architecture.ToString().ToLower()));
if (ver > currentver)
{
TasksHelper.CompleteTask(id, true, "UpdateAvailable");

var msg = await MessageBox.Show("UpdateAvailable".Localize(), "##ReleaseNotes".Localize() + "\n\n " + rel.Body,Enums.MessageBoxButtons.CustomWithCancel, "UpdateNow".Localize());
var msg = await MessageBox.Show("UpdateAvailable".Localize(), "## Version: " + ver.ToString() + "\n\n###ReleaseNotes".Localize() + "\n\n " + rel.Body,Enums.MessageBoxButtons.CustomWithCancel, "UpdateNow".Localize());
if(msg == Enums.MessageBoxResults.Cancel)
goto Return;

Expand All @@ -100,8 +104,7 @@ public async void CheckForUpdates(bool OnlyInformifHigherAvailable = false)
if(OnlyInformifHigherAvailable)
goto Return;

var msg = await MessageBox.Show("DowngradeAvailable".Localize(), "DowngradeDescription".Localize(),Enums.MessageBoxButtons.CustomWithCancel,"Downgrade".Localize());
if (msg == Enums.MessageBoxResults.Cancel)
var msg = await MessageBox.Show("DowngradeAvailable".Localize(), "DowngradeDescription".Localize(),Enums.MessageBoxButtons.Ok);
goto Return;


Expand All @@ -117,6 +120,8 @@ public async void CheckForUpdates(bool OnlyInformifHigherAvailable = false)
goto Return;
}
var a = rel.Assets.First(x => x.Name.EndsWith("msixbundle") && x.Name.ToLower().Contains(this.Architecture.ToString().ToLower()));
if(a == null)
goto Return ;
DownloadQAndInstallUpdate(a.BrowserDownloadUrl,a.Name);

Return:
Expand Down
2 changes: 1 addition & 1 deletion Emerald.App/Emerald.App/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void TintColor()
};

if (SS.Settings.App.Updates.CheckAtStartup)
App.Current.Updater.CheckForUpdates();
App.Current.Updater.CheckForUpdates(true);
(Content as FrameworkElement).Loaded -= Initialize;
}
private static void UpdateUI()
Expand Down
8 changes: 4 additions & 4 deletions Emerald.App/Emerald.App/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
<value>Load Mod</value>
</data>
<data name="LoadSettingsFailed" xml:space="preserve">
<value>Failed to load the app settings accounts. The version of the setting system is different. You may have recently updated the app. Contact a developer of this app to recover the settings</value>
<value>Failed to load the app settings and accounts. The version of the setting system is different. You may have recently updated the app. Contact a developer of this app to recover the settings</value>
</data>
<data name="Login" xml:space="preserve">
<value>Login</value>
Expand Down Expand Up @@ -710,7 +710,7 @@
<value>Downgrade Available</value>
</data>
<data name="DowngradeDescription" xml:space="preserve">
<value>The current version is higher than the latest version in the servers. You must be using a private beta. Do you want to downgrade?</value>
<value>The current version is higher than the latest version in the servers. You must be using a private beta. Please wait until a higher stable version be available</value>
</data>
<data name="DownloadingUpdate" xml:space="preserve">
<value>Download Update</value>
Expand All @@ -719,7 +719,7 @@
<value>Install Update</value>
</data>
<data name="NoMsixUpdate" xml:space="preserve">
<value>Failed to find the installer package in the release</value>
<value>Failed to find the installer package in the release for this architecture</value>
</data>
<data name="NoUpdates" xml:space="preserve">
<value>You are on the latest version</value>
Expand Down Expand Up @@ -752,6 +752,6 @@
<value>Updates</value>
</data>
<data name="UpdatesDescription" xml:space="preserve">
<value>Automatically update, include prerelease etc..</value>
<value>Auto update, include prerelease etc..</value>
</data>
</root>

0 comments on commit b136172

Please sign in to comment.