{"action":"created","issue":{"url":"https://api.github.com/repos/atom/electron/issues/2415","labels_url":"https://api.github.com/repos/atom/electron/issues/2415/labels{/name}","comments_url":"https://api.github.com/repos/atom/electron/issues/2415/comments","events_url":"https://api.github.com/repos/atom/electron/issues/2415/events","html_url":"https://github.com/atom/electron/issues/2415","id":98995470,"number":2415,"title":"Multiple \"apps\"","user":{"login":"arthurakay","id":401229,"avatar_url":"https://avatars.githubusercontent.com/u/401229?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurakay","html_url":"https://github.com/arthurakay","followers_url":"https://api.github.com/users/arthurakay/followers","following_url":"https://api.github.com/users/arthurakay/following{/other_user}","gists_url":"https://api.github.com/users/arthurakay/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurakay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurakay/subscriptions","organizations_url":"https://api.github.com/users/arthurakay/orgs","repos_url":"https://api.github.com/users/arthurakay/repos","events_url":"https://api.github.com/users/arthurakay/events{/privacy}","received_events_url":"https://api.github.com/users/arthurakay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-04T15:24:50Z","updated_at":"2015-08-04T17:55:31Z","closed_at":null,"body":"I have a feeling the answer to my question is \"no\", but I'm going to ask anyways in hopes that this might be considered for a feature (if I can't already do it).\r\n\r\nPer docs on [Application Distribution](https://github.com/atom/electron/blob/master/docs/tutorial/application-distribution.md), we are advised to \"name the folder of your app as app, and put it under Electron's resources directory\" (e.g. `Electron.app/Contents/Resources/app/` or `app.asar`).\r\n\r\nI suppose that works for 99% of use cases -- and it works great. However I am beginning to explore the idea of using Electron as a container/shell for distributing multiple \"apps\", with the general idea being that our users would download our company-branded Electron container (i.e. `Electron.app`) but be able to choose from a list of \"apps\" (i.e. `app1.asar`, `app2.asar`, etc). \r\n\r\nIs that possible? Or if not, can it be?\r\n\r\n-----\r\n\r\n_Why would I even want to do this?_\r\n\r\nIf my company has multiple applications to distribute to users, we don't necessarily want to ask them to download multiple things -- plus it wastes space, and keeping users on the latest version of _each_ app becomes a nightmare. Having multiple apps, accessible from the same Electron runtime as individual child processes seems like the ideal solution.\r\n\r\n_Can't you just ship your \"apps\" inside the same \"app.asar\"?_\r\n\r\nTechnically, yes we could. But again, long-term maintenance becomes a nightmare. If each \"app\" has its own delivery schedule, development team, etc then clearly having separate folders/asars has its advantages. Furthermore, the concept of auto-updating individual apps becomes far easier.\r\n\r\n-----\r\n\r\nCan anyone chime in with thoughts or comments about attempting something like this? I get the feeling that the `/app/` (and `/app.asar`) folder is hard-coded as the only way to do things."},"comment":{"url":"https://api.github.com/repos/atom/electron/issues/comments/127692155","html_url":"https://github.com/atom/electron/issues/2415#issuecomment-127692155","issue_url":"https://api.github.com/repos/atom/electron/issues/2415","id":127692155,"user":{"login":"arthurakay","id":401229,"avatar_url":"https://avatars.githubusercontent.com/u/401229?v=3","gravatar_id":"","url":"https://api.github.com/users/arthurakay","html_url":"https://github.com/arthurakay","followers_url":"https://api.github.com/users/arthurakay/followers","following_url":"https://api.github.com/users/arthurakay/following{/other_user}","gists_url":"https://api.github.com/users/arthurakay/gists{/gist_id}","starred_url":"https://api.github.com/users/arthurakay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arthurakay/subscriptions","organizations_url":"https://api.github.com/users/arthurakay/orgs","repos_url":"https://api.github.com/users/arthurakay/repos","events_url":"https://api.github.com/users/arthurakay/events{/privacy}","received_events_url":"https://api.github.com/users/arthurakay/received_events","type":"User","site_admin":false},"created_at":"2015-08-04T17:55:31Z","updated_at":"2015-08-04T17:55:31Z","body":"@etiktin That is incredibly helpful, I didn't realize some of this infrastructure already existed! I guess I have three follow-up questions at this point:\r\n\r\n(1) `app.setAppPath(packagePath);` implies that Electron can only ever have one of these sub-apps open at a time. Is that accurate? Users should expect that they can open any of the apps in the list simultaneously, so I just want to be sure that scenario \"just works\" with this approach. (Each app would launch in its own `BrowserWindow`).\r\n\r\n(2) The code I see in `main.js` uses a `packagePath` to a folder containing the \"app\" assets. If I were attempting to distribute my \"apps\" using the `.asar` archive format, is that just magically readable at runtime?\r\n\r\n(3) In the following code from `main.js`:\r\n\r\n    // Run the app.\r\n    require('module')._load(packagePath, module, true);\r\n\r\nWhere is the `module` module defined? I'm just generally curious how that works, where the second parameter \"module\" comes from, and what else this might do.\r\n\r\nThanks again for the idea!"}}