public File getInstalledDirectory() {
        if (installedPack == null)
            return null;

        if (installedDirectory == null) {
            String rawDir = installedPack.getDirectory();

            if (rawDir != null && rawDir.startsWith(InstalledPack.LAUNCHER_DIR)) {
                rawDir = new File(directories.getLauncherDirectory(), rawDir.substring(InstalledPack.LAUNCHER_DIR.length())).getAbsolutePath();
            }
            if (rawDir != null && rawDir.startsWith(InstalledPack.MODPACKS_DIR)) {
                rawDir = new File(directories.getModpacksDirectory(), rawDir.substring(InstalledPack.MODPACKS_DIR.length())).getAbsolutePath();
            }

            setInstalledDirectory(new File(rawDir));
        }

        return installedDirectory;
    }