<p dir="auto">On Windows, when Electron <del>with Chromium61</del> is run, the path <code class="notranslate">%HOMEDRIVE%%HOMEPATH%\AppData\Roaming\Electron\logs</code> is created under the current directory.</p>
<p dir="auto">This can likely be attributed to the following code:<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/electron/electron/blob/306b62709017e12f6f4865e3d2b069cc7177db1f/brightray/browser/browser_main_parts.cc#L168-L179">electron/brightray/browser/browser_main_parts.cc</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 168 to 179
      in
      <a data-pjax="true" class="commit-tease-sha" href="/electron/electron/commit/306b62709017e12f6f4865e3d2b069cc7177db1f">306b627</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L168" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="168"></td>
          <td id="LC168" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">void</span> <span class="pl-en">OverrideAppLogsPath</span>() { </td>
        </tr>

        <tr class="border-0">
          <td id="L169" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="169"></td>
          <td id="LC169" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> #<span class="pl-k">if</span> defined(OS_WIN) </td>
        </tr>

        <tr class="border-0">
          <td id="L170" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="170"></td>
          <td id="LC170" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   std::wstring app_name = <span class="pl-c1">base::UTF8ToWide</span>(<span class="pl-c1">GetApplicationName</span>()); </td>
        </tr>

        <tr class="border-0">
          <td id="L171" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="171"></td>
          <td id="LC171" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   std::wstring log_path = <span class="pl-s"><span class="pl-pds">L"</span>%HOMEDRIVE%%HOMEPATH%<span class="pl-cce">\\</span>AppData<span class="pl-cce">\\</span>Roaming<span class="pl-cce">\\</span><span class="pl-pds">"</span></span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L172" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="172"></td>
          <td id="LC172" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   std::wstring app_log_path = log_path + app_name + <span class="pl-s"><span class="pl-pds">L"</span><span class="pl-cce">\\</span>logs<span class="pl-pds">"</span></span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L173" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="173"></td>
          <td id="LC173" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> #<span class="pl-k">else</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L174" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="174"></td>
          <td id="LC174" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   std::string app_name = <span class="pl-c1">GetApplicationName</span>(); </td>
        </tr>

        <tr class="border-0">
          <td id="L175" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="175"></td>
          <td id="LC175" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   std::string home_path = <span class="pl-c1">std::string</span>(<span class="pl-c1">getenv</span>(<span class="pl-s"><span class="pl-pds">"</span>HOME<span class="pl-pds">"</span></span>)); </td>
        </tr>

        <tr class="border-0">
          <td id="L176" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="176"></td>
          <td id="LC176" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   std::string app_log_path = home_path + <span class="pl-s"><span class="pl-pds">"</span>/.config/<span class="pl-pds">"</span></span> + app_name + <span class="pl-s"><span class="pl-pds">"</span>/logs<span class="pl-pds">"</span></span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L177" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="177"></td>
          <td id="LC177" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> #<span class="pl-k">endif</span> </td>
        </tr>

        <tr class="border-0">
          <td id="L178" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="178"></td>
          <td id="LC178" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">   <span class="pl-c1">PathService::Override</span>(DIR_APP_LOGS, <span class="pl-c1">base::FilePath</span>(app_log_path)); </td>
        </tr>

        <tr class="border-0">
          <td id="L179" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="179"></td>
          <td id="LC179" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> } </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">I did not reproduce it with Electron 1.8.1, so I'm deducing that it has something to do with upgrade to Chromium 61 - possibly the function <code class="notranslate">PathService::Override</code> no longer expands environment variables.</p>
<ul dir="auto">
<li>Electron version: 1.8.2-beta 1</li>
<li>Operating system: Windows 7</li>
</ul>
<h3 dir="auto">Expected behavior</h3>
<p dir="auto">Launching electron should not create a subfolder.</p>
<h3 dir="auto">Actual behavior</h3>
<p dir="auto">Running electron creates a subfolder in the electron folder. The subfolder is named "%HOMEDRIVE%%HOMEPATH%" and contains subfolders AppData\Roaming\Electron\logs<br>
I've not seen this behaviour in any previous version, and obviously %HOMEDRIVE%%HOMEPATH% are environnement variables names that should be expanded (hence the bug).</p>
<h3 dir="auto">How to reproduce</h3>
<p dir="auto">Download electron-v1.8.2-beta.1-win32-x64.zip<br>
Launch electron.exe<br>
See the folder appearing</p>