Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Edson Ferreira 4 posts 109 karma points
    Dec 16, 2015 @ 13:12
    Edson Ferreira
    0

    Remove tab from Umbraco 7 Backoffice on nuget package uninstall

    My Umbraco plugin adds a tab to the Developer section of Umbraco 7 back-office and I need to remove this tab on the uninstall of the associated nuget package.

    Anyone has an idea of how this can be done ?

    PS.: For installation as a local package I have an Application Event Handler that does the adding and removing of this tab, as you can see from the code below:

        /// <summary>
        /// Applications the started.
        /// </summary>
        /// <param name="umbracoApplication">The umbraco application.</param>
        /// <param name="applicationContext">The application context.</param>
        protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
        {
            // Install
            DashboardHelper.EnsureTab("StartupDeveloperDashboardSection", "CleanUp Manager", "/App_Plugins/RB.Umbraco.CleanUpManager/Index.html");
    
            // Uninstall
            InstalledPackage.BeforeDelete += delegate
            {
                DashboardHelper.RemoveTab("StartupDeveloperDashboardSection", "CleanUp Manager");
            };
        }
    

    Bu I need to do the same when uninstalling it via nuget. Any Ideas ?

    Thanks in advance for your help.

  • David Brendel 792 posts 2970 karma points MVP 3x c-trib
    Dec 16, 2015 @ 15:56
    David Brendel
    100

    As the dashboard a located in a config file, the easiest solution would be to use a power shell script that runs in uninstall and removes the entries from the file.

    Think nuget has one which is called uninstall.ps vor something like that.

    Regards David

  • Edson Ferreira 4 posts 109 karma points
    Dec 17, 2015 @ 09:53
    Edson Ferreira
    0

    Thanks Daniel - I'll look into it.

Please Sign in or register to post replies

Write your reply to:

Draft