protected void wizInstall_CancelButtonClick(object sender, EventArgs e) { try { lstAvailableModules = (List <ModuleInfo>)ViewState["FinalModuleList"]; if (lstAvailableModules != null) { foreach (ModuleInfo module in lstAvailableModules) { if (module != null) { installhelp.DeleteTempDirectory(module.TempFolderPath + "\\" + module.FolderName); } } } ViewState["FinalModuleList"] = null; ViewState["AvailableModuleList"] = null; ReturnBack(); } catch (Exception ex) { ProcessException(ex); } }
protected void wizInstall_CancelButtonClick(object sender, EventArgs e) { try { module = (ModuleInfo)ViewState["ModuleInfo"]; if (module != null) { installhelp.DeleteTempDirectory(module.TempFolderPath); ViewState["ModuleInfo"] = null; } else { CompositeModule package = (CompositeModule)ViewState["CompositeModule"]; if (package != null) { installhelp.DeleteTempDirectory(package.TempFolderPath); ViewState["CompositeModule"] = null; } } //Redirect to Definitions page ReturnBack(); } catch (Exception ex) { ProcessException(ex); } }
protected void wizInstall_CancelButtonClick(object sender, EventArgs e) { try { wizInstall.ActiveStepIndex = 0; module = (ModuleInfo)ViewState["ModuleInfo"]; if (module != null) { installhelp.DeleteTempDirectory(module.TempFolderPath); ViewState["ModuleInfo"] = null; } else { CompositeModule package = (CompositeModule)ViewState["CompositeModule"]; if (package != null) { installhelp.DeleteTempDirectory(package.TempFolderPath); ViewState["CompositeModule"] = null; } } if (Directory.Exists(Server.MapPath("~/Install/Temp/"))) { installhelp.DeleteTempDirectory(Server.MapPath("~/Install/Temp/")); } //Redirect to Definitions page ReturnBack(); } catch (Exception ex) { ProcessException(ex); } }
private void UninstallModule() { ModuleInfo module = new ModuleInfo(); Installers installerClass = new Installers(); string path = HttpContext.Current.Server.MapPath("~/"); //checked if directory exist for current module foldername if (!string.IsNullOrEmpty(txtFolderName.Text)) { string moduleFolderPath = path + SageFrame.Core.RegisterModule.Common.ModuleFolder + '\\' + txtFolderName.Text; if (Directory.Exists(moduleFolderPath)) { //check for valid .sfe file exist or not if (installerClass.checkFormanifestFile(moduleFolderPath, module) != "") { XmlDocument doc = new XmlDocument(); doc.Load(moduleFolderPath + '\\' + module.ManifestFile); XmlElement root = doc.DocumentElement; if (installerClass.checkValidManifestFile(root, module)) { XmlNodeList xnList = doc.SelectNodes("sageframe/folders/folder"); foreach (XmlNode xn in xnList) { module.ModuleName = xn["modulename"].InnerXml.ToString(); module.FolderName = xn["foldername"].InnerXml.ToString(); if (!String.IsNullOrEmpty(module.ModuleName) && !String.IsNullOrEmpty(module.FolderName) && hdnModuleName.Value == module.ModuleName && txtFolderName.Text == module.FolderName && installerClass.IsModuleExist(module.ModuleName.ToLower(), module)) { string moduleInstalledPath = path + SageFrame.Core.RegisterModule.Common.ModuleFolder + '\\' + module.FolderName; module.InstalledFolderPath = moduleInstalledPath; } else { ShowMessage(SageMessageTitle.Exception.ToString(), GetSageMessage("Extensions_Editors", "ThisModuleSeemsToBeCorrupted"), "", SageMessageType.Error); } } try { if (module.ModuleID > 0) { //Run script ReadUninstallScriptAndDLLFiles(doc, module.InstalledFolderPath, installerClass); //Rollback moduleid installerClass.ModulesRollBack(module.ModuleID, GetPortalID); //Delete Module's Folder installerClass.DeleteTempDirectory(module.InstalledFolderPath); } } catch (Exception ex) { Exceptions = ex.Message; } if (Exceptions != string.Empty) { ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("Extensions_Editors", "ModuleExtensionIsUninstallError"), "", SageMessageType.Alert); } else { string ExtensionMessage = GetSageMessage("Extensions_Editors", "ModuleExtensionIsUninstalledSuccessfully"); ProcessCancelRequestBase(Request.RawUrl, true, ExtensionMessage); } } else { ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("Extensions_Editors", "ThisPackageIsNotValid"), "", SageMessageType.Alert); } } else { ShowMessage(SageMessageTitle.Notification.ToString(), GetSageMessage("Extensions_Editors", "ThisPackageDoesNotAppearToHaveManifestFile"), "", SageMessageType.Alert); } } else { ShowMessage(SageMessageTitle.Exception.ToString(), GetSageMessage("Extensions_Editors", "ModuleFolderDoesnotExist"), "", SageMessageType.Error); } } }