Copied to clipboard

Flag this post as spam?

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


  • Rick Noelle 10 posts 43 karma points
    Sep 15, 2010 @ 00:05
    Rick Noelle
    0

    Trigger App Reload on Package Install

    I've created a custom package with various components. Among them is a new icon in the app tray (a.k.a. sections area). After installing the package, I can navigate to the new section but I cannot see the tree nodes until I force an app reload by manually altering the web.config. Typically I just add a line blank line to web.config and save it. I was hoping to find a way to automate this when my package gets installed. 

    Thanks,

    Rick

  • Rick Noelle 10 posts 43 karma points
    Sep 21, 2010 @ 16:42
    Rick Noelle
    0

    I'm still working on this. I thought I found a solution but it caused another issue. I tried having a controller that gets called after install add a key to the web.config. Something like this:

      if (!IsPostBack)
      {               
          Log.Add(LogTypes.Debug, -1, "Adding web.config app setting identifying installation of our package.");
          Configuration c = WebConfigurationManager.OpenWebConfiguration("~");
          AppSettingsSection appSettings = c.AppSettings;
          appSettings.Settings.Add("MyPackage", "true");
          c.Save(ConfigurationSaveMode.Full);
       }
    

    This works to trigger an app reload but it causes my package uninstall actions to be ignored. I have a custom uninstall action that removes database entries specific to my package. If I use the web.config update code, the database code never gets called (on uninstall). If I don't update the web.config, it gets called. I guess reloading the web.config interrupts the package install process before it has had a chance to log the uninstall actions. So still stuck but making some progress. Hope to post the solution here eventually. :-)

  • Rick Noelle 10 posts 43 karma points
    Sep 21, 2010 @ 18:00
    Rick Noelle
    0

    Hmm, turns out that any edit to web.config whether during package install or at any random time thereafter nulls my custom uninstall action. I suspect this is a bug in the package installer. I'm going to put together a simple test package to reproduce the behavior and submit it.

  • Rick Noelle 10 posts 43 karma points
    Sep 22, 2010 @ 19:37
    Rick Noelle
    0

    I submitted a bug based on what I have found http://bit.ly/bCKrt1 ;

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Sep 22, 2010 @ 20:10
    Dirk De Grave
    0

    Always report bugs on Codeplex, this forum category is for forum bugs only (ie, the umbraco code this forum is running on)

    Anyway, thanks for all the work and feedback.

    Cheers,

    /Dirk

  • Rick Noelle 10 posts 43 karma points
    Sep 22, 2010 @ 21:15
    Rick Noelle
    0

    Good to know, thanks! I have added it to Codeplex http://umbraco.codeplex.com/workitem/28945 and will use Codeplex from now on for bugs.

Please Sign in or register to post replies

Write your reply to:

Draft