Giter Site home page Giter Site logo

Comments (7)

mmaietta avatar mmaietta commented on August 23, 2024 1

Let me know if the above ☝️ works for you and I can pull out a common helper function for fetching icons from the packager for all platforms

from electron-builder.

Covkie avatar Covkie commented on August 23, 2024 1

alr its working and generating the .icon-set

from electron-builder.

mmaietta avatar mmaietta commented on August 23, 2024

I took a quick look at the code and it looks like the linux packages execute https://github.com/develar/app-builder with a path to the icon-set. The icon-set itself is also generated by app-builder.

Out of curiosity, where would the icon-set go in the unpacked step? I'm not familiar with vesktop/-git or AUR.

from electron-builder.

Covkie avatar Covkie commented on August 23, 2024

Ideally the icon-set would just be in the unpacked folder and packagers can deal with it from there.

from electron-builder.

mmaietta avatar mmaietta commented on August 23, 2024

If I'm understanding correctly, I think the afterPack could work nicely for you in this case. That or another one of the available hooks. This copies what the linux target is doing under-the-hood when calculating the desktop entries.

    async afterPack(context: AfterPackContext) {
        const packager = context.packager
        const { platformSpecificBuildOptions, config } = packager
    
        const sources = [platformSpecificBuildOptions.icon, config.mac?.icon ?? config.icon].filter(str => !!str) as string[]
    
        // If no explicit sources are defined, fallback to buildResources directory, then default framework icon
        let fallbackSources = [packager.getDefaultFrameworkIcon()!]
        const buildResources = config.directories?.buildResources
        if (buildResources && existsSync(join(buildResources, "icons"))) {
          fallbackSources = [buildResources, ...fallbackSources]
        }
    
        const result = await packager.resolveIcon(sources, fallbackSources, "set")

        // do something with result. output is in config.directories.output dir
    },

from electron-builder.

Covkie avatar Covkie commented on August 23, 2024

I've finally gotten around to attempting your suggestion but I do not know what you want me to do with the provided snippet

from electron-builder.

mmaietta avatar mmaietta commented on August 23, 2024

It's an afterPack hook. You can either add it to an electron-builder js config file directly, or save it to a js script that you then set the path to from project root.
https://www.electron.build/configuration/configuration#afterpack

from electron-builder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.