Uninstalling a program from code

Posted on 2005-04-22
Last Modified: 2010-05-02
I'm using Visual Basic 6.  What I am trying to do is write a utility/routine to uninstall my program and then reinstall it from a specified location where I post updated install packages for the program.

Can someone show me some code or point me in the right direction for how to uninstall a program from code?

Question by:AaronNance
    LVL 11

    Expert Comment

    Define "uninstall"...

    Has you program registered dll's or added it's self to the add/remove program list?

    If not - there really isn't any uninstalling necessary - just delete the original .exe and save the new one.
    LVL 1

    Author Comment

    There are a number of DLLs and it is in the Add/Remove Programs list.  If there was a way to trigger the add/remove program functionality then I think that would probably be the answer I need, however I don't how to do it or if it is possible.
    LVL 9

    Accepted Solution

    the best way to do is to create an exe, in that exe
    1) u will first download all the required files and then
    2) close all running applications tht are using ur application
    3) unregister the dll (old), delete all references
    4) register new dlls, update ur application
    5) and its done

    to call your dlls u need to enter your exe name in the uninstall string in the
    and in the
    write the path of ur updater exe

    M.Naveen Swamy

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    Introduction While answering a recent question ( in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    732 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now