-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathindex.html
311 lines (273 loc) · 16.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
<!DOCTYPE html>
<!-- Generated by pkgdown: do not edit by hand --><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>An Installation Framework for Shiny Apps • RInno</title>
<!-- jquery --><script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha384-nrOSfDHtoPMzJHjVTdCopGqIqeYETSXhZDFyniQ8ZHcVy08QesyHcnOUpMpqnmWq" crossorigin="anonymous"></script><!-- Bootstrap --><link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script><!-- Font Awesome icons --><link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/1.7.1/clipboard.min.js" integrity="sha384-cV+rhyOuRHc9Ub/91rihWcGmMmCXDeksTtCihMupQHSsi8GIIRDG0ThDc3HGQFJ3" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="pkgdown.css" rel="stylesheet">
<script src="pkgdown.js"></script><meta property="og:title" content="An Installation Framework for Shiny Apps">
<meta property="og:description" content="Installs shiny apps packaged as stand-alone Electron apps using Inno Setup, an open source software that builds installers for Windows programs <http://www.jrsoftware.org/ishelp/>.">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script><!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="container template-article">
<header><div class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="navbar-brand">
<a class="navbar-link" href="index.html">RInno</a>
<span class="label label-default" data-toggle="tooltip" data-placement="bottom" title="Released package">1.0.1</span>
</span>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>
<a href="index.html">
<span class="fa fa-home fa-lg"></span>
</a>
</li>
<li>
<a href="reference/index.html">Reference</a>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Articles
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/cont-installation.html">Continuous Installation</a>
</li>
<li>
<a href="articles/Introduction.html">Introduction</a>
</li>
</ul>
</li>
<li>
<a href="news/index.html">Changelog</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right"></ul>
</div>
<!--/.nav-collapse -->
</div>
<!--/.container -->
</div>
<!--/.navbar -->
</header><div class="row">
<div class="col-md-9 contents">
<div id="rinno" class="section level1">
<div class="page-header"><h1 class="hasAnchor">
<a href="#rinno" class="anchor"></a>RInno <img src="reference/figures/RInno.png" align="right" height="140/">
</h1></div>
<p>RInno makes it easy to install local shiny apps by providing an interface between R, <a href="http://www.jrsoftware.org/isinfo.php">Inno Setup</a>, an installer for Windows programs (sorry Mac and Linux users), and <a href="https://electronjs.org/">Electron</a>, a modern desktop framework used by companies like Github, Slack, Microsoft, Facebook and Docker. RInno is designed to be simple to use (two lines of code at a minimum), yet comprehensive.</p>
<p>If a user does not have R installed, the RInno installer can be configured to ask them to install R along with a shiny app, <code>include_R = TRUE</code>. And similar to Dr. Lee Pang’s <a href="https://github.com/wleepang/DesktopDeployR">DesktopDeployR</a> project, RInno provides a framework for managing software dependencies and error logging features. However, RInno also supports GitHub package dependencies, continuous installation (auto-update on start up), and it is easier to manage with <code>create_app</code>, the main RInno function. DesktopDeployR requires many manual adjustments and a deep understanding of the entire framework to use, but RInno can be learned incrementally and changes automatically flow down stream. You don’t need to remember the 100+ places impacted by changing <code>app_dir</code>. RInno only requires a high-level understanding of what you’d like to accomplish.</p>
<div id="getting-started" class="section level2">
<h2 class="hasAnchor">
<a href="#getting-started" class="anchor"></a>Getting Started</h2>
<pre><code># Get remotes package
install.packages("remotes"); require(remotes)
# Use install_github to get RInno
install_github("ficonsulting/RInno")
# Require Package
require(RInno)
# Use RInno to get Inno Setup
install_inno()</code></pre>
</div>
<div id="minimal-example" class="section level2">
<h2 class="hasAnchor">
<a href="#minimal-example" class="anchor"></a>Minimal example</h2>
<p>Once you have developed a shiny app, you can build an installer with <code>create_app</code> followed by <code>compile_iss</code>.</p>
<pre><code># Example app included with RInno package
example_app(app_dir = "app")
# Build an installer
create_app(app_name = "Your appname", app_dir = "app")
compile_iss()</code></pre>
<p><code>create_app</code> creates an installation framework in your app’s directory, <code>app_dir</code>. The main components are a file called “app_name.iss” and the “nativefier-app” directory. You can perform minor customizations before you call <code>compile_iss</code>. For example, you can replace the default/setup icon at <a href="http://www.flaticon.com/">Flaticon.com</a>, or you can customize the pre-/post- install messages, <em>infobefore.txt</em> and <em>infoafter.txt</em>. Just remember, the default values (i.e. <code><a href="reference/create_app.html">create_app(info_after = "infobefore.txt")</a></code>) for those files have not changed. The Inno Setup Script (ISS), <em>app_name.iss</em>, will look for <em>default.ico</em> and try to use it until you update the script or call <code>create_app</code> with the new icon’s file name (i.e. <code><a href="reference/create_app.html">create_app(app_icon = "new.ico")</a></code>). Likewise, the Electron app will need to be recompiled to capture any manual changes to files in <code>app_dir</code>.</p>
<p>Electron is now used to render the shiny app’s UI. All other <code>user_browser</code> options will be deprecated in future releases.</p>
</div>
<div id="ui-r-requirements" class="section level2">
<h2 class="hasAnchor">
<a href="#ui-r-requirements" class="anchor"></a>ui.R Requirements</h2>
<p>In order to replace Electron’s logo with your app’s icon, add something like this to your ui.R file:</p>
<pre><code>fluidPage(
tags$head(
tags$link(
rel = "icon",
type = "image/x-icon",
href = "http://localhost:1984/default.ico")
)
)</code></pre>
</div>
<div id="server-r-requirements" class="section level2">
<h2 class="hasAnchor">
<a href="#server-r-requirements" class="anchor"></a>server.R Requirements</h2>
<p>In order to close the app when your user’s session completes:</p>
<ol style="list-style-type: decimal">
<li>Add <code>session</code> to your <code>server</code> function</li>
<li>Call <code>stopApp()</code> when the session ends</li>
</ol>
<pre><code>function(input, output, session) {
if (!interactive()) {
session$onSessionEnded(function() {
stopApp()
q("no")
})
}
}</code></pre>
<p>If you forget to do this, users will complain that their icons are broken and rightly blame you for it (an R session will be running in the background hosting the app, but they will need to press ctrl + alt + delete and use their task manager to close it). <strong>Not cool</strong>.</p>
</div>
<div id="package-dependency-management" class="section level2">
<h2 class="hasAnchor">
<a href="#package-dependency-management" class="anchor"></a>Package Dependency Management</h2>
<p>Provide a named character vector of packages to <code>create_app</code>, and RInno will download them and install them with your shiny app. RInno downloads windows binaries from CRAN for the listed packages and their dependencies with <code><a href="http://www.rdocumentation.org/packages/tools/topics/package_dependencies">tools::package_dependencies(packages = pkgs, recursive = TRUE)</a></code>.</p>
<pre><code>create_app(
app_name = "myapp",
app_dir = "app",
pkgs = c("shiny", "jsonlite", "httr")
)</code></pre>
<p>For <code>remotes</code>, Github source files are compiled into windows binaries. Bitbucket will be supported in a future release.</p>
</div>
<div id="custom-installations" class="section level2">
<h2 class="hasAnchor">
<a href="#custom-installations" class="anchor"></a>Custom Installations</h2>
<p>If you would like to create a custom installer from within R, you can slowly build up to it with <code>create_app</code>, like this:</p>
<pre><code>create_app(
app_name = "My AppName",
app_dir = "My/app/path",
dir_out = "wizard",
pkgs = c("jsonlite", "shiny", "magrittr", "xkcd"), # CRAN-like repo packages
remotes = c("talgalili/installr", "daattali/shinyjs"), # GitHub packages
include_R = TRUE, # Download R and install it with your app, if necessary
R_version = "2.2.1", # Old versions of R
privilege = "high", # Admin only installation
default_dir = "pf") # Install app in to Program Files</code></pre>
<p><code>create_app</code> passes its arguments to most of the other support functions in RInno. You can (and probably should) specify most things there and they will get passed on. Alternatively, you can provide instructions directly to those support functions like this:</p>
<pre><code># Copy installation scripts (JavaScript, icons, infobefore.txt, package_manager.R, launch_app.R)
copy_installation(app_dir = "my/app/path")
# If your users need R installed:
get_R(app_dir = "my/app/path", R_version = "2.2.1")
# Create batch file
create_bat(app_name = "My AppName", app_dir = "my/app/path")
# Create app config file
create_config(app_name = "My AppName", R_version = "2.2.1", app_dir = "my/app/path",
pkgs = c("jsonlite", "shiny", "magrittr", "dplyr", "caret", "xkcd"))
# Build the iss script
start_iss(app_name = "My AppName") %>%
# C-like directives
directives_section(R_version = "2.2.1",
include_R = TRUE,
app_version = "0.1.2",
publisher = "Your Company",
main_url = "yourcompany.com") %>%
# Setup Section
setup_section(output_dir = "wizard",
app_version = "0.1.2",
default_dir = "pf",
privilege = "high",
inst_readme = "pre-install instructions.txt",
setup_icon = "myicon.ico",
pub_url = "mycompany.com",
sup_url = "mycompany.github.com/issues",
upd_url = "mycompany.github.com") %>%
# Languages Section
languages_section() %>%
# Tasks Section
tasks_section(desktop_icon = FALSE) %>%
# Files Section
files_section(app_dir = "my/app/path", file_list = "path/to/extra/files") %>%
# Icons Section
icons_section(app_desc = "This is my local shiny app",
app_icon = "notdefault.ico",
prog_menu_icon = FALSE,
desktop_icon = FALSE) %>%
# Execution & Pascal code to check registry during installation
# If the user has R, don't give them an extra copy
# If the user needs R, give it to them
run_section() %>%
code_section() %>%
# Write the Inno Setup script
writeLines(file.path("my/app/path", "My AppName.iss"))
# Check your files, then
compile_iss()
</code></pre>
<p>Feel free to read the Inno Setup <a href="http://www.jrsoftware.org/ishelp/">documentation</a> and RInno’s documentation to get a sense for what is possible. Also, please suggest useful features or build them yourself! We have a very positive culture at FI Consulting, and we would love to get your feedback.</p>
<p>Please note that this project has a <a href="https://github.com/ficonsulting/RInno/blob/master/CONDUCT.html">Contributor Code of Conduct</a>. By participating in this project you agree to abide by its terms.</p>
</div>
<div id="license" class="section level2">
<h2 class="hasAnchor">
<a href="#license" class="anchor"></a>License</h2>
<p>The RInno package is licensed under the GPLv3. See LICENSE for details.</p>
</div>
</div>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<div class="links">
<h2>Links</h2>
<ul class="list-unstyled">
<li>Download from CRAN at <br><a href="https://cloud.r-project.org/package=RInno">https://cloud.r-project.org/package=RInno</a>
</li>
<li>Report a bug at <br><a href="https://github.com/ficonsulting/RInno/issues">https://github.com/ficonsulting/RInno/issues</a>
</li>
</ul>
</div>
<div class="license">
<h2>License</h2>
<ul class="list-unstyled">
<li>
<a href="https://www.r-project.org/Licenses/GPL-3">GPL-3</a> | file <a href="LICENSE-text.html">LICENSE</a>
</li>
</ul>
</div>
<div class="developers">
<h2>Developers</h2>
<ul class="list-unstyled">
<li>Jon Hill <br><small class="roles"> Author, maintainer, copyright holder </small> </li>
<li>W. Lee Pang <br><small class="roles"> Author, copyright holder </small> <br><small>(DesktopDeployR project at https://github.com/wleepang/DesktopDeployR)</small>
</li>
<li>Gábor Csárdi <br><small class="roles"> Author </small> </li>
<li>
<a href="http://hadley.nz">Hadley Wickham</a> <br><small class="roles"> Author </small> </li>
<li>Winston Chang <br><small class="roles"> Author </small> </li>
<li>Jim Hester <br><small class="roles"> Author </small> </li>
<li>Martin Morgan <br><small class="roles"> Author </small> </li>
<li>Dan Tenenbaum <br><small class="roles"> Author </small> </li>
<li><a href="authors.html">All authors...</a></li>
</ul>
</div>
<div class="dev-status">
<h2>Dev status</h2>
<ul class="list-unstyled">
<li><a href="https://ci.appveyor.com/project/ficonsulting/RInno"><img src="https://ci.appveyor.com/api/projects/status/github/ficonsulting/RInno?branch=master&svg=true" alt="AppVeyor Build Status"></a></li>
<li><a href="https://codecov.io/github/ficonsulting/RInno"><img src="https://codecov.io/github/ficonsulting/RInno/branch/master/graphs/badge.svg" alt="codecov"></a></li>
<li><a href="https://cran.r-project.org/package=RInno"><img src="https://www.r-pkg.org/badges/version/RInno" alt="CRAN_Status_Badge"></a></li>
<li><a href="https://cran.rstudio.com/package=RInno"><img src="https://cranlogs.r-pkg.org/badges/RInno" alt="Downloads"></a></li>
<li><a href="https://cran.rstudio.com/package=RInno"><img src="https://cranlogs.r-pkg.org/badges/grand-total/RInno" alt="Downloads"></a></li>
<li><a href="http://www.repostatus.org/#active"><img src="http://www.repostatus.org/badges/latest/active.svg" alt="Project Status: Active - The project has reached a stable, usable state and is being actively developed."></a></li>
</ul>
</div>
</div>
</div>
<footer><div class="copyright">
<p>Developed by Jon Hill, W. Lee Pang, Gábor Csárdi, <a href="http://hadley.nz">Hadley Wickham</a>, Winston Chang, Jim Hester, Martin Morgan, Dan Tenenbaum.</p>
</div>
<div class="pkgdown">
<p>Site built with <a href="http://pkgdown.r-lib.org/">pkgdown</a>.</p>
</div>
</footer>
</div>
</body>
</html>