Files
edubox/agent/installer/setup-wizard/InstallerState.cs
EduBox Dev fc61404271 feat: installation offline complete, HTTPS registry, 8Go WSL, v0.3.18
- Wizard: installation 100% offline (WSL bundle, Podman MSI, machine image, docker-compose)
- Wizard: suppression de wsl --install --no-distribution
- Wizard: .wslconfig avec 8Go RAM / 4 CPU
- Wizard: operations asynchrones pour eviter le freeze UI
- Wizard: detection automatique de podman.exe
- Wizard: version 0.1.1
- Agent: passage en v0.3.18
- Serveur: registry PrestaShop en HTTPS via gitea.alfrednobel.edudeploy.com
- Caddy: config gitea.alfrednobel.edudeploy.com
- Docs: mise a jour SUIVI_INSTALLER.md, README.md, seed.ts
2026-07-02 22:52:28 +00:00

91 lines
2.2 KiB
C#

using System.Text.Json;
using System.Text.Json.Serialization;
namespace StudioE5.SetupWizard;
public enum WizardStep
{
Welcome,
Prerequisites,
InstallVirtualEnvironment,
RestartRequired,
InstallPodman,
ConfigurePodman,
InstallAgent,
Finished,
Uninstall
}
public class InstallerState
{
[JsonPropertyName("step")]
public WizardStep Step { get; set; } = WizardStep.Welcome;
[JsonPropertyName("virtualEnvironmentInstalled")]
public bool VirtualEnvironmentInstalled { get; set; }
[JsonPropertyName("wslFeaturesEnabled")]
public bool WslFeaturesEnabled { get; set; }
[JsonPropertyName("wslPackageInstalled")]
public bool WslPackageInstalled { get; set; }
[JsonPropertyName("wslDefaultVersionSet")]
public bool WslDefaultVersionSet { get; set; }
[JsonPropertyName("wslKernelUpdated")]
public bool WslKernelUpdated { get; set; }
[JsonPropertyName("podmanInstalled")]
public bool PodmanInstalled { get; set; }
[JsonPropertyName("podmanConfigured")]
public bool PodmanConfigured { get; set; }
[JsonPropertyName("agentInstalled")]
public bool AgentInstalled { get; set; }
private static string StateFilePath
{
get
{
var dir = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
"studioE5",
"installer");
Directory.CreateDirectory(dir);
return Path.Combine(dir, "installer-state.json");
}
}
public static InstallerState Load()
{
var path = StateFilePath;
if (!File.Exists(path))
return new InstallerState();
try
{
var json = File.ReadAllText(path);
return JsonSerializer.Deserialize<InstallerState>(json) ?? new InstallerState();
}
catch
{
return new InstallerState();
}
}
public void Save()
{
var json = JsonSerializer.Serialize(this, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText(StateFilePath, json);
}
public static void Delete()
{
var path = StateFilePath;
if (File.Exists(path))
File.Delete(path);
}
}