Uninstall multiple versions of R (No registry uninstaller entries)

Hey there Pete. Since actionscript doesn’t support looping, for this job you will need to use the technique outlined here.

parameter "TempScript" = "{value of variable "Temp" of environment}\R-BeGone.bat"
appendfile {concatenation "%0d%0a" of (("%22" & it & "\unins000.exe%22 /verysilent && rmdir /s /q %22" & it & "%22") of unique values of pathnames of folders of folder "R" of program files x64 folder)}
appendfile exit /b
delete "{parameter "TempScript"}"
move __appendfile "{parameter "TempScript"}"
waithidden "{parameter "TempScript"}"
delete "{parameter "TempScript"}"

This should result in a batch file with the following contents:

"C:\Program Files\R\R-3.2.0\unins000.exe" /verysilent && rmdir /s /q "C:\Program Files\R\R-3.2.0"
"C:\Program Files\R\R-3.4.2\unins000.exe" /verysilent && rmdir /s /q "C:\Program Files\R\R-3.4.2"
"C:\Program Files\R\R-3.5.2\unins000.exe" /verysilent && rmdir /s /q "C:\Program Files\R\R-3.5.2"
exit /b

Let me know if you run into any issues. When I was testing this I found the uninstaller left the empty “R-version” folder behind, so I had to add the rmdir command also for a clean uninstall.

I was thinking that it might be also handy to mod this to leave the “newest” installation alone. If that would be useful, we can look into that also.

2 Likes