title: Electron: difference between process.defaultApp and app.isPackaged
body: <p>What is a the difference between <a href="https://electronjs.org/" rel="nofollow noreferrer">Electron</a> flags <a href="https://electronjs.org/docs/api/process#processdefaultapp" rel="nofollow noreferrer"><code>process.defaultApp</code></a> and <a href="https://electronjs.org/docs/api/app#appispackaged" rel="nofollow noreferrer"><code>app.isPackaged</code></a>? Both are used to distinguish dev and production environment. My observation is that <code>Boolean(process.defaultApp) == !app.isPackaged</code> always. <strong>Are there any cases, when both are <code>true</code> or both are <code>false</code>?</strong></p>
  
  <p>From doc and code:</p>
  
  <h3>process.defaultApp</h3>
  
  <p>A Boolean. When app is started by being passed as parameter to the default app, this property is true in the main process, otherwise it is undefined.</p>
  
  <h3>app.isPackaged</h3>
  
  <p>A Boolean property that returns true if the app is packaged, false otherwise. For many apps, this property can be used to distinguish development and production environments.</p>
  
  <p><a href="https://github.com/electron/electron/blob/db3cf52add2c88f99dc0b6c787ebbe801cc934c0/lib/browser/api/app.ts#L40" rel="nofollow noreferrer">From the code</a> - <code>app.isPackaged</code> is set when exec file is not <code>electron</code> or <code>electron.exe</code>.</p>
  
  <p>Note: I know a minor difference is that <code>process.defaultApp</code> may be used in the main process only.</p>