Some questions/solutions I found on here were similar but not quite what I needed.
I'm trying to create an installer for a python application I've created for Windows. The installer calls another installer (openscad_installer.exe) and the user has the choice to install that wherever they like (i.e. I don't know the destination and would need to be able to find it) or not to install it at all.
I essentially need to check if the openscad.exe file exists (i.e. if it is installed) anywhere on the computer (in the C: drive) and if it does not exist then I need to uninstall my software.
The uninstall process seems simple enough but I don't know how to find out if the file exists. Thanks for the help.
Searching the file in
C:
drive (and possibly any other drive, as an user may choose to install a software anywhere else) is doable, but can take ages.I'd suggest you instead check for an existence of the
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenSCAD
registry key:If you need to know the installation location, read and parse the
UninstallString
value:If you insist on searching for
openscad.exe
use: