diff --git a/lib/chrome.js b/lib/chrome.js index 556cc39..eb1e196 100644 --- a/lib/chrome.js +++ b/lib/chrome.js @@ -26,6 +26,7 @@ var ChromeObject = function() { this.profileName = "Default"; this.userDataDir = null; + this.installedDir = "Chrome"; // proxy this.isPreventProxy = false; @@ -76,6 +77,8 @@ var ChromeObject = function() { this.setProfile = function(profileName, installedDir) { this.profileName = (profileName == "Default" ? "Chrome" : profileName); + this.workingDirectory = this.workingDirectory.replace(":installedDir", installedDir); + this.binPath = this.binPath.replace(":installedDir", installedDir); return this; }; @@ -156,11 +159,7 @@ var ChromeObject = function() { } var cmd = [ - "cscript", - "app.js", - "shoutcut", - "chrome", - this.installedDir, + this.binPath ]; // disable default browser check @@ -189,7 +188,7 @@ var ChromeObject = function() { cmd.push("\"--user-data-dir=" + this.userDataDir + "\""); cmd.push("\"" + url + "\""); - SHELL.createShoutcut("Chrome (" + this.installedDir + ")", cmd.join(' '), SYS.getCurrentScriptDirectory()); + SHELL.createShoutcut(this.publisherName + " (" + this.profileName + ")", cmd.join(' '), SYS.getCurrentScriptDirectory()); }; this.setInPrivate = function(flag) { @@ -226,7 +225,7 @@ var ChromeObject = function() { if (!FILE.fileExists(this.binPath)) { this.workingDirectory = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Google\\:installedDir\\Application"; this.binPath = SYS.getEnvString("PROGRAMFILES(X86)") + "\\Google\\:installedDir\\Application\\chrome.exe"; - this.setProfile(this.profileName); + this.setProfile(this.profileName, this.installedDir); } // find a executable file @@ -1254,7 +1253,7 @@ var ChromeObject = function() { case "chrome": this.workingDirectory = SYS.getEnvString("PROGRAMFILES") + "\\Google\\Chrome\\Application"; - this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\Chrome\\Application\\chrome.exe"; + this.binPath = SYS.getEnvString("PROGRAMFILES") + "\\Google\\:installedDir\\Application\\chrome.exe"; break; case "chromium":