Packages not installing - Rlang DLL Error

With a fresh download of R and Rstudio onto a new computer I have been unable to download any packages. For context this laptop is a managed device so this could be causing issues. The location of the R library is as specified by .libPaths.

.libPaths()

[1] "C:/Users/guq25nyu/AppData/Local/R/R-4.4.3/library"

install.packages("rlang")

WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
Content type 'application/zip' length 1626730 bytes (1.6 MB)
downloaded 1.6 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\guq25nyu\AppData\Local\Temp\RtmpWWZdSv\downloaded_packages

library("rlang")

Error: package or namespace load failed for ‘rlang’:
.onLoad failed in loadNamespace() for 'rlang', details:
call: NULL
error: The rlang package is not properly installed.
The DLL version does not correspond to the package version.
Please update rlang to the latest version.
Updating packages on Windows requires precautions:
https://github.com/jennybc/what-they-forgot/issues/62

However as you can see the package is downloaded into a different folder. Despite many attempts to force Rstudio to download packages into the correct folder it always forces the files into this folder but then it won't load them using library from that folder. I have also tried to solve this error by deleting all copies of Rlang on the computer, installing and updating Rlang, reinstalling R and Rstudio, and nothing has worked

Any help would be really appreciated because I have spent many days on this and have failed to find a solution.

This is the crucial part of your error messages. You can download from RTools: Toolchains for building R and R packages from source on Windows - note that this is not a R package. If you cannot install it, you could also try install.packages( c("your", "list", "of", "packages"), type="binary") which avoids building them from source.

Hello, thanks for your comment. I have installed Rtools as well to try and solve this issue and I get the same errors (minus the Rtools prompt). Rtools shouldn't be needed to install Rlang or other basic packages anyway.

I have alos tried downloading the packages with type="binary". And that doesn't solve the error either.

With Rtools installed and installing binary packages:

install.packages("rlang", type = "binary")

trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.4/rlang_1.1.6.zip'
Content type 'application/zip' length 1626730 bytes (1.6 MB)
downloaded 1.6 MB
package ‘rlang’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\guq25nyu\AppData\Local\Temp\RtmpUf51vW\downloaded_packages

library("rlang")

Error: package or namespace load failed for ‘rlang’:
.onLoad failed in loadNamespace() for 'rlang', details:
call: NULL
error: The rlang package is not properly installed.
The DLL version does not correspond to the package version.
Please update rlang to the latest version.
Updating packages on Windows requires precautions:
https://github.com/jennybc/what-they-forgot/issues/62