RStudio can't find R

Non-programmer here struggling to get RStudio to work with an updated version of R. I hadn't updated R in a while, and when I did so to 4.5.1, I found it won't run due to a Temp directory space issue (I'm on Windows, and my username has a space in it). I resolved this by creating an .Renviron file that says:

TMPDIR=C:/RTemp
TEMP=C:/RTemp
TMP=C:/RTemp

This worked, but when I run RStudio 2025.09.1 or 2025.09.0, it won't open and says "Could not locate an R installation on the system." Everything is installed in the standard places in Program Files--I previously tried installing R in C://R but that didn't resolve things. More background info on what I was trying here: https://stackoverflow.com/questions/79784087/rstudio-not-updating-to-new-r-version-or-downloading-packages-windows-username?noredirect=1#comment140780910_79784087. Since then I've completely uninstalled and reinstalled R and RStudio a few times (including deleting the various %appdata% folders I believe I was supposed to delete).

Apologies if this question has been asked before---I know a similar issue was noted a few years ago but haven't been able to find the solution.