title: Why electron app is not able to find correct path to a R file when packaged with asar flag?
body: <p>I'm trying to call R from JS in an electron app, which console logs the R version and pwd. It works perfectly when packaged without the asar flag using both electron-builder and electron-packager (see the following screenshot)
  <a href="https://i.stack.imgur.com/ZfyXz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZfyXz.png" alt="enter image description here" /></a></p>
  <p>However, when I build using asar <code>yarn run build --asar</code>, I do not get the expected output (See the following screenshot)
  <a href="https://i.stack.imgur.com/nJDGu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nJDGu.png" alt="enter image description here" /></a>
  The main problem is that the app is not getting correct path to the R file (see the following screenshot).</p>
  <p><a href="https://i.stack.imgur.com/Djgl6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Djgl6.png" alt="enter image description here" /></a></p>
  <p>Although, I have constructed the file path dynamically using <code>path</code>.</p>
  <p><strong>To reproduce the bug</strong></p>
  <ol>
  <li>in windows 10, download the source code from this <a href="ftp://ftp.lrz.de/transfer/crash_asar/" rel="nofollow noreferrer">ftp link</a></li>
  <li>assuming you have vscode, node.js installed already, in vscode terminal from the <em>ImShot_App_minimal</em> folder run <code>yarn install</code></li>
  <li>then run <code>yarn run build --asar</code></li>
  <li>run the <code>imshot-minimal-win32-x64\imshot-minimal.exe</code> and in the console log check the path to the R file</li>
  <li>to get the expected result run step 4 but without --asar flag</li>
  </ol>
  <p>What is the reason for getting wrong path? and how to fix this?</p>
  <p>thanks</p>