// @see https://www.electron.build/configuration/configuration
{
    "$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json",
    "appId": "IP",
    "publish": {
        "provider": "generic",
        "url": "https://xiazaigengxin-1417293730.cos.ap-guangzhou.myqcloud.com/updates"
    },
    "asar": true,
    "asarUnpack": [
        "scripts/**/*"
    ],
    "npmRebuild": true,
    "productName": "天英超级IP智能体",
    "directories": {
        "output": "dist-release-final",
        "buildResources": "electron/resources/build"
    },
    "afterPack": "./scripts/build_optimize.cjs",
    "files": [
        "dist",
        "dist-electron",
        "node_modules",
        {
            "from": "demo",
            "to": "demo",
            "filter": [
                "*.md",
                "*.html"
            ]
        },
        "scripts"
    ],
    "win": {
        icon: "electron/resources/build/logo.ico",
        "target": [
            {
                "target": "nsis",
                "arch": [
                    "x64"
                ]
            }
        ],
        "artifactName": "${productName}-${version}-win-${arch}.${ext}",
        "extraResources": [
            {
                "from": "electron/resources/extra",
                "to": "extra",
                "filter": [
                    "common/config/**/*",
                    "common/default-config.json",
                    "common/resource-manifest.json",
                    "common/cover-templates/**/*",
                    "common/shuiziren/**/*",
                    "common/soundEffects/**/*",
                    "win-x86/**/*",
                    "win-x86-backup/**/*"
                ]
            },
            {
                "from": "electron/resources/extra/common/playwright",
                "to": "resources-bundles/playwright"
            },
            {
                "from": "electron/resources/extra/common/python",
                "to": "resources-bundles/python-runtime"
            },
            {
                "from": "electron/resources/extra/win-x86",
                "to": "resources-bundles/ffmpeg"
            },
            {
                "from": "electron/resources/extra/common/soundEffects",
                "to": "resources-bundles/soundEffects"
            },
            {
                "from": "electron/resources/extra/common/models",
                "to": "resources-bundles/models"
            },
            {
                "from": "electron/resources/extra/common/fonts",
                "to": "resources-bundles/fonts"
            },
            {
                "from": "ziti",
                "to": "resources-bundles/ziti"
            },
            {
                "from": "bgm",
                "to": "resources-bundles/bgm"
            },
            {
                "from": "electron/resources/voice-preview-cache",
                "to": "voice-preview-cache"
            },
            {
                "from": "electron/resources/build",
                "to": "build",
                "filter": [
                    "tray.png",
                    "tray.ico",
                    "logo.png",
                    "logo.ico",
                    "vc_redist.x64.exe"
                ]
            }
        ]
    },
    "nsis": {
        "artifactName": "${productName}-${version}-win-setup-${arch}.${ext}",
        "shortcutName": "${productName}",
        "uninstallDisplayName": "${productName}",
        "oneClick": false,
        "perMachine": false,
        "allowToChangeInstallationDirectory": true,
        "deleteAppDataOnUninstall": false,
        "differentialPackage": true,
        "include": "scripts/installer.nsh",
        "warningsAsErrors": false,
        "runAfterFinish": true,
        "allowElevation": true,
        "installerIcon": "electron/resources/build/logo.ico",
        "uninstallerIcon": "electron/resources/build/logo.ico",
        "installerHeaderIcon": "electron/resources/build/logo.ico"
    },
    "appx": {
        "identityName": "IP",
        "publisher": "CN=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX",
        "publisherDisplayName": "天英超级IP智能体",
        "languages": [
            "zh-CN",
            "en-US",
            "zh-TW"
        ]
    },
    "mac": {
        "icon": "logo.icns",
        "target": [
            {
                "target": "dir",
                "arch": [
                    "x64",
                    "arm64"
                ]
            }
        ],
        "artifactName": "${productName}-${version}-mac-${arch}.${ext}",
        "extraResources": [
            {
                "from": "electron/resources/extra",
                "to": "extra",
                "filter": [
                    "common",
                    "osx"
                ]
            },
            {
                "from": "electron/resources/voice-preview-cache",
                "to": "voice-preview-cache"
            }
        ],
        "x64ArchFiles": "Contents/Resources/extra/**/*",
        "entitlementsInherit": "./entitlements.mac.plist",
        "entitlements": "./entitlements.mac.plist",
        "extendInfo": {
            "NSDocumentsFolderUsageDescription": "Application requests access to the user's Documents folder.",
            "NSDownloadsFolderUsageDescription": "Application requests access to the user's Downloads folder."
        },
        "type": "development",
        "notarize": false,
        "darkModeSupport": false,
        "hardenedRuntime": true,
        "identity": "Xi'an Yanyi Information Technology Co., Ltd (Q96H3H33RK)"
    },
    "linux": {
        "icon": "logo.icns",
        "desktop": "logo",
        "maintainer": "天英超级IP智能体",
        "category": "Utility",
        "target": [
            {
                "target": "AppImage",
                "arch": [
                    "x64",
                    "arm64"
                ]
            },
            {
                "target": "deb",
                "arch": [
                    "x64",
                    "arm64"
                ]
            }
        ],
        "artifactName": "${productName}-${version}-linux-${arch}.${ext}",
        "extraResources": [
            {
                "from": "electron/resources/extra",
                "to": "extra",
                "filter": [
                    "common",
                    "linux"
                ]
            },
            {
                "from": "electron/resources/voice-preview-cache",
                "to": "voice-preview-cache"
            }
        ]
    },
    "afterSign": "./scripts/notarize.cjs"
}
