From 834fcb95be3edd1b9d1edc13b148c1da3310a65c Mon Sep 17 00:00:00 2001 From: srgooglo Date: Thu, 2 Nov 2023 23:31:41 +0100 Subject: [PATCH] Update manifest --- manifest | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/manifest b/manifest index b65061f..1d31764 100644 --- a/manifest +++ b/manifest @@ -150,7 +150,7 @@ module.exports = { const minecraftGameFolder = resolveMcPath() - const legacyLauncherProfiles = path.resolve(minecraftGameFolder, "launcher_profiles.json") + const legacyLauncherProfilesPath = path.resolve(minecraftGameFolder, "launcher_profiles.json") const profilesFilePath = path.resolve(pack_dir, "launcher_profiles.json") let profiles_json = { @@ -171,6 +171,8 @@ module.exports = { profiles: {}, } + let legacy_profiles_json = fs.readFileSync(legacyLauncherProfilesPath, "utf8") + const profileData = { name: manifest.pack_name, gameDir: pack_dir, @@ -182,19 +184,21 @@ module.exports = { icon: await readImageToB64(`${pack_dir}/icon/mc.png`), } - legacyLauncherProfiles.profiles[manifest.id] = profileData + legacy_profiles_json.profiles[manifest.id] = profileData profiles_json.profiles[manifest.id] = profileData fs.writeFileSync(profilesFilePath, JSON.stringify(profiles_json, null, 2)) + fs.writeFileSync(legacyLauncherProfilesPath, legacy_profiles_json) if (os.type() === "Windows_NT") { const runwinBat = path.resolve(pack_dir, "runwin.bat") + fs.writeFileSync(runwinBat, ` -@echo off -cd "%ProgramFiles(x86)%/Minecraft Launcher" -start MinecraftLauncher.exe --workDir "${pack_dir}" -`, { encoding: 'utf8' }) + @echo off + cd "%ProgramFiles(x86)%/Minecraft Launcher" + start MinecraftLauncher.exe --workDir "${pack_dir}" + `, { encoding: 'utf8' }) } }, uninstall: async ({ manifest, pack_dir, tmp_dir, spinner }) => {