I don't think what you suggested is working the way I wanted, so let me explain a little better.
At work we created a C# desktop app that uploads files to our system. This tool is very old and installs into the C:\Program Files (x86) folder, which sometimes causes issues because it creates files and if the User doesn't have the correct permissions, those files won't be created. Ideally, we'd code the app to use the User Data folders to store these files, but we can't make that change right now, so I was looking for a way to change our InnoSetup project to remove the prior version, no matter where it's installed, then install the new version into a completely different folder, typically right on the C:\ drive, which isn't ideal, but it works.
The older installer had an AppName of "File Queue Upload Client" and the new installer has an AppName of "File Queue Uploader". Not a major change, but still a change. Also, the new installer contains a new DefaultDirName setting, as mentioned above.
When I changed the new installer to set the AppId equal to the old installers AppName of "File Queue Upload Client" and ran the new installer, as you suggested, it simply installed the new app into the new DefaultDirName location and shows as a separate app in Control Panel > Add/Remove Programs. It never touched the old install.
After searching online I did find
some examples that used a GetUninstallString method and
UnInstallOldVersion method to determine the prior install details, then uninstall it silently, but I wasn't able to wrap my brain around what the GetUninstallString was doing to determine the old version to uninstall.
Is there something else I am missing with the solution you suggested or should I be using the the other method I linked above?