Skip to content

Commit

Permalink
rem - brk|doc - Remove auto-download updates
Browse files Browse the repository at this point in the history
---

We no longer need to automatically download kernel updates, since we now
ship an installer.

---

Type: rem
Breaking: True
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jan 19, 2025
1 parent 4f45532 commit c555cbc
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 109 deletions.
5 changes: 2 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
changes!
-->
<NitrocidModAPIVersionMajor>3.1.27</NitrocidModAPIVersionMajor>
<NitrocidModAPIVersionChangeset>33</NitrocidModAPIVersionChangeset>
<NitrocidModAPIVersionChangeset>34</NitrocidModAPIVersionChangeset>

<!-- The above two properties are to be installed to the file version -->
<NitrocidModAPIVersion>$(NitrocidModAPIVersionMajor).$(NitrocidModAPIVersionChangeset)</NitrocidModAPIVersion>
Expand All @@ -35,10 +35,9 @@
<!--
Note for constants: All Nitrocid flags should be defined by defining NitrocidFlags, not DefineConstants. Here's how you
define such flags: -p:NitrocidFlags=PACKAGEMANAGERBUILD
define such flags: -p:NitrocidFlags=VSDEBUG
Supported constants (NitrocidFlags):
- PACKAGEMANAGERBUILD: Indicates that this build is a package manager build suitable for Launchpad PPA
- VSDEBUG: Enables immediate window debug in the "Output" pane
Possible specifiers (NitrocidReleaseSpecifier):
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MODAPI = 27
OUTPUTS = public/Nitrocid/KSBuild public/*/obj public/*/*/obj private/*/bin private/*/obj debian/nitrocid-$(MODAPI) debian/nitrocid-$(MODAPI)-lite debian/tmp
OUTPUT = public/Nitrocid/KSBuild/net8.0
BINARIES = assets/ks-n assets/ks-jl
BINARIES = assets/ks assets/ks-jl
MANUALS = assets/ks.1 assets/ks-jl.1
DESKTOPS = assets/ks.desktop
BRANDINGS = public/Nitrocid/OfficialAppIcon-NitrocidKS-512.png
Expand Down Expand Up @@ -46,7 +46,7 @@ install:
find $(OUTPUT) -mindepth 1 -type f -exec sh -c 'install -m 644 -t "$(FDESTDIR)/lib/ks-$(MODAPI)/$$(dirname $$(realpath --relative-to $(OUTPUT) "$$0"))" "$$0"' {} \;
install -m 755 -t $(FDESTDIR)/share/applications/ $(DESKTOPS)
install -m 755 -t $(FDESTDIR)/lib/ks-$(MODAPI)/ $(BRANDINGS)
mv $(FDESTDIR)/bin/ks-n $(FDESTDIR)/bin/ks-$(MODAPI)
mv $(FDESTDIR)/bin/ks $(FDESTDIR)/bin/ks-$(MODAPI)
mv $(FDESTDIR)/bin/ks-jl $(FDESTDIR)/bin/ks-jl-$(MODAPI)
mv $(FDESTDIR)/share/man/man1/ks.1 $(FDESTDIR)/share/man/man1/ks-$(MODAPI).1
mv $(FDESTDIR)/share/man/man1/ks-jl.1 $(FDESTDIR)/share/man/man1/ks-jl-$(MODAPI).1
Expand Down
17 changes: 0 additions & 17 deletions assets/ks
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

unrarpath=`which unrar`
unrarexistent=$?
isppa=0

# Run the entry point
if [ -e "/usr/lib/ks/Nitrocid.dll" ]; then
isppa=1
dotnet "/usr/lib/ks/Nitrocid.dll" $@
elif [ -e "./Nitrocid.dll" ]; then
dotnet "./Nitrocid.dll" $@
Expand All @@ -32,15 +27,3 @@ else
exit 1
fi

# Check to see if we're on the PPA
if [ $isppa == 0 ]; then
# Check to see if we have unrar and update.rar
if [ ! $unrarexistent == 0 ]; then
echo unrar is not found.
exit 1
fi
if [ -e "./update.rar" ]; then
echo Update found. Installing...
"$unrarpath" x -ep1 -r "./update.rar"
fi
fi
29 changes: 0 additions & 29 deletions assets/ks-n

This file was deleted.

2 changes: 1 addition & 1 deletion public/Nitrocid.Templates/templates/KSMod/ModName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ModName : IMod

public string Version => "1.0.0";

public Version MinimumSupportedApiVersion => new(3, 1, 27, 33);
public Version MinimumSupportedApiVersion => new(3, 1, 27, 34);

public ModLoadPriority LoadPriority => ModLoadPriority.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ public string CurrentLanguage
/// </summary>
public bool ShowStackTraceOnKernelError { get; set; }
/// <summary>
/// If there is any update, the kernel will automatically download it.
/// </summary>
public bool AutoDownloadUpdate { get; set; } = true;
/// <summary>
/// Enables debugging for the kernel event system
/// </summary>
public bool EventDebug { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
using Terminaux.Inputs.Styles;
using Nitrocid.Kernel.Exceptions;

#if SPECIFIERREL
#if !PACKAGEMANAGERBUILD
using Nitrocid.Kernel.Updates;
#endif
#endif

namespace Nitrocid.Kernel.Configuration.Settings
{
internal static class SettingsAppTools
Expand Down Expand Up @@ -146,27 +140,19 @@ internal static void ReloadConfig()

internal static void CheckForSystemUpdates()
{
#if SPECIFIERREL && !PACKAGEMANAGERBUILD
#if SPECIFIERREL
// Check for updates now
InfoBoxNonModalColor.WriteInfoBox(Translate.DoTranslation("Checking for system updates..."));
var AvailableUpdate = UpdateManager.FetchBinaryArchive();

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / Make API Reference

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / Make API Reference

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / Make API Reference

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / Make API Reference

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (macos-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / wix-arm64

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / wix-arm64

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / wix-amd64

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / wix-amd64

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The name 'UpdateManager' does not exist in the current context

Check failure on line 146 in public/Nitrocid/Kernel/Configuration/Settings/SettingsAppTools.cs

View workflow job for this annotation

GitHub Actions / build (windows-latest)

The name 'UpdateManager' does not exist in the current context
if (AvailableUpdate is not null)
{
if (!AvailableUpdate.Updated)
{
InfoBoxModalColor.WriteInfoBoxModal(Translate.DoTranslation("Found new version: ") + $"{AvailableUpdate.UpdateVersion}");
}
else
{
InfoBoxModalColor.WriteInfoBoxModal(Translate.DoTranslation("You're up to date!"));
}
}
else if (AvailableUpdate is null)
{
InfoBoxModalColor.WriteInfoBoxModal(Translate.DoTranslation("Failed to check for updates."));
}
#elif PACKAGEMANAGERBUILD
InfoBoxModalColor.WriteInfoBoxModal(Translate.DoTranslation("You've installed Nitrocid KS using your package manager. Please use it to upgrade your kernel instead."));
#else
InfoBoxModalColor.WriteInfoBoxModal(Translate.DoTranslation("Checking for updates is disabled on development versions."));
#endif
Expand Down
14 changes: 0 additions & 14 deletions public/Nitrocid/Kernel/KernelFirstRun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,27 +236,13 @@ internal static void PresentFirstRun()
]
}
),
new InputInfo(
Translate.DoTranslation("Automatic Update Download"), Translate.DoTranslation("Automatic Update Download"),
new SelectionInputMethod()
{
Question = Translate.DoTranslation("Do you want Nitrocid KS to automatically download updates?"),
Choices =
[
new InputChoiceInfo("y", Translate.DoTranslation("Yes, I do!")),
new InputChoiceInfo("n", Translate.DoTranslation("No, thanks.")),
]
}
)
]
)
]
);
PresentationTools.Present(firstRunPresUpdates, true, true);
bool needsAutoCheck = (int?)firstRunPresUpdates.Pages[0].Inputs[0].InputMethod.Input == 0;
bool needsAutoDownload = (int?)firstRunPresUpdates.Pages[0].Inputs[1].InputMethod.Input == 0;
Config.MainConfig.CheckUpdateStart = needsAutoCheck;
Config.MainConfig.AutoDownloadUpdate = needsAutoDownload;

Slideshow firstRunPresOutro = new(
// Presentation name
Expand Down
22 changes: 4 additions & 18 deletions public/Nitrocid/Kernel/Updates/UpdateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ public static void CheckKernelUpdates()
// translated in the compiler pre-processor directives, so we need to move all translations here to
// avoid this happening again and for the locale tools to actually see them.
string devVersionWarning = Translate.DoTranslation("Checking for updates is disabled because you're running a development version.");
string packageManagerError = Translate.DoTranslation("You've installed Nitrocid KS using your package manager. Please use it to upgrade your kernel instead.");
string checkFailed = Translate.DoTranslation("Failed to check for updates.");
string checking = Translate.DoTranslation("Checking for system updates...");
string newVersion = Translate.DoTranslation("Found new version: ");
string downloaded = Translate.DoTranslation("Downloaded the update successfully!");
string downloadManually = Translate.DoTranslation("You can download it at: ");
string upToDate = Translate.DoTranslation("You're up to date!");
#if SPECIFIERREL && !PACKAGEMANAGERBUILD

#if SPECIFIERREL
// Check for updates now
SplashReport.ReportProgress(checking, 10);
var AvailableUpdate = FetchBinaryArchive();
Expand All @@ -156,28 +156,14 @@ public static void CheckKernelUpdates()
{
SplashReport.ReportProgress(newVersion, 10);
SplashReport.ReportProgress(AvailableUpdate.UpdateVersion.ToString(), 10);
if (Config.MainConfig.AutoDownloadUpdate)
{
NetworkTransfer.DownloadFile(AvailableUpdate.UpdateURL.ToString(), Path.Combine(PathsManagement.ExecPath, "update.zip"));
SplashReport.ReportProgress(downloaded, 10);
}
else
{
SplashReport.ReportProgress(downloadManually, 10);
SplashReport.ReportProgress(AvailableUpdate.UpdateURL.ToString(), 10);
}
SplashReport.ReportProgress(downloadManually, 10);
SplashReport.ReportProgress(AvailableUpdate.UpdateURL.ToString(), 10);
}
else
{
SplashReport.ReportProgress(upToDate, 10);
}
}
else if (AvailableUpdate is null)
{
SplashReport.ReportProgressError(checkFailed);
}
#elif PACKAGEMANAGERBUILD
SplashReport.ReportProgressError(packageManagerError);
#else
SplashReport.ReportProgressWarning(devVersionWarning);
#endif
Expand Down
6 changes: 0 additions & 6 deletions public/Nitrocid/Resources/Settings/SettingsEntries.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,6 @@
"Type": "SBoolean",
"Variable": "CheckUpdateStart",
"Description": "Each startup, it will check for updates."
},
{
"Name": "Automatically download updates",
"Type": "SBoolean",
"Variable": "AutoDownloadUpdate",
"Description": "If there is any update, the kernel will automatically download it."
}
]
},
Expand Down

0 comments on commit c555cbc

Please sign in to comment.