Remove unused legacy appimage code

This commit is contained in:
Caelan
2024-09-22 10:39:19 -06:00
parent b710fb96db
commit 75dd6973d6

View File

@@ -85,54 +85,4 @@ public class AppImageTool
Utility.DeleteFileOrDirectoryHard(tmpTarFile);
}
}
public static void CreateLinuxAppImageOld(string appDir, string outputFile, RuntimeCpu machine, ILogger logger)
{
string runtime = machine switch {
RuntimeCpu.x86 => HelperFile.AppImageRuntimeX86,
RuntimeCpu.x64 => HelperFile.AppImageRuntimeX64,
RuntimeCpu.arm64 => HelperFile.AppImageRuntimeArm64,
_ => throw new ArgumentOutOfRangeException(nameof(machine), machine, null)
};
string tool = HelperFile.GetMkSquashFsPath();
List<string> args = new();
string tmpPath = outputFile + ".tmpfs";
if (VelopackRuntimeInfo.IsWindows) {
args.Add("--all-root");
args.Add("--pack-dir");
args.Add(appDir);
args.Add(tmpPath);
} else {
args.Add(appDir);
args.Add(tmpPath);
args.Add("-comp");
args.Add("xz");
args.Add("-root-owned");
args.Add("-noappend");
args.Add("-Xdict-size");
args.Add("100%");
args.Add("-b");
args.Add("16384");
args.Add("-mkfs-time");
args.Add("0");
}
try {
logger.Info("Compressing AppDir into squashfs filesystem");
Exe.InvokeAndThrowIfNonZero(tool, args, null);
logger.Info($"Creating AppImage with {Path.GetFileName(runtime)} runtime");
File.Copy(runtime, outputFile, true);
using var outputfs = File.Open(outputFile, FileMode.Append);
using var squashfs = File.OpenRead(tmpPath);
squashfs.CopyTo(outputfs);
Chmod.ChmodFileAsExecutable(outputFile);
} finally {
Utility.DeleteFileOrDirectoryHard(tmpPath);
}
}
}