renderthis icon indicating copy to clipboard operation
renderthis copied to clipboard

`assert_chrome_installed()` could give better advice

Open gadenbuie opened this issue 3 years ago • 1 comments

As pointed out by @yyzeng in this comment

The underlied chromote::find_chrome() just CAN'T find chrome.exe's path in my computer, but I have checked and found the path is in the Register with key "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\chrome.exe\\", 😭 So, I have to set Sys.setenv("CHROMOTE_CHROME" = "C:\\Users\\admin\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe") before using xaringanBuilder::build_pdf("Test.Rmd"), then everything is ok.)

we could add some advice about setting the CHROMOTE_CHROME env variable if Chrome is installed but not found by chromote::find_chrome(). I guess this is something that should be handled by chromote::find_chrome(), but we use our own error message since the underlying error isn't very user friendly.

Our current error message reads

Error: This function requires a local installation of the Chrome browser. 
  You can also use other browsers based on Chromium, such as Chromium itself, 
  Edge, Vivaldi, Brave, or Opera.

gadenbuie avatar Sep 17 '21 13:09 gadenbuie

e.g. #39

gadenbuie avatar Nov 15 '21 21:11 gadenbuie