namespace WiiCompiled.Setup.Windows;
///
/// Names of the installed/staged layout. Not cosmetic: payload and toolkit identities hash relative paths
/// that begin with these strings, so changing one (including casing) invalidates every shipped fingerprint.
/// Build-Installer.ps1 stages the payload with exactly these names.
///
internal static class InstalledLayout
{
public const string ToolkitDirectoryName = "Toolkit";
public const string WorkspaceDirectoryName = "BuildWorkspace";
public const string InstallStateFileName = "install-state.json";
public const string PayloadManifestFileName = "payload-manifest.json";
/// Payload entry names use forward slashes; the archive is written by tar.
public const string ToolkitEntryPrefix = ToolkitDirectoryName + "/";
public const string WorkspaceEntryPrefix = WorkspaceDirectoryName + "/";
public static string Toolkit(string root) => Path.Combine(root, ToolkitDirectoryName);
public static string Workspace(string root) => Path.Combine(root, WorkspaceDirectoryName);
///
/// The pinned offline dependency sources shipped under BuildWorkspace\Dependencies. This
/// is the one list: Build-Installer.ps1 stages exactly these directories and
/// Launcher/Test-PinnedFacts.ps1 fails the release build if its copy and this one disagree.
///
public static readonly string[] DependencyNames =
[
"abseil-cpp", "cppwinrt", "dawn_prebuilt", "fmt", "freetype", "imgui", "libusb", "native_prebuilt",
"png", "SDL", "sqlite3", "tracy", "xxhash", "zlib", "zstd"
];
}
///
/// Source-owned files copied verbatim beside every product. One inventory drives identity
/// (), verification, and publication. Renaming
/// an identity key below requires bumping the fingerprint's version salt.
///
internal static class ProductRuntimeAssets
{
/// The bootstrap tree, copied from runtime/assets/wii into every product.
public const string SourceBootstrapDirectoryName = "wii";
public const string ProductBootstrapDirectoryName = "wii_bootstrap";
/// Single files, given as their path below runtime/assets and their product name.
public static readonly (string[] SourceRelativePath, string ProductFileName)[] Files =
[
(["dsp", "dsp_coef.bin"], "dsp_coef.bin"),
(["pipeline", "initial_pipeline_cache.db"], "initial_pipeline_cache.db")
];
public static string SourceFile(string sourceAssets, string[] relativePath) =>
Path.Combine([sourceAssets, .. relativePath]);
}