diff --git a/README.md b/README.md index 9c06576..851a5b4 100644 --- a/README.md +++ b/README.md @@ -19,10 +19,10 @@ Creating Standalone Apps from Shiny with Electron [2023, macOS M1] ## Versions info -![NodeJS](https://img.shields.io/badge/node.js-18.17.1-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) +![NodeJS](https://img.shields.io/badge/node.js-20.11.0-6DA55F?style=for-the-badge&logo=node.js&logoColor=white) ![NPM](https://img.shields.io/badge/NPM-10.3.0-%23CB3837.svg?style=for-the-badge&logo=npm&logoColor=white) ![RStudio](https://img.shields.io/badge/RStudio-2023.12.0-4285F4?style=for-the-badge&logo=rstudio&logoColor=white) -![R](https://img.shields.io/badge/r-4.3.2-%23276DC3.svg?style=for-the-badge&logo=r&logoColor=white) +![R](https://img.shields.io/badge/r-4.3.1-%23276DC3.svg?style=for-the-badge&logo=r&logoColor=white) ![Electron.js](https://img.shields.io/badge/Electron-7.2.0-191970?style=for-the-badge&logo=Electron&logoColor=white) ![windowOS](https://img.shields.io/badge/windows-10-AAA?style=for-the-badge&logo=microsoft) @@ -43,23 +43,24 @@ 2. Install **Node.js**: from offical page 3. Install **Electron Forge** using `npm` (`npm` is installed with `Node.js`) 4. In the **Terminal**, run `sudo npm i -g @electron-forge/cli`, (`sudo` requires password) +5. Install **Innoextract** from this link (Windows Only) and move it to program files and add Environment variable PATH (See [this](https://stackoverflow.com/questions/53193489/path-variable-in-environmental-variable-accepts-only-one-path) > [!NOTE] > Check your versions of `node` and `npm` in **Terminal** with `node -v`, `npm -v`. -5. Give **Star** ⭐, **Fork** this repository to your own account. Then **clone** it to your local PC +6. Give **Star** ⭐, **Fork** this repository to your own account. Then **clone** it to your local PC ### B. Elecron project -6. Open an R project with cloned repository's `.Rproj` file. -7. In your project directory (may `Github/shiny-electron-template-m1`), install **Electron** locally by running `npx create-electron-app `. +7. Open an R project with cloned repository's `.Rproj` file. +8. In your project directory (may `Github/shiny-electron-template-m1`), install **Electron** locally by running `npx create-electron-app `. > [!WARNING] > You can not use `app` as ``
> Assume using `myapp` in this tutorial -8. In your `myapp` folder, **delete** `src` directory -9. Copy (or move) below files to your `myapp` folder: +9. In your `myapp` folder, **delete** `src` directory +10. Copy (or move) below files to your `myapp` folder: - `get-r-win.sh`: For install local R for electron app. - `add-cran-binary-pkgs.R`: For install R packages into your project locally @@ -76,24 +77,24 @@ - src/loading.html - `src/main.js`: configure shiny electron app (like `width`, `height`) -10. Change your directory to new app folder `cd myapp` with **Terminal** +11. Change your directory to new app folder `cd myapp` with **Terminal** ### C. Setup R -11. Install local R with `sh ./get-r-win.sh` +12. Install local R with `sh ./get-r-win.sh` - First, check the version of R on your machine. In the R **Console**, run `version`. > [!WARNING] > **Your PC's R version** and **electron's R version** must same -12. Build `app.R` as your application's code. +13. Build `app.R` as your application's code. > [!NOTE] > not only `app.R` also other required files for shiny application (like `/www`) -13. If you don't have the `automagic` package installed, run `install.packages("automagic")` in the **console**. +14. If you don't have the `automagic` package installed, run `install.packages("automagic")` in the **console**. -14. In the Rstudio **terminal**, run `Rscript add-cran-binary-pkgs.R` to get packages for R. +15. In the Rstudio **terminal**, run `Rscript add-cran-binary-pkgs.R` to get packages for R. > [!NOTE] > If your shiny application uses not-CRAN packages (like `github` / `bioconductor`), See **Add not-CRAN packages** below. @@ -101,23 +102,23 @@ ### D. Setup electron -15. Change `package.json` as `[fix] packages-json`'s content. And modify **author** information. +16. Change `package.json` as `[fix] packages-json`'s content. And modify **author** information. > [!NOTE] > Node package's version confirmed in 2024.01 -16. Change `forge.config.js` as `[fix] forge.config.js`'s content. +17. Change `forge.config.js` as `[fix] forge.config.js`'s content. -17. Run `npm install` in **Terminal** to add new dependencies you listed in `package.json` to the **node_modules** folder. +18. Run `npm install` in **Terminal** to add new dependencies you listed in `package.json` to the **node_modules** folder. ### E. Build shiny.exe > [!NOTE] > You need to run step after this, **whenever** you want to update shiny application. -18. Test your shiny application work by `electron-forge start` in **Terminal**. +19. Test your shiny application work by `electron-forge start` in **Terminal**. -19. If the app runs successfully, congratulations! Create the `.exe`(as ZIP) on the `electron-forge make` in **Terminal**. Your app can be found in the **/out** folder. (Strongly recommend to **open with Administrator**) +20. If the app runs successfully, congratulations! Create the `.exe`(as ZIP) on the `electron-forge make` in **Terminal**. Your app can be found in the **/out** folder. (Strongly recommend to **open with Administrator**) ------------------------------------------------------------------------