-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1037 from africanmathsinitiative/master
merge from main
- Loading branch information
Showing
9 changed files
with
377 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Installer Generation Guide | ||
|
||
To generate the installer for R-Instat with R bundled inside and all the R packages pre-installed requires a few steps. | ||
|
||
## Step 1: Build R-Instat from Visual Studio | ||
|
||
You will have to repeat this step for generating 32 bit and 64 bit binaries. | ||
- In Visual Studio open the R-Instat solution. | ||
- To the left of the Start button are two dropdowns. | ||
- Select Release for the first dropdown | ||
- Select x86 for 32 bit build, and x64 for 64 bit build. | ||
- Check that clsRLink.vb is pointing to the version of R you plan to bundle | ||
``` | ||
Private strRBundledVersion As String = "3.6.2" | ||
``` | ||
|
||
## Step 2: Generate Bundled R Install | ||
|
||
Once you have built release binaries of R-Instat: | ||
1. Open cmd.exe as an Administrator | ||
2. cd to the the bin folder with the Release binaries. It will probably look similar to C:/Users/YourName/source/repos/R-Instat/instat/bin/Release | ||
or for 64 bit /R-Instat/instat/bin/x64/Release | ||
3. Then cd into the static folder (e.g R-Instat/instat/bin/Release/static) | ||
4. Download the R installer EXE from (https://cran.r-project.org/bin/windows/base/R-3.6.2-win.exe) and save into this directory | ||
5. Run the installer using | ||
``` | ||
R-3.6.2-win.exe /DIR="./R-3.6.2" | ||
``` | ||
6. Go through the install process. Choose custom install and deselect either 32 bit or 64 bit. (If you're building for 32 bit then exclude 64 bit). | ||
|
||
## Step 3: Install R packages inside bundled R | ||
|
||
1. Cd into the R folder you just installed ./R-3.6.2/bin | ||
2. Run R.exe | ||
3. Run the install_bundled_packages.R script in the same folder as this Readme. | ||
4. The ncdf4.helpers package required a custom version, you can download it from here: https://drive.google.com/file/d/1UqwqVDxMvlHNocUa0i6uiGFT24zwGdgB/view?usp=sharing | ||
Once you've downloaded that zip file, extract the ncdf4.helpers folder into the ./R-3.6.2/library folder | ||
|
||
## Step 4: Build Installer EXE using Inno Setup | ||
|
||
1. Install Inno Setup from here: https://www.jrsoftware.org/isdl.php | ||
2. Scroll down and select innosetup-6.0.3.exe (or a newer version) | ||
3. Open the Inno Script Compiler from the start menu | ||
4. From the file menu choose open | ||
5. Then navigate to the inno_install_script_32bit.iss script (or 64 bit version) in the same folder as this readme. | ||
6. From the top menu choose compile. | ||
7. The installer should be in installer/Output folder | ||
|
||
## Bundling a newer version of R | ||
|
||
If you want to bundle a newer version of R (after discussing with the team the consequences of that) you'll need to change the following files: | ||
- clsRLink.vb | ||
- inno_install_script_32bit.iss | ||
- inno_install_script_36bit.iss | ||
- Installer_Generation_Guide.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
; Script generated by the Inno Script Studio Wizard. | ||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | ||
|
||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. | ||
; Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{4263A8D4-1068-45F9-A542-C340C4A22E8B} | ||
AppName=R-Instat | ||
#define AppVerName "0.56" | ||
AppVersion={#AppVerName} | ||
AppPublisher=African Maths Institute | ||
AppPublisherURL=http://r-instat.org/ | ||
AppSupportURL=http://r-instat.org/ | ||
AppUpdatesURL=http://r-instat.org/ | ||
DefaultDirName={autopf}\R-Instat\{#AppVerName} | ||
DefaultGroupName=R-Instat | ||
AllowNoIcons=yes | ||
OutputBaseFilename=R-Instat_{#AppVerName}_Installer_32 | ||
SetupIconFile=..\instat\Resources\rinstat_icon_Hih_icon.ico | ||
Compression=lzma | ||
SolidCompression=yes | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | ||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 | ||
|
||
[Files] | ||
Source: "..\instat\bin\Release\instat.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "..\instat\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
|
||
[Icons] | ||
Name: "{group}\R-Instat"; Filename: "{app}\instat.exe" | ||
Name: "{group}\{cm:UninstallProgram,R-Instat}"; Filename: "{uninstallexe}" | ||
Name: "{commondesktop}\R-Instat"; Filename: "{app}\instat.exe"; Tasks: desktopicon | ||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon | ||
|
||
[Run] | ||
Filename: "{app}\instat.exe"; Description: "{cm:LaunchProgram,R-Instat}"; Flags: nowait postinstall skipifsilent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
; Script generated by the Inno Script Studio Wizard. | ||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! | ||
|
||
[Setup] | ||
; NOTE: The value of AppId uniquely identifies this application. | ||
; Do not use the same AppId value in installers for other applications. | ||
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) | ||
AppId={{4263A8D4-1068-45F9-A542-C340C4A22E8B} | ||
AppName=R-Instat | ||
#define AppVerName "0.56" | ||
AppVersion={#AppVerName} | ||
AppPublisher=African Maths Institute | ||
AppPublisherURL=http://r-instat.org/ | ||
AppSupportURL=http://r-instat.org/ | ||
AppUpdatesURL=http://r-instat.org/ | ||
DefaultDirName={autopf}\R-Instat\{#AppVerName} | ||
DefaultGroupName=R-Instat | ||
AllowNoIcons=yes | ||
OutputBaseFilename=R-Instat_{#AppVerName}_Installer_64 | ||
SetupIconFile=..\instat\Resources\rinstat_icon_Hih_icon.ico | ||
Compression=lzma | ||
SolidCompression=yes | ||
ArchitecturesInstallIn64BitMode=x64 | ||
|
||
[Tasks] | ||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | ||
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1 | ||
|
||
[Files] | ||
Source: "..\instat\bin\x64\Release\instat.exe"; DestDir: "{app}"; Flags: ignoreversion | ||
Source: "..\instat\bin\x64\Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs | ||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files | ||
|
||
[Icons] | ||
Name: "{group}\R-Instat"; Filename: "{app}\instat.exe" | ||
Name: "{group}\{cm:UninstallProgram,R-Instat}"; Filename: "{uninstallexe}" | ||
Name: "{commondesktop}\R-Instat"; Filename: "{app}\instat.exe"; Tasks: desktopicon | ||
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\R-Instat"; Filename: "{app}\instat.exe"; Tasks: quicklaunchicon | ||
|
||
[Run] | ||
Filename: "{app}\instat.exe"; Description: "{cm:LaunchProgram,R-Instat}"; Flags: nowait postinstall skipifsilent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
install.packages("miniCRAN") | ||
|
||
core_pkgs <- c("reshape2", "lubridate","plyr", "dplyr", "rtf", "openxlsx", "ggplot2", | ||
"extRemes", "GGally", "agridat", "FactoMineR", "plotrix", "candisc", "R6", | ||
"openair", "circular", "survival", "Evapotranspiration", "clifro", "devtools", | ||
"factoextra", "circlize", "CircStats", "gridExtra", "ggfortify", "rio", | ||
"readxl", "lme4", "dummies", "ggthemes", "lazyeval", "stringr", "httr", | ||
"jsonlite", "fitdistrplus", "visreg", "climdex.pcic", "mosaic", "ncdf4", | ||
"getPass", "RMySQL", "DBI", "EnvStats", "signmedian.test", "sjPlot", | ||
"sjmisc", "plotly", "svglite", "htmlTable", "rje", "tidyr", "faraway", | ||
"ncdf.tools", "rrefine", "dae", "gapminder", "questionr", "nycflights13", | ||
"Lahman", "RcppRoll", "cmsaf", "sjlabelled", "maptools", "RColorBrewer", | ||
"colorRamps", "mapdata", "rworldmap", "rworldxtra", "e1071", "robustbase", | ||
"wakefield", "Hmisc", "SPEI", "agricolae", "sf", "weathermetrics", | ||
"geosphere", "ggmosaic", "readODS", "ggalt", "ggpmisc", "treemapify", | ||
"hydroGOF", "hydroTSM", "verification", "DescTools", | ||
"PCICt", "abind") # Added because of ncdf4.helpers | ||
# You must unzip ncdf4.helpers folder into library folder manually | ||
# Download from here https://drive.google.com/file/d/1UqwqVDxMvlHNocUa0i6uiGFT24zwGdgB/view?usp=sharing | ||
|
||
pkgList <- miniCRAN::pkgDep(core_pkgs, type = "win.binary", repos = "https://cran.rstudio.com/", | ||
suggests = FALSE, includeBasePkgs = TRUE, Rversion = "3.6") | ||
|
||
install.packages(pkgList, lib = "../library", | ||
repos = "https://cran.rstudio.com/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.