title: I cannot set my Electron windows sizes using variables
body: <p>I'm trying to read the height and width data from config.ini file for set them for <code>BrowserWindow</code>. But even though I check the variables if they are correct my Electron window sets it to 800x600. Here is my code:</p>
  <pre class="lang-js prettyprint-override"><code>app.on(&quot;ready&quot;, () =&gt; {
      //Reading the config.ini file
      //config.ini file uses in main process, preferences.json uses in renderer process
      function readConfig(callback) {
          fs.readFile('./config.ini', 'utf-8', function(err, data) {
              if (err) data = undefined;
              callback(data);
          });
      }
  
      //I use callback because I wanted to be sure file be readen before initilazing the window.
      readConfig(function(data) {
          if (data !== undefined &amp;&amp; data !== null) {
              let config = ini.parse(data);
              windowH = config.height;
              windowW = config.width;
          }
          startApp(windowW, windowH);
      });
  });
  </code></pre>
  <p>startApp() function:</p>
  <pre class="lang-js prettyprint-override"><code>function startApp(w,h) {
      //Electron Window
      mainWindow = new BrowserWindow({
          frame: false,
          width: w,
          height: h,
          minWidth: 800,
          minHeight: 600,
          backgroundColor: '#1f2646',
          icon: __dirname + '/icon.ico',
          webPreferences: {
              nodeIntegration: true,
              devTools: process.env.NODE_ENV === &quot;development&quot;,
              enableRemoteModule: true
          }
      });
  
      console.log(mainWindow.getSize()); //Prints [800, 600]
      console.log(&quot;Width:&quot;+w.toString()); //1800
      console.log(&quot;Height:&quot;+h.toString()); //1200
  }
  </code></pre>