Need a code that will check for installed programs.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Quantrac
    Indigo Rose Customer
    • Jan 2004
    • 33

    Need a code that will check for installed programs.

    Hello everyone. I'm in need of a code that will help me check to see if my program is already install before continuing to run the setup file. If the program is installed I would like the code to tell the user that they must install the previouse version and then ask if they would like to do that now. If yes selected have the code uninstall the software and continue with setup. If no selected have the code exit.

    I hope this can be done. Thanks so much!

    Amy
  • rhosk
    Indigo Rose Customer
    • Aug 2003
    • 1698

    #2
    Sure, try something along this line -

    result = File.DoesExist(_ProgramFilesFolder.."\\YourApp\\ve rsion2.exe");
    if result then
    select = Dialog.Message("Notice", "You must install the previous version first before continuing.\n\r\n\rWould you like to continue?", MB_YESNO, MB_ICONQUESTION, MB_DEFBUTTON1);
    if (select == IDYES) then
    --perform your actions here
    else
    return --or perform other action here
    end
    end

    I'm sure you get the idea.

    Or if the program you're speaking of has a registry entry, you could check there.

    HTH
    Regards,

    -Ron

    Music | Video | Pictures

    Comment

    • gabrielfenwich
      Forum Member
      • Dec 2004
      • 34

      #3
      For registry entries you could use something like this:
      path = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\EA Games\\Harry Potter and the Chamber of Secrets", "Install Dir", true);
      path = path.. "\\system"
      exists = File.DoesExist(path .. "\\game.exe");

      The above looks up a value in the registry and the returns a path.. variable
      I just used my daughters harry potter game as an example because it has a nice clear and short registry key for the install directory.
      the second line changes the path to include the "system" subdirectory
      and the third checkes to see if the file "game.exe" exists

      Hope that helps.

      ps don't forget the "\\" in the registry path

      Comment

      Working...
      X