pls i want to know if there is a way of telling inno setup to check for previous version of the app that is about to be installed?

say for like checking the Program Files directory for a folder that has the name of the app.