Update manifest
This commit is contained in:
parent
c549b34d6d
commit
834fcb95be
16
manifest
16
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 }) => {
|
||||
|
|
Loading…
Reference in New Issue