forked from Isma/mods
1
0
Fork 0

Update manifest

This commit is contained in:
srgooglo 2023-11-02 23:31:41 +01:00
parent c549b34d6d
commit 834fcb95be
1 changed files with 10 additions and 6 deletions

View File

@ -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 }) => {