From bf63b6dbf8d2ea07323bf8ae5c4e62592649de94 Mon Sep 17 00:00:00 2001 From: Slava Kim Date: Wed, 25 Feb 2015 16:15:29 -0800 Subject: [PATCH] Allow meteor.bat script to set its own installation location --- tools/files.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/files.js b/tools/files.js index 8d6a9aed7f..1950bc6773 100644 --- a/tools/files.js +++ b/tools/files.js @@ -1161,7 +1161,11 @@ _.extend(files.KeyValueFile.prototype, { files.getHomeDir = function () { if (process.platform === "win32") { - var homeDir = process.env.LOCALAPPDATA || process.env.APPDATA; + var homeDir = + process.env.METEOR_INSTALLATION || + process.env.LOCALAPPDATA || + process.env.APPDATA; + return files.convertToStandardPath(homeDir); } @@ -1185,6 +1189,13 @@ files._generateScriptLinkToMeteorScript = function (scriptLocation) { var newScript = [ "@echo off", + // set the installation path to the grand-parent folder of this script + "set DOT_METEOR=\"%~dp0%\"", + "pushd %DOT_METEOR%", + "cd ..", + "set METEOR_INSTALLATION=\"%cd%\"", + "popd", + // always convert to Windows path since this function can also be // called on Linux or Mac when we are building bootstrap tarballs "\"" + scriptLocationConverted + "\" %*",