Esempio n. 1
0
        private static InstallResult PerformDatabaseUpdate(string connectionString, Assembly executingAssembly)
        {
            DBUpdater update = new DBUpdater(executingAssembly);
            var       result = update.UpdateFromConnectionString(connectionString);

            return(result);
        }
Esempio n. 2
0
        private static InstallResult PerformUpdateFromAppInfoFile(string appInfoFilePath, System.Reflection.Assembly executingAssembly)
        {
            var appInfo = Amie.AppInfo.LoadFromFile(appInfoFilePath);
            var result  = new InstallResult();

            string connectionString = GetConnectionString(appInfo);

            if (string.IsNullOrEmpty(connectionString))
            {
                result.Success = false;
                result.Message = "Update failed the connection string was not found.";
                return(result);
            }

            DBUpdater dbUpdate = new DBUpdater(executingAssembly);

            result = dbUpdate.UpdateFromConnectionString(connectionString);

            if (!result.Success)
            {
                return(result);
            }

            foreach (var item in appInfo.AppFolders)
            {
                Amiedater a = new Amiedater(item);

                if (item.Type.Name == AppInfo.AppFolderType.Web.Name)
                {
                    result = a.PerformWebUpdate();
                }
                else if (item.Type.Name == AppInfo.AppFolderType.Service.Name)
                {
                    result = a.PerformServiceUpdate();
                }
                else
                {
                    //Must be a resource, such as a command line program or something.  We don't know where the old one is installed but we know where the new one is so at least we can update the connection string....
                    result = a.PerformResouceUpdate(connectionString);
                }
            }

            return(result);
        }