Skip to content

Instantly share code, notes, and snippets.

@JustinBeckwith
Created March 28, 2013 03:58
Show Gist options
  • Save JustinBeckwith/5260480 to your computer and use it in GitHub Desktop.
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#
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
});
}
}
@tolgatasci
Copy link

Thank you Justin. webstore install.
i need Developer source directory install

%userdata%..\extension_dir\my_project --install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment