Skip to content

[Simplify] librewolf.json: Consider adopting the addition folder approach for custom configs files #17712

@anxshi

Description

@anxshi

Is there a reason why librewolf.json is one of the only firefox-based browser manifest that didn't adopt the Addition dir approach?

"pre_install": [
"'LibreWolf-WinUpdater.exe', 'ScheduledTask-Create.ps1', 'ScheduledTask-Remove.ps1' | ForEach-Object { \"$dir/$_\" } | Remove-Item",
"",
"# Customizing LibreWolf Using AutoConfig",
"# https://support.mozilla.org/en-US/kb/customizing-firefox-using-autoconfig",
"$null = ensure \"$persist_dir/LibreWolf/defaults/pref\"",
"Copy-Item \"$persist_dir/LibreWolf/defaults/pref/*\" \"$dir/LibreWolf/defaults/pref\" -Exclude channel-prefs.js",
"Copy-Item \"$persist_dir/LibreWolf/*.js\", \"$persist_dir/LibreWolf/*.cfg\" \"$dir/LibreWolf\"",
"",
"# Customizing LibreWolf Using policies.json",
"# https://support.mozilla.org/en-US/kb/customizing-firefox-using-policiesjson",
"# Used to override the default policies.json of LibreWolf, if you want",
"$null = ensure \"$persist_dir/LibreWolf/distribution\"",
"Copy-Item \"$persist_dir/LibreWolf/distribution/policies.json\" \"$dir/LibreWolf/distribution\" -ErrorAction SilentlyContinue"
],
"bin": [
[
"LibreWolf-Portable.exe",
"librewolf"
]
],
"shortcuts": [
[
"LibreWolf-Portable.exe",
"LibreWolf"
]
],
"persist": "Profiles",
"pre_uninstall": [
"Copy-Item \"$dir/LibreWolf/defaults/pref/*\" \"$persist_dir/LibreWolf/defaults/pref\" -Exclude channel-prefs.js",
"Copy-Item \"$dir/LibreWolf/*.js\", \"$dir/LibreWolf/*.cfg\" \"$persist_dir/LibreWolf\" -Exclude librewolf.cfg"
],

Most of firefox-based scoop browsers use this:

"post_install": [
"firefox -CreateProfile \"Scoop $persist_dir\\profile\"",
"$Addition = \"$persist_dir\\addition\"",
"if (Test-Path $Addition) {",
" info 'Copying additional items...'",
" Copy-Item -Path $Addition\\* -Destination $dir -Force -Recurse -ErrorAction SilentlyContinue",
"}"
],
"bin": "firefox.exe",
"shortcuts": [
[
"firefox.exe",
"Firefox"
],
[
"firefox.exe",
"Firefox Profile Manager",
"-P"
]
],
"persist": [
"distribution",
"profile"
],

I came up with a mock up, and it should work out of the box:

    "pre_install": "'LibreWolf-WinUpdater.exe', 'ScheduledTask-Create.ps1', 'ScheduledTask-Remove.ps1' | ForEach-Object { \"$dir/$_\" } | Remove-Item",
    "post_install": [
        "$Addition = \"$persist_dir\\addition\"",
        "if (Test-Path $Addition) {",
        "  info 'Copying additional items...'",
        "  Copy-Item -Path $Addition\\* -Destination \"$dir\\LibreWolf\" -Force -Recurse -ErrorAction SilentlyContinue",
        "}"
    ],
    "bin": [
        [
            "LibreWolf-Portable.exe",
            "librewolf"
        ]
    ],
    "shortcuts": [
        [
            "LibreWolf-Portable.exe",
            "LibreWolf"
        ]
    ],
    "persist": [
        "LibreWolf\\distribution",
        "Profiles"
    ],

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions