locked
installState file is not removed by the uninstall action RRS feed

  • Question

  • Hello there!

    I have the following problem:

    I created a custom install class that is accessed by a setup project. So far so good. The problem appears after I uninstall my application ... the file named myCustomInstallClassName.installstate is not removed by the uninstall action.

    Is there any way I can solve this? What is that installstate file usefull for anyway?

    Thanks a lot.
    Thursday, September 29, 2005 1:04 PM

All replies

  • Roxana, the installstate file is created by the installer base class.  It creates this file during the install custom action and removes it during the uninstall custom action.  even if you have not implimented the Uninstall custom action you should call it which will call the base class and delete the installstate file.  If you are calling it make sure you have the code line:

    MyBase.Uninstall(savedState)

    in the Uninstall Method.

    Thursday, October 6, 2005 6:13 PM
  • I managed to solve the problem: I added the installer to Uninstall custom action also and it does all the neccessary job.

    Thanks for your reply.

    Roxana.
    Saturday, October 15, 2005 1:20 PM
  • Hi Roxana....can you please clarify/elaborate "I added the installer to Uninstall custom action..."

    I have the exact same scenario, custom action with installer class being implemented.  I'm sure if you mean you added a custom action under Uninstall which also calls your installer class.  Would that not try to execute the entire class during an uninstall?  Or did you create an additional installer class that's only called curing the Uninstall custom action?  Sorry, I'm a newbie...any help would be appreciated.

    Signed,

    Confused

    Friday, May 5, 2006 2:19 PM
  • Hi Todd...thanks for the answer on this.  Would you please elaborate on "...even if you have not implemented the Uninstall custom action you should call it..." 

    Am I correct in assuming that I should add a custom action under "Uninstall" which calls a different Installer Class (than my Install custom action Install class call) which contains only the line:

    Mybase.Uninstall(savedState)

    Any help is greatly appreciated.  Thanks in advance!

    Friday, May 5, 2006 2:26 PM
  • You have an installer class in an assembly. That installer base class contains Install, Uninstall, Commit and Rollback methods. You should really arrange to call them all by right-clicking on the Custom Actions node and adding the assembly rather than adding just to the install or uninstall nodes. Your installer class methods are overrides, so you don't need to call base.Uninstall() unless you override and extend the Uninstall method. The infrastructure that calls the installer class methods is going to call the methods anyway if you've added them all, and it will call the base method if you didn't override it. If you *do* override it, you need to call base.<Method>.  So you should be using the *same* installer class for Install, Uninstall, Rollback, Commit.

    Internally Visual Studio adds a condition to each of those custom action calls such that the appropriate methods get called at the right time (Uninstall is called when you're uninstalling).

    Monday, May 8, 2006 11:30 PM
  • Sweet! :)  Makes complete sense now.  I had only called my custom action for the Install not Uninstall.  I added it to all the other events and it worked fine.  My directory and all the files were uninstalled.  Thanks for taking the time to draft a complete, easy to follow explaination.  Sorry I took so long to respond.  I never recevied a notification that you replied.

    Coder_man

    Friday, May 12, 2006 5:08 PM