/// <summary> /// Register Install & Uninstall Events /// </summary> /// <param name="umbracoApplication"></param> /// <param name="applicationContext"></param> protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { //Check to see if appSetting AnalyticsStartupInstalled is true or even present var installAppSetting = WebConfigurationManager.AppSettings[InstallHelpers.AppSettingKey]; if (string.IsNullOrEmpty(installAppSetting) || installAppSetting != true.ToString()) { //Check to see if language keys for section needs to be added InstallHelpers.AddTranslations(); //Check to see if section needs to be added InstallHelpers.AddSection(applicationContext); //Add Section Dashboard XML InstallHelpers.AddSectionDashboard(); InstallHelpers.AddHttpModule(); // we can't do this here (nodes not exists yet): //InstallHelpers.PublishContentNodes(); //InstallHelpers.AddAppConfigSections(); } //Add OLD Style Package Event InstalledPackage.BeforeDelete += InstalledPackage_BeforeDelete; //Add Tree Node Rendering Event - Used to check if user is admin to display settings node in tree TreeControllerBase.TreeNodesRendering += TreeControllerBase_TreeNodesRendering; }
/// <summary> /// Uninstall Package - Before Delete (Old style events, no V6/V7 equivelant) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void InstalledPackage_BeforeDelete(InstalledPackage sender, System.EventArgs e) { //Check which package is being uninstalled if (sender.Data.Name.ToLower() == "ultima") { //Start Uninstall - clean up process... InstallHelpers.RemoveAppConfigSections(); InstallHelpers.RemoveHttpModule(); } }
/// <summary> /// Register Install & Uninstall Events /// </summary> /// <param name="umbracoApplication"></param> /// <param name="applicationContext"></param> protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext) { //Check to see if appSetting Ultima2c is true or even present var installAppSetting = WebConfigurationManager.AppSettings[InstallHelpers.AppSettingKey]; if (string.IsNullOrEmpty(installAppSetting) || installAppSetting != true.ToString()) { //Check to see if language keys for section needs to be added InstallHelpers.AddHttpModule(); // we can't do this here (nodes not exists yet): //InstallHelpers.PublishContentNodes(); //InstallHelpers.AddAppConfigSections(); InstalledPackage.AfterSave += InstalledPackage_AfterSave; } //Add OLD Style Package Event InstalledPackage.BeforeDelete += InstalledPackage_BeforeDelete; }
private void InstalledPackage_AfterSave(InstalledPackage sender, EventArgs e) { InstallHelpers.PublishContentNodes(); InstallHelpers.AddAppConfigSections(); }