title: Error while opening a file by electron application on windows startup
body: <p>I have developed an electron app which is set to start on windows startup using <code>auto-launch</code> module. When the app starts, it reads a <code>db.json</code> file which acts as local db. The app works smoothly if application is started manually. But when the application is started automatically on windows startup, it shows the following error on the application log.</p>
  
  <blockquote>
    <p>constructor: 'Error',
      errno: -4048,
      syscall: 'open',
      code: 'EPERM',
      path: 'db.json',
      stack: "Error: EPERM: operation not permitted, open 'db.json'\n"</p>
  </blockquote>
  
  <p>The following is the code I used for accessing the <code>db.json</code> file.</p>
  
  <pre><code>if (process.env.NODE_ENV === 'development') {
    adapter = new FileSync('db.json')
  } else {
    adapter = new FileSync('db.json', {
      serialize: (data) =&gt; this._encrypt(data),
      deserialize: (data) =&gt; this._decrypt(data)
    });
  }
  </code></pre>
  
  <p>How can I resolve this error?</p>
  
  <p>Edit:</p>
  
  <p>I'm using electron builder for packaging. The following are the build settings in my <code>package.json</code>. </p>
  
  <pre><code>"nsis": {
    "oneClick": false,
    "allowToChangeInstallationDirectory": true,
    "perMachine": false
  }
  </code></pre>
  
  <p>I'm still confused about which options should I enable to avoid such permission errors.</p>