From 75627f50a276e8998fc3da16b2bd0fb1ba40567f Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 30 Oct 2014 10:30:10 -0700 Subject: [PATCH] Normalize process.resourcesPath on load This ensures the drive letter is consistent on Windows for when package paths are compared to the resources path to determine whether to use the metadata cache for a bundled package. Closes #3932 --- static/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/index.js b/static/index.js index 907df77e5..6bc6eead1 100644 --- a/static/index.js +++ b/static/index.js @@ -5,6 +5,9 @@ window.onload = function() { // Skip "?loadSettings=". var loadSettings = JSON.parse(decodeURIComponent(location.search.substr(14))); + // Normalize to make sure drive letter case is consistent on Windows + process.resourcesPath = path.normalize(process.resourcesPath); + var devMode = loadSettings.devMode || !loadSettings.resourcePath.startsWith(process.resourcesPath + require('path').sep); // Require before the module cache in dev mode