rocksdanister/lively · warning · InvalidOperationException

i18n.GetString("LivelyExceptionNotLivelyZip")

Error message

i18n.GetString("LivelyExceptionNotLivelyZip")

What it means

Thrown by LibraryViewModel.AddWallpaperFile in a different non-package else branch — same intent as error 11 (file is not a valid lively package) but using the localized string LivelyExceptionNotLivelyZip. Fires on a content-check failure where the extension path took a different branch.

Source

Thrown at src/Lively/Lively.UI.Shared/ViewModels/LibraryViewModel.cs:586

                        // We do not autoSetWallpaper for .zip
                        return AddWallpaper(installDir);
                    }
                    catch (Exception)
                    {
                        try
                        {
                            Directory.Delete(installDir, true);
                        }
                        catch { /* Nothing to do */ }
                    }
                    finally
                    {
                        semaphoreSlimInstallLock.Release();
                    }
                }
                else
                {
                    throw new InvalidOperationException(i18n.GetString("LivelyExceptionNotLivelyZip"));
                }
            }
            else if (FileTypes.GetFileType(filePath) is not (WallpaperType)(-1) and var fileType)
            {
                if (mediaFormatConverter.RequiresConversion(filePath, out var newExt))
                {
                    if (!await dialogService.ShowConfirmationDialogAsync($"{i18n.GetString("DescriptionConfirmFileConvertion/Text")}"))
                        return null;

                    var fileName = Path.GetFileNameWithoutExtension(filePath) + newExt;
                    var outPath = Path.Combine(Constants.CommonPaths.TempDir, fileName);

                    if (!await mediaFormatConverter.TryConvertAsync(filePath, outPath))
                        return null;

                    filePath = outPath;
                    fileType = FileTypes.GetFileType(filePath);
                }

View on GitHub (pinned to c1036feb66)

Solutions

  1. Use a known-good lively package file.
  2. Pre-screen dropped files with FileTypes.IsWallpaperPackage and show a friendly localized error before invoking AddWallpaperFile.
  3. If you control packaging, ensure CreateWallpaperPackage writes the marker/manifest the validator expects.

Example fix

// before
throw new InvalidOperationException(i18n.GetString("LivelyExceptionNotLivelyZip"));

// after — guard earlier and give the user a recovery path
if (!FileTypes.IsWallpaperPackage(filePath))
{
    await dialogService.ShowMessageAsync(i18n.GetString("LivelyExceptionNotLivelyZip"));
    return null;
}
Defensive patterns

Strategy: validation

Validate before calling

if (FileTypes.IsWallpaperPackageExtension(filePath) && !FileTypes.IsWallpaperPackage(filePath))
{
    await dialogService.ShowMessageAsync(i18n.GetString("LivelyExceptionNotLivelyZip"));
    return;
}

Type guard

static bool IsAddablePackage(string filePath)
    => FileTypes.IsWallpaperPackageExtension(filePath) && FileTypes.IsWallpaperPackage(filePath);

Try / catch

try { await libraryViewModel.AddWallpaperFile(filePath, autoSetWallpaper); }
catch (InvalidOperationException) { ShowError(i18n.GetString("LivelyExceptionNotLivelyZip")); }

Prevention

When it happens

Trigger: AddWallpaperFile on a file whose extension suggested a package but the package-content check fails (IsWallpaperPackage false), landing in this else branch.

Common situations: Same as error 11: mis-named archives, repackaged/incomplete lively packages, third-party zips with the wrong extension.

Related errors


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