Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to write to info.plist or custom info.plist for OSX #136

Closed
buddingmonkey opened this issue Sep 17, 2015 · 11 comments
Closed

Ability to write to info.plist or custom info.plist for OSX #136

buddingmonkey opened this issue Sep 17, 2015 · 11 comments
Labels
build-target:mac 🍎 Bundling an Electron app specifically for macOS enhancement Feature request

Comments

@buddingmonkey
Copy link

The packager should be able to allow us to specify parameters (e.g. file extensions and protocols) or allow us to provide a custom info.plist so we can have tighter integration with the OS.

@malept malept added enhancement Feature request help wanted Needs a contributor from the community labels Sep 18, 2015
@herrmannplatz
Copy link
Contributor

I also had to add other properties than the ones that electron packager provides and ended up forking electron-packager to add options. But this doesn't scale.

I kind of like the idea of specifying a custom plist, since it gives you the best control of what to add, without having to change the packager for every property. So instead of creating the plist on the fly, you would just copy this into the app folder.

@dylang
Copy link

dylang commented Sep 24, 2015

what about an optional handler that would pass the info.plist generated by electron-packager as a javascript object which we can modify and pass back?

psedocode:

packager({
...
plist: function(plist) {
  plist.CFBundleURLTypes = [{
    CFBundleURLName: 'OpenHelper',
    CFBundleURLSchemes: [ 'custom' ]
  }];
  return plist;
}
...
}, cb);

Note: I don't know enough about info.plist to know if it can easily be expressed as a javascript object and then translated back to xml.

@max-mapper
Copy link
Contributor

@dylang my general feedback on the idea is that this sounds like something that should be solved outside of this module first, and we can support an API for doing this that someone else can maintain :)

@dylang
Copy link

dylang commented Sep 25, 2015

@maxogden Do you mean like plist? I didn't realize you were already using it. I should have looked, very nice. It looks like it's making managing the plist much easier.

Or do you mean a module with an api specific to the available info.plist parameters? That seems like a lot more work, definitely a separate module, but a nice-to-have for the original purpose of this issue.

@max-mapper
Copy link
Contributor

@dylang ah sorry, I was talking about the latter part -- the specific info.plist configuration stuff

@dylang
Copy link

dylang commented Sep 26, 2015

@buddingmonkey @herrmannplatz I just realized the feature I wanted, protocols (custom url handlers) already exists, it's just not yet documented (and possibly not officially supported):

https://github.com/maxogden/electron-packager/blob/master/mac.js#L62-#L69

Example usage:

packager({
    ....
    protocols: [{
        name: 'Some Name',
        schemes: ['foo']  //foo://google.com will launch your app
    }]
), cb);

Hope that might help unblock you.

@malept
Copy link
Member

malept commented Sep 26, 2015

Re: protocols documentation, there is an issue at #121.

@buddingmonkey
Copy link
Author

@dylang Protocols are a good start, but also file handlers would be nice. Even if we can't use a custom info.plist file, maybe we could specify additional parameters. This would allow for generic additions to the plist.

@dvcrn
Copy link

dvcrn commented Nov 11, 2015

I think the custom info.plist parameters are definitely a good start. It would cover future changes to properties (including new properties) on apples side without having to change electron-packager.

https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html

@malept malept added the build-target:mac 🍎 Bundling an Electron app specifically for macOS label Dec 20, 2015
@erkyrath
Copy link

erkyrath commented Feb 6, 2016

See #253

@malept
Copy link
Member

malept commented Mar 8, 2016

Since #253 has been merged, I'm closing this issue.

@malept malept closed this as completed Mar 8, 2016
@malept malept removed the help wanted Needs a contributor from the community label Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-target:mac 🍎 Bundling an Electron app specifically for macOS enhancement Feature request
Projects
None yet
Development

No branches or pull requests

7 participants