Archive: IfFileExists Questions


I got the VB6 runtime install fixed.

Now I just can't seem to get the right code. I want to:

1. Detect a previous file "adjuster.exe"
2. Alert the user with a OK/CANCEL box.
3. If the user uses OK the install continues.
4. If the user uses CANCEL the install aborts.

Thanks for the help.


[Edited by cablenut on 05-31-2001 at 06:36 PM]


Ok I figured it out. This probably isn't the most optimal but the only way I could figure out how to do it.

IfFileExists "$INSTDIR\adjuster.exe" 0 NoAdjuster
MessageBox MB_OKCANCEL|MB_ICONINFORMATION "Note: A previous installation of CableNut was detected.$\nIt is recommended you uninstall any previous version of CableNut before continuing." IDOK Instcont
FindWindowByTitle "close" "CableNut 4.02 Setup: Installing Files"
FindWindowByTitle "close" "CableNut 4.02 Setup"
Abort
Instcont:
Nop
NoAdjuster:
Nop
Man I love that Nop :)


You don't need the nop...

-J