Hi Tal and all,
Not about the post (which I did not read), but here is how I do it.
Hope it helps.
Sven
PS: I have no idea whether my approach is elegant or rubbish. If
anyone can evaluate, please let me know!
== (1) Windows batch (.bat) file (to which the shortcut points): ==
@echo off
COLOR E0
echo.
echo To finish please click 'logout' in your browser.
echo.
"C:\Programme\R\R-2.14.1\bin\i386\Rterm.exe" --no-restore --no-save <
"\\path\to\script\startup.R" > "\\path\to\logfile.txt" 2>&1
echo.
echo Done.
echo.
pause
== (2) The startup.R file: ==
#!/usr/bin/Rscript --vanilla
## I use the same script as an executable in GNU/Linux, otherwise you
## probably would not need the above line.
setwd("\\\\path\\to\\script\\")
library(RMySQL, quietly=TRUE)
library(Rook, quietly=TRUE)
source("config.R")
source("functions.R")
dbcon <- startMysql()
app <- Builder$new(Static$new(urls=c("/css", "/js"), root="."),
Brewery$new(url="/brew", root="."),
Redirect$new("/brew/index.rhtml"))
s <- Rhttpd$new()
s$add(app=app, name="mycoolapp")
s$start(quiet=TRUE)
s$browse("mycoolapp")
## After logout is clicked in the browser, SESS("r-logout") will
## return TRUE.
while(!isTRUE(SESS("r-logout"))) {
Sys.sleep(5)
}
dbDisconnect(dbcon)
cat("Bye!\n")