1

I'm trying to automate packaging of the Chrome extension on Windows and according to the documentation, it is this command:

[path]\chrome.exe --pack-extension=c:\myext --pack-extension-key=c:\myext.pem --no-message-box

However this command results in a new browser window and no action is performed. I tried other switches like --version or --help but it seems that Chrome is ignoring all of this. Do others have the same issue? What am I doing wrong? I also tried various quoting and with no other browser window open but I haven't been able to make this work.

Update: I'm happy to learn that the new Chrome 8 has fixed this issue.

msha
  • 163
  • 3
  • 10
  • what version of Chrome are you using? – Mohamed Mansour Nov 16 '10 at 21:48
  • 2
    You can try one of the scripts to pack an extension at http://code.google.com/chrome/extensions/crx.html#scripts – Na7coldwater Nov 19 '10 at 03:36
  • 1
    I'm using the latest version of Chrome (7.0.517.44). @Na7coldwater thanks! the script worked on Ubuntu but I need to do this on a Windows machine and the script produces as error in Cygwin. I think this is a workable solution. If you have this as an answer, I will mark it. – msha Nov 24 '10 at 17:08
  • You can also check programmatic ways to do so: https://stackoverflow.com/a/59009114/520567 – akostadinov Nov 23 '19 at 15:29

2 Answers2

5

The answer is present in one of the comments. I am reposting the answer verbatim here:

You can try one of the scripts to pack an extension at https://developer.chrome.com/extensions/crx#scripts – by Na7coldwater

Community
  • 1
  • 1
Ritesh M Nayak
  • 8,001
  • 14
  • 49
  • 78
  • The docs changed and the link broke. Here it is in the internet archive: https://web.archive.org/web/20180114090616/https://developer.chrome.com/extensions/crx – Kevin Chavez Jan 16 '19 at 19:48
0

You'll need to close all chrome windows before the command line pack extension command will work.

I raised this bug with the chrome team some time ago (http://code.google.com/p/chromium/issues/detail?id=22901) but it's not quite fixed yet. This can be somewhat frustrating because (as michaelhermannweber pointed out) "Since we're fans of Chrome, obviously Chrome is already open!"

I even tried to use a separate instance of the chrome executable to build the extension, but alas no luck on that front either :( For now, AFAICT you have to do it manually via the pack extension button on the chrome://extensions page.

You might manage to build a script that closes all open chrome windows, builds the extension, and then re-opens chrome. But I doubt that it would be worth it given the number of tab users like to keep open.

werehamster
  • 116
  • 2
  • 2
  • I had already tried with all the Chrome windows closed but the command just opens the Chrome back up. Does the packing work for you from the command line? I can't get any of the other switches to work either, e.g., --version – msha Nov 24 '10 at 16:58