diff --git a/bucket/r-release.json b/bucket/r-release.json index e8a58d03f..9fc49a134 100644 --- a/bucket/r-release.json +++ b/bucket/r-release.json @@ -46,6 +46,41 @@ "Copy-Item \"$dir\\bin\\R.exe\" \"$dir\\bin\\Rscript.exe\"" ] }, + "post_install": [ + "$version_cur = [Version]\"$version\"", + "$version_40 = [Version]\"4.0.0\"", + "$version_42 = [Version]\"4.2.0\"", + "if ($version_cur -lt $version_40) {", + " if ($architecture -eq '32bit') {", + " $pathenv = 'PATH=\"${RTOOLS35_HOME-C:/Rtools}/bin;${RTOOLS35_HOME-C:/Rtools}/mingw_32/bin;${PATH}\"'", + " } else {", + " $pathenv = 'PATH=\"${RTOOLS35_HOME-C:/Rtools}/bin;${RTOOLS35_HOME-C:/Rtools}/mingw_64/bin;${PATH}\"'", + " }", + " [IO.File]::WriteAllLines(\"$dir\\etc\\Renviron.site\", $pathenv)", + "}", + "if (($version_cur -lt $version_42) -and ($version_cur -ge $version_40)) {", + " $pathenv = 'PATH=\"${RTOOLS40_HOME-C:/rtools40}/usr/bin;${PATH}\"'", + " [IO.File]::WriteAllLines(\"$dir\\etc\\Renviron.site\", $pathenv)", + "}", + "$original_dir_path = \"$original_dir\".Replace('\\', '\\\\')", + "'install-context', 'uninstall-context' | ForEach-Object {", + " if (Test-Path \"$bucketsdir\\r-bucket\\config\\R\\$_.reg\") {", + " $content = Get-Content \"$bucketsdir\\r-bucket\\config\\R\\$_.reg\"", + " $content = $content.Replace('$roriginal_dir', $original_dir_path)", + " $content = $content.Replace('$rversion', $version)", + " if ($global) {", + " $content = $content.Replace('HKEY_CURRENT_USER', 'HKEY_LOCAL_MACHINE')", + " }", + " $content | Set-Content -Path \"$dir\\$_.reg\"", + " }", + "}", + "reg import \"$dir\\install-context.reg\"" + ], + "uninstaller": { + "script": [ + "reg import \"$dir\\uninstall-context.reg\"" + ] + }, "notes": [ "For source packages installation, you will need to install Rtools if not already present, and add to PATH in your .Renviron: https://cran.r-project.org/bin/windows/Rtools", "", diff --git a/bucket/rtools40.json b/bucket/rtools40.json new file mode 100644 index 000000000..6d61d1b7c --- /dev/null +++ b/bucket/rtools40.json @@ -0,0 +1,60 @@ +{ + "version": "2022-02-06", + "description": "Tools for building packages for R under Microsoft Windows, or for building R itself.", + "homepage": "https://cloud.r-project.org/bin/windows/Rtools", + "license": "BSD-3-Clause", + "notes": "For R 3.3.x to 3.6.x, please use 'versions/rtools35'.", + "architecture": { + "64bit": { + "url": "https://github.com/r-windows/rtools-installer/releases/download/2022-02-06/rtools40-x86_64.exe", + "hash": "6f6b363ee7c7e58aaa51e58f37f910226e60f0dfd47417106250b5ce4d1c2727" + } + }, + "innosetup": true, + "installer": { + "script": [ + "function CreateFolder([String] $FolderName) {", + " if (-not (Test-Path $dir\\$FolderName)) {", + " Write-Host \"Creating Folder $FolderName\"", + " New-Item $dir\\$FolderName -ItemType Directory", + " }", + "}", + "CreateFolder 'tmp'", + "CreateFolder 'dev'" + ] + }, + "env_set": { + "RTOOLS40_HOME": "$dir" + }, + "shortcuts": [ + [ + "msys2.exe", + "Rtools40/Rtools40 Bash" + ], + [ + "mingw64.exe", + "Rtools40/Rtools40 MinGW 64-bit" + ], + [ + "ucrt64.exe", + "Rtools40/Rtools40 UCRT 64-bit" + ] + ], + "persist": [ + "mingw32.ini", + "mingw64.ini", + "ucrt64.ini", + "msys2.ini" + ], + "checkver": { + "github": "https://github.com/r-windows/rtools-installer", + "regex": "\\/releases\\/tag\\/(?:v|V)?([\\d-]+)" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://github.com/r-windows/rtools-installer/releases/download/$version/rtools40-x86_64.exe" + } + } + } +} diff --git a/bucket/rtools42.json b/bucket/rtools42.json new file mode 100644 index 000000000..61a8266ac --- /dev/null +++ b/bucket/rtools42.json @@ -0,0 +1,66 @@ +{ + "version": "5355-5357", + "description": "Tools for building packages for R under Microsoft Windows, or for building R itself.", + "homepage": "https://cran.r-project.org/bin/windows/Rtools/rtools42/rtools.html", + "license": "BSD-3-Clause", + "notes": [ + "For R 3.3.x to 3.6.x, please use 'versions/rtools35'.", + "for R-4.0.0 to to R-4.1.3, please use 'r-bucket/rtools40'." + ], + "architecture": { + "64bit": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-5355-5357.exe", + "hash": "98205dd8bd703a7c867d182a83e361c76014520dca7393142d8e7a0c4ef03097" + } + }, + "innosetup": true, + "installer": { + "script": [ + "function CreateFolder([String] $FolderName) {", + " if (-not (Test-Path $dir\\$FolderName)) {", + " Write-Host \"Creating Folder $FolderName\"", + " New-Item $dir\\$FolderName -ItemType Directory", + " }", + "}", + "CreateFolder 'tmp'", + "CreateFolder 'dev'" + ] + }, + "env_set": { + "RTOOLS42_HOME": "$dir" + }, + "shortcuts": [ + [ + "msys2.exe", + "Rtools42/Rtools42 Bash" + ], + [ + "mingw64.exe", + "Rtools42/Rtools42 MinGW 64-bit" + ], + [ + "ucrt64.exe", + "Rtools42/Rtools42 UCRT 64-bit" + ] + ], + "persist": [ + "mingw32.ini", + "mingw64.ini", + "ucrt64.ini", + "msys2.ini" + ], + "checkver": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools42/files/", + "regex": "rtools42-([\\d-]+)\\.exe" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools42/files/rtools42-$version.exe", + "hash": { + "mode": "download" + } + } + } + } +} diff --git a/bucket/rtools43.json b/bucket/rtools43.json new file mode 100644 index 000000000..9e39ae006 --- /dev/null +++ b/bucket/rtools43.json @@ -0,0 +1,67 @@ +{ + "version": "5976-5975", + "description": "Tools for building packages for R under Microsoft Windows, or for building R itself.", + "homepage": "https://cran.r-project.org/bin/windows/Rtools/rtools43/rtools.html", + "license": "BSD-3-Clause", + "notes": [ + "For R 3.3.x to 3.6.x, please use 'versions/rtools35'.", + "for R-4.0.0 to to R-4.1.3, please use 'r-bucket/rtools40'.", + "for R 4.2.*, please use 'r-bucket/rtools42'." + ], + "architecture": { + "64bit": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-5976-5975.exe", + "hash": "2a7c87c224f16ef173f0f6c2ba83a95f8d1ce3c854ab47cf53e21412bd173906" + } + }, + "innosetup": true, + "installer": { + "script": [ + "function CreateFolder([String] $FolderName) {", + " if (-not (Test-Path $dir\\$FolderName)) {", + " Write-Host \"Creating Folder $FolderName\"", + " New-Item $dir\\$FolderName -ItemType Directory", + " }", + "}", + "CreateFolder 'tmp'", + "CreateFolder 'dev'" + ] + }, + "env_set": { + "RTOOLS43_HOME": "$dir" + }, + "shortcuts": [ + [ + "msys2.exe", + "Rtools43/Rtools43 Bash" + ], + [ + "mingw64.exe", + "Rtools43/Rtools43 MinGW 64-bit" + ], + [ + "ucrt64.exe", + "Rtools43/Rtools43 UCRT 64-bit" + ] + ], + "persist": [ + "mingw32.ini", + "mingw64.ini", + "ucrt64.ini", + "msys2.ini" + ], + "checkver": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools43/files/", + "regex": "rtools43-([\\d-]+)\\.exe" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools43/files/rtools43-$version.exe", + "hash": { + "mode": "download" + } + } + } + } +} diff --git a/bucket/rtools44.json b/bucket/rtools44.json new file mode 100644 index 000000000..168366822 --- /dev/null +++ b/bucket/rtools44.json @@ -0,0 +1,72 @@ +{ + "version": "6459-6401", + "description": "Tools for building packages for R under Microsoft Windows, or for building R itself.", + "homepage": "https://cran.r-project.org/bin/windows/Rtools/rtools44/rtools.html", + "license": "BSD-3-Clause", + "notes": [ + "For R 3.3.x to 3.6.x, please use 'versions/rtools35';", + "for R-4.0.0 to to R-4.1.3, please use 'r-bucket/rtools40';", + "for R 4.2.*, please use 'r-bucket/rtools42';", + "for R 4.3.*, please use 'r-bucket/rtools43'." + ], + "architecture": { + "64bit": { + "url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-6459-6401.exe", + "hash": "de9602992848faaeddca41f118dd6dc3de9bbfb00b8d87ebe5522af1dad1904b" + }, + "arm64": { + "url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-aarch64-6459-6401.exe", + "hash": "8d7104523f11a4e1a8c3ff4b78ace665cbcc54ed032a6c679574f55cd128f13f" + } + }, + "innosetup": true, + "installer": { + "script": [ + "function CreateFolder([String] $FolderName) {", + " if (-not (Test-Path $dir\\$FolderName)) {", + " Write-Host \"Creating Folder $FolderName\"", + " New-Item $dir\\$FolderName -ItemType Directory", + " }", + "}", + "CreateFolder 'tmp'", + "CreateFolder 'dev'" + ] + }, + "env_set": { + "RTOOLS44_HOME": "$dir" + }, + "shortcuts": [ + [ + "msys2.exe", + "Rtools44/Rtools44 Bash" + ], + [ + "mingw64.exe", + "Rtools44/Rtools44 MinGW 64-bit" + ], + [ + "ucrt64.exe", + "Rtools44/Rtools44 UCRT 64-bit" + ] + ], + "persist": [ + "mingw32.ini", + "mingw64.ini", + "ucrt64.ini", + "msys2.ini" + ], + "checkver": { + "url": "https://cran.r-project.org/bin/windows/Rtools/rtools44/files/", + "regex": "rtools44-([\\d-]+)\\.exe" + }, + "autoupdate": { + "architecture": { + "64bit": { + "url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-$version.exe" + }, + "arm64": { + "url": "https://cloud.r-project.org/bin/windows/Rtools/rtools44/files/rtools44-aarch64-$version.exe" + } + } + } +} diff --git a/config/R/install-context.reg b/config/R/install-context.reg new file mode 100644 index 000000000..48a22c102 --- /dev/null +++ b/config/R/install-context.reg @@ -0,0 +1,4 @@ +Windows Registry Editor Version 5.00 + +[HKEY_CURRENT_USER\SOFTWARE\R-core\R\$rversion] +"InstallPath"="$roriginal_dir" diff --git a/config/R/uninstall-context.reg b/config/R/uninstall-context.reg new file mode 100644 index 000000000..b8e5f76e4 --- /dev/null +++ b/config/R/uninstall-context.reg @@ -0,0 +1,3 @@ +Windows Registry Editor Version 5.00 + +[-HKEY_CURRENT_USER\SOFTWARE\R-core\R\$rversion]