public void InstallAndConfigureApp(bool verifyonly, SPWeb web, int iCommunityId) { bVerifyOnly = verifyonly; oWeb = web; iCommunity = iCommunityId; appDef = Applications.GetApplicationInfo(_id); CheckInstalledRoot(); oAppList = oWeb.Lists.TryGetList("Installed Applications"); if (oAppList == null) { addMessage(ErrorLevels.Error, "Application List", "You do not have the application list installed", 0); } else { var query = new SPQuery(); query.Query = "<Where><Eq><FieldRef Name='EXTID' /><Value Type='Number'>" + appDef.Id + "</Value></Eq></Where>"; var lic = oAppList.GetItems(query); if (lic.Count > 0) { oListItem = lic[0]; } else { addMessage(ErrorLevels.Error, "Open Application Item", "Could not find item in list", 0); return; } if (appDef.loadErrorMessage == string.Empty) { if (CheckPermissions()) { if (CheckForApplicationList()) { if (CheckForPreReqs()) { if (CheckForKeys()) { InstallAndConfigureApp(); if (!bVerifyOnly) { ReportToAppReporting(web); } } } } } } else { addMessage(ErrorLevels.Error, "Check Applications", appDef.loadErrorMessage, 0); } if (oListItem != null) { reportResults(); } } }