Created
March 28, 2013 03:58
-
-
Save JustinBeckwith/5260480 to your computer and use it in GitHub Desktop.
Ask a user to install a Chrome extension given an extensionID from C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chromeAppDataPath = Path.Combine(Environment.GetEnvironmentVariable("localappdata"), @"Google\Chrome"); | |
var chromeExtensionId = "clopmcfjibhgfnagfneonflajbjidfai"; | |
if (Directory.Exists(chromeAppDataPath)) | |
{ | |
var extensionsPath = Path.Combine(chromeAppDataPath, @"User Data\Default\Extensions\" + chromeExtensionId); | |
if (!Directory.Exists(extensionsPath)) | |
{ | |
Process.Start(new ProcessStartInfo() | |
{ | |
FileName = Path.Combine(chromeAppDataPath, @"Application\chrome.exe"), | |
Arguments = " --install-from-webstore=" + chromeExtensionId | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you Justin. webstore install.
i need Developer source directory install
%userdata%..\extension_dir\my_project --install