wleepang / DesktopDeployR

A framework for deploying self-contained R-based applications to the desktop
Apache License 2.0
406 stars 120 forks source link

run.js #16

Closed wtf13 closed 4 years ago

wtf13 commented 6 years ago

Hello Lee Pang

Thank you so much for creating this framework! I managed to deploy it successfully on my Windows desktop. However, when I transferred the program files to a secured environment, the program stops after it reaches the file in dist/script/wsf/js/run.js.

The following steps were logged: .bat file was allowed to run dist/script/wsf/run.wsf was allowed to run dist/script/wsf/js/json2.js was allowed to run dist/script/wsf/js/json.minify.js was allowed to run dist/script/wsf/js/run.js was allowed to run

The process terminates afterwards. Wanted to check if the run.js file requires any additional configurations or external dependencies/special settings?

Cheers~

wleepang commented 6 years ago

@wtf13 - can you describe what you mean by a "secured environment"?

There shouldn't be any additional dependencies outside of:

It would be easier to debug if you could capture any system messages that are returned when the process terminates. Also worth checking if R-Portable executables are allowed to run in the environment.

wtf13 commented 6 years ago

@wleepang Thanks so much for your reply!

I was checking with some of my coworkers, it seems that portable apps were blocked from our operating system. I'm trying to modify your framework by working with R instead of R-Portable packaged within the folders. Will I need to modify any additional files besides config.cfg?

I added the following line to the config.cfg file:

"r_bindir": "C:\Program Files\R\R-3.3.2\bin"

However, the code was unable to run smoothly, I believe the file could not be located.

wleepang commented 6 years ago

@wtf13 - you need to escape the \ characters, so the option in config.cfg should be:

"r_bindir": "C:\\Program Files\\R\\R-3.3.2\\bin"
wtf13 commented 6 years ago

Thanks leepang! That was exactly what I did earlier, just forgot to append my code as a chunk earlier on. "r_bindir": "C:\\Program Files\\R\\R-3.3.2\\bin"

I'm still getting the following message however: Code 80070002: The system cannot find the file specified.

When i replaced R portable with the system installed R in the app framework within the \dist folder, it seems to work with the following in config.cfg.

"r_bindir": "dist\\R\\R-3.4.2\\bin"

Was wondering if you have any ideas why this is happening? Thanks so much for your advice, appreciate it loads.

wleepang commented 6 years ago

@wtf13 - After some testing, I found that paths with spaces weren't being handled correctly, causing the error you encountered. I just merged in some updates that should address this issue, and added some additional flexibility in specifying the R executable used.

wtf13 commented 6 years ago

@wleepang thanks a lot for resolving the issue! Managed to run it successfully from my desktop :)

However, when I copied the entire application folder to 'Program Files" in the C: drive, the program does not launch from the new path. After the windows command prompt appears, the 'loading packages' pop-up does not show up. Any advice on why this is happening?

wleepang commented 6 years ago

@wtf13 - did you pre-ensure the package dependencies for your application prior to moving it (i.e. did you create the app library on your development desktop)?

It sounds like there might be some access permissions restrictions for the R interpreter. Does it work from another location accessible to users?

wtf13 commented 6 years ago

@wleepang Hmm I put the entire folder with libraries, R, wsf,js scripts, and R source code into C:/Program Files... It works when I placed the folder in the desktop, but when the path is changed to C:/Program Files, there is no response. I'm trying out this on a computer where system admin rights are granted, so I'm wondering if it could be because of the space in the path directory if you referred to the current directory anywhere in your scripts?

Thanks so much for your guidance.

wleepang commented 4 years ago

Closing as this is more than 1yr old. Feel free to reopen if still an issue.