Handheld Browser Issues When Deploying R Shiny Application

I built a complex brilliant interface that is extracted from the internal network of the ODBC table and allows the user to interact with data through my browser. The company is on Windows 7 Enterprise, and IT only supports IE 9. Some users have Chrome in their user folders, some have firefox, some use IE 9. I followed the R-Bloggers tutorial (here: http: //www.r -bloggers.com/deploying-desktop-apps-with-r/ ), and it runs on my machine using the Chrome portable browser downloaded from PortableApps.com. Fine. Unfortunately, the interface is not running on the ANYONE else machine, which has its own local Chrome browser installed.

Following the tutorial, I use the following vb script:

Rexe = "R-Portable\App\R-Portable\bin\Rscript.exe" Ropts = "--no-save --no-environ --no-init-file --no-restore --no-Rconsole" RScriptFile = "runShinyApp.R" Outfile = "ShinyApp.log" strCommand = Rexe & " " & Ropts & " " & RScriptFile & " 1> " & Outfile & " 2>&1" intWindowStyle = 0 ' Hide the window and activate another window.' bWaitOnReturn = False ' continue running script after launching R ' CreateObject("Wscript.Shell").Run strCommand, intWindowStyle, bWaitOnReturn 

This script calls the following code in my R file:

 message('library paths:\n', paste('... ', .libPaths(), sep='', collapse='\n')) chrome.portable = file.path(getwd(),'GoogleChromePortable/App/Chrome-bin/chrome.exe') launch.browser = function(appUrl, browser.path=chrome.portable) { message('Browser path: ', browser.path) shell(sprintf('"%s" --app=%s', browser.path, appUrl)) } shiny::runApp('shiny', launch.browser=launch.browser) 

It works fine on my computer ... I have chrome installed locally, but I call the Portable Chrome executable. It bothers me that they share prefs or something else, for example. I noticed that the hash from the settings file in my installed version, in particular:

  "chrome_url_overrides": { "bookmarks": [ "chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html" ] }, 

... matches the same json entry from the Portable Chrome installation:

  "chrome_url_overrides": { "bookmarks": [ "chrome-extension://eemcgdkfndhakfknompkggombfjjjeno/main.html" ] } 

Why do these long random strings match? Am I barking the wrong tree to inquire about this? I don’t know why these lines are the same if they are two separate installations of Chrome executables, one of which should run completely independently of anything on the machine.

Here is a set of errors from one machine:

 .../Desktop/TestApp3/GoogleChromePortable/App/Chrome-bin/chrome.exe[9100:9408:0716/141934:ERROR:gpu_info_collector_win.cc(103)] Can't retrieve a valid WinSAT assessment. [9100:9408:0716/141934:ERROR:component_loader.cc(138)] Failed to parse extension manifest. [9100:1716:0716/141946:ERROR:get_updates_processor.cc(214)] PostClientToServerMessage() failed during GetUpdates 

Here is a set of errors from the second machine:

 .../Documents/TestApp3/GoogleChromePortable/App/Chrome-bin/chrome.exe [5220:3384:0714/142128:ERROR:component_loader.cc(138)] Failed to parse extension manifest. [5220:7600:0714/142130:ERROR:external_registry_loader_win.cc(136)] File C:\Program Files\Coupons.com CouponBar\chrome\Coupons.com.crx for key Software\Google\Chrome\Extensions\cnpkmcjgpcihgfnkcjapiaabbbplkcmf does not exist or is not readable. [5220:2120:0714/142140:ERROR:get_updates_processor.cc(214)] PostClientToServerMessage() failed during GetUpdates [5220:3384:0714/142413:ERROR:CONSOLE(122)] "Could not find value for secondaryUser", source: chrome://resources/js/load_time_data.js (122) [5220:3384:0714/142413:ERROR:CONSOLE(122)] "[undefined] (secondaryUser) is not a boolean", source: chrome://resources/js/load_time_data.js (122) [5220:3384:0714/142425:ERROR:CONSOLE(122)] "Could not find value for secondaryUser", source: chrome://resources/js/load_time_data.js (122) [5220:3384:0714/142425:ERROR:CONSOLE(122)] "[undefined] (secondaryUser) is not a boolean", source: chrome://resources/js/load_time_data.js (122) [5220:3384:0714/142442:ERROR:navigation_entry_screenshot_manager.cc(167)] Invalid entry with unique id: 12 

It seems that Chrome does different things on different computers and actually does not act as a standalone browser ... but it probably interacts with a browser installed on its computers through the registry or some other “under the hood, active” communication. Perhaps, since I installed the portable executable on my computer, a bunch of local extensions or preferences were automatically updated to portable settings, etc., and subsequently it causes a conflict on every other machine.

Can I turn off Chrome extensions or additional features like update calls? Is there a better standalone portable browser that works well with Shiny for this type of “deployment”? Can I fix this or is this a lost thing? This should be obvious, but I’ll say it anyway: it’s uneconomical to ask non-technical types to install R, then RStudio, then confirm their working directory structure and then call the runApp() command through a script window ...

+7
windows google-chrome portability r shiny
source share
1 answer

I started with the same articles, but designed the RInno package to solve this exact problem, that is, when you want to share your desktop Brilliant application with non-technical users that you should not expect to mess with all these details.

To start:

 install.packages("RInno") require(RInno) RInno::install_inno() 

Then you just need to call two functions to create the installation framework:

 create_app(app_name = "myapp", app_dir = "path/to/myapp") compile_iss() 

This will create an installation wizard that works like any other program, but installs your brilliant application on a Windows desktop computer. If you want to enable R for your employees who don’t have it, add include_R = TRUE to create_app :

 create_app(app_name = "myapp", app_dir = "path/to/myapp", include_R = TRUE) 

By default, it includes shiny, magrittr, and jsonlite, so if you are using other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages in the remotes argument:

 create_app( app_name = "myapp", app_dir = "path/to/myapp" pkgs = c("shiny", "jsonlite", "magrittr", "plotly", "ggplot2"), remotes = c("talgalili/installr", "daattali/shinyjs")) 

For other features, check out FI Labs - RInno

+1
source share

All Articles