Desktop installer: release channel, saved choices, robust delete, logs
- Channel radio (Release / Master (Instabil)); master installs the rolling 'master' release from OmniNX/OmniNX-Master. Preselected from release_channel in the card's manifest.ini. - Variant, RAM (8gb) and Hekate-Pro choice are prefilled from the card (manifest.ini / config.ini) like the payload does, instead of silently switching users back to 4 GB / Standard. - Clear read-only attributes before deleting folders. - Remove leftover "OmniNX <Variant>" pack folders after installing. - Create empty folders from the pack. - Save every run's log to %LocalAppData%\OmniNX-Desktop-Installer\logs, plus a "Save log" button.
This commit is contained in:
1 parent
3e0d9c9950
commit
91133f7098
6 files changed
+207
-9
No files matched your search
@@ -91,6 +91,11 @@ public static class PathUtils
|
||||
if (!Directory.Exists(src))
|
||||
return;
|
||||
|
||||
// Folders first, so empty folders from the pack exist on the SD as well.
|
||||
Directory.CreateDirectory(dst);
|
||||
foreach (var dir in Directory.GetDirectories(src, "*", SearchOption.AllDirectories))
|
||||
Directory.CreateDirectory(Path.Combine(dst, Path.GetRelativePath(src, dir)));
|
||||
|
||||
var files = Directory.GetFiles(src, "*", SearchOption.AllDirectories);
|
||||
var total = files.Length;
|
||||
var current = 0;
|
||||
@@ -115,7 +120,19 @@ public static class PathUtils
|
||||
}
|
||||
|
||||
if (Directory.Exists(path))
|
||||
Directory.Delete(path, recursive: true);
|
||||
{
|
||||
// Directory.Delete fails on read-only entries (common on cards from other packs or macOS).
|
||||
var root = new DirectoryInfo(path);
|
||||
foreach (var entry in root.EnumerateFileSystemInfos("*", SearchOption.AllDirectories))
|
||||
{
|
||||
if (entry.Attributes.HasFlag(FileAttributes.ReadOnly))
|
||||
entry.Attributes &= ~FileAttributes.ReadOnly;
|
||||
}
|
||||
if (root.Attributes.HasFlag(FileAttributes.ReadOnly))
|
||||
root.Attributes &= ~FileAttributes.ReadOnly;
|
||||
|
||||
root.Delete(recursive: true);
|
||||
}
|
||||
}
|
||||
|
||||
public static int CountItemsRecursive(string path)
|
||||
|
||||
Reference in new issue
Block a user