rocksdanister/lively · error · Exception

LivelyInfo.json not found

Error message

LivelyInfo.json not found

What it means

Thrown by ZipExtractFile when isLivelyFile is true and the archive has no top-level 'LivelyInfo.json' entry (zf.FindEntry returns -1). It is the archive-level equivalent of error 0: the zip is not a valid lively wallpaper package. Note it throws the base System.Exception, which weakens catchability.

Source

Thrown at src/Lively/Lively.Common/Helpers/Archive/ZipExtract.cs:30

{
    public static class ZipExtract
    {

        /// <summary>
        /// Extract zip file to given output directory.
        /// </summary>
        /// <param name="archivePath">Source .zip path.</param>
        /// <param name="outFolder">Destination directory.</param>
        /// <param name="isLivelyFile">Verify whether the archive is lively wallpaper format, throws Exception if not.</param>
        public static void ZipExtractFile(string archivePath, string outFolder, bool isLivelyFile)
        {
            using (Stream fsInput = File.OpenRead(archivePath))
            using (var zf = new ZipFile(fsInput))
            {

                if (isLivelyFile && zf.FindEntry("LivelyInfo.json", true) == -1)
                {
                    throw new Exception("LivelyInfo.json not found");
                }

                //long i = 0;
                foreach (ZipEntry zipEntry in zf)
                {
                    //progress
                    //float percentage = (float)++i / zf.Count;
                    //Debug.WriteLine(percentage + " " + zipEntry.Name);

                    if (!zipEntry.IsFile)
                    {
                        // Ignore directories
                        continue;
                    }

                    String entryFileName = zipEntry.Name;
                    // to remove the folder from the entry:
                    //entryFileName = Path.GetFileName(entryFileName);

View on GitHub (pinned to c1036feb66)

Solutions

  1. Confirm the archive genuinely is a lively package (root-level LivelyInfo.json); open it and inspect entries.
  2. Re-download or re-export the wallpaper package from the source that produced it.
  3. If maintaining the lib, throw a typed exception (e.g. InvalidDataException) so callers can branch instead of catching Exception.

Example fix

// before
if (isLivelyFile && zf.FindEntry("LivelyInfo.json", true) == -1)
    throw new Exception("LivelyInfo.json not found");

// after
if (isLivelyFile && zf.FindEntry("LivelyInfo.json", true) == -1)
    throw new InvalidDataException("Archive is not a lively wallpaper package: missing LivelyInfo.json");
Defensive patterns

Strategy: validation

Validate before calling

bool IsLivelyArchive(string archivePath)
{
    using var fs = File.OpenRead(archivePath);
    using var zf = new ZipFile(fs);
    return zf.FindEntry("LivelyInfo.json", true) != -1;
}
// call before ZipExtractFile(..., isLivelyFile: true)

Type guard

static bool IsLivelyZip(string archivePath)
{
    try
    {
        using var fs = File.OpenRead(archivePath);
        using var zf = new ZipFile(fs);
        return zf.FindEntry("LivelyInfo.json", true) != -1;
    }
    catch { return false; }
}

Try / catch

try { ZipExtractFile(path, out, isLivelyFile: true); }
catch (Exception ex) when (ex.Message.Contains("LivelyInfo.json not found"))
{ /* report invalid package to user */ }

Prevention

When it happens

Trigger: ZipExtractFile(archivePath, outFolder, isLivelyFile: true) on a .zip/.lwzip that is missing the LivelyInfo.json entry — e.g. a plain wallpaper zip, a repackaged archive that dropped the manifest, or a corrupt/partial zip.

Common situations: User drags in an arbitrary .zip that just happens to share the package extension; archive re-compressed externally and manifest moved into a subfolder (FindEntry expects it at root); truncated download.

Related errors


AI-assisted analysis of rocksdanister/lively@c1036feb66 (2026-08-13). Data as JSON: /api/errors/dff00134006066a8. Report an issue: GitHub.