locked
Why don't woks uninstall action? RRS feed

  • Question

  • I write installation package with the means of VS2008 setup projects.

    And faced with the folowing issue. I use install and uninstall actions to execute some custom installation logic. For this purpose I write assembly with installer class. Then I bound this assembly with install and uninstall actions of installation project. Installation action works fine, but uninstallation action is missed during uninstall process.

    Can anyone tell me how can I force uninstallation action working correctly during uninstall?


    Programming is a poison and it's in your and my body
    Thursday, May 5, 2011 1:13 PM

Answers

  • You don't have an uninstall custom action at all. You have an install one and a rollback one, and a rollback is NOT an uninstall.
    Phil Wilson
    • Proposed as answer by Neddy Ren Thursday, May 12, 2011 1:17 AM
    • Marked as answer by Neddy Ren Monday, May 16, 2011 3:27 AM
    Wednesday, May 11, 2011 7:56 PM
  • I've look through your project and found the issue. In the Uninstall action, you don't add the dll to the Uninstall action.

    Please double check it!

    Best Regards


    Neddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Neddy Ren Monday, May 16, 2011 3:27 AM
    Thursday, May 12, 2011 1:18 AM

All replies

  • Assuming everything else is ok, one reason that an uninstall custom action won't be called is if the internal component (like the exe) is marked permanent. Some uninstall custom actions are't strictly the product being uninstalled they're really the component being uninstalled,  and if it's not being uninstalled for some reason then it won't call it.

    Without more detail I can't say much more. What exactly does the uininstall custom action do?


    Phil Wilson
    Thursday, May 5, 2011 5:15 PM
  • Hi Mullakhmetov,

    Welcome to the MSDN Forum.

    I agree with Philwilson's suggestion. Please double check the uninstall event has been handled in the following InstallerClass:

        private void InitializeComponent()
        {
          // 
          //UnInstaller
          // 
          this.BeforeUninstall += new System.Configuration.Install.InstallEventHandler(this.SetupInstaller_BeforeUninstall);
          this.AfterUninstall += new System.Configuration.Install.InstallEventHandler(this.SetupInstaller_AfterUninstall);
    
        }
    

    Then, you can add codes to process anything in the event handler:

        private void SetupInstaller_BeforeUninstall(object sender, InstallEventArgs e)
        {<br/>    //...
        }
    
        private void SetupInstaller_AfterUninstall(object sender, InstallEventArgs e)
        {<br/>    //...
        }
    
    Best Regards
    Neddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, May 9, 2011 6:12 AM
  • Thank you for responce, dear Neddy and Phil.

    But unfortunately your advises didn't help me. I checked both of them.

    But inspite of all my efforts uninstall action doesn't run.

    So I suggest you carry out simple experiment.

    I create a simple Setup solution consist of blank uninstall setup action and setup project itself. You can download it here - http://77.246.99.141/Public/UnInstallTest.zip .

    At this solution uninstall action doesn't work during uninstallation process.

    Tell me please what is my error there and what can I change there to correct it?

    Thanks,

    Roman


    Programming is a poison and it's in your and my body
    Wednesday, May 11, 2011 3:01 PM
  • You don't have an uninstall custom action at all. You have an install one and a rollback one, and a rollback is NOT an uninstall.
    Phil Wilson
    • Proposed as answer by Neddy Ren Thursday, May 12, 2011 1:17 AM
    • Marked as answer by Neddy Ren Monday, May 16, 2011 3:27 AM
    Wednesday, May 11, 2011 7:56 PM
  • I've look through your project and found the issue. In the Uninstall action, you don't add the dll to the Uninstall action.

    Please double check it!

    Best Regards


    Neddy Ren [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Neddy Ren Monday, May 16, 2011 3:27 AM
    Thursday, May 12, 2011 1:18 AM
  • Oh!

    It's my heavy mistake.

    But nevertheless pay attention to your Russion translation - there is difficult to distinguish "uninstall" and "rollback" action on this translation.

    Sorry for misunderstanding.


    Programming is a poison and it's in your and my body
    Thursday, May 12, 2011 3:35 PM