Results 1 to 6 of 6

Thread: Detect previous install?

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Detect previous install?

    How can I tell if someone has previously installed my application on their PC? And also if possible, how can I find where they installed it?

    (This is so an autorun CD either installs, or runs the program if it's already installed...)
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  2. #2
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622
    Maybe Put somthing in the registry that doesn't get deleted by the uninstall program?
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

  3. #3

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    If the program is uninstalled I don't want to leave things behind. How would I enter something in the registry, and where?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I would just do a SaveSetting the first time the program is run. Any key not written directly by the installer should not be deleted on an uninstall.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Yeah, that's prolly a go-er. Cheers.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  6. #6
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Originally posted by rjlohan
    How can I tell if someone has previously installed my application on their PC? And also if possible, how can I find where they installed it?

    (This is so an autorun CD either installs, or runs the program if it's already installed...)
    The installer should ideally create two entries for the application in the registry:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths: The path where the application has been installed, and

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall: The uninstallation information about the application.

    If everything goes right, assuming the installer has made an entry at least in the first key (App Paths) and the user has not played around with the registry, you can check if a key exists in your application's name under the App Paths. If it exists, the application has been installed on the machine and exists. In the same key you can also get the folder where the main EXE has been installed.

    PDW creates these entries, I have no idea about other installers.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width