示例#1
0
        public InstallResults Install(IInstallModel model)
        {
            InstallResults result = InstallResults.Unknown;

            //Start the job if we got some information
            if (model != null)
            {
                if (!this.SetupConfig())
                {
                    //config failed, may be not the right permision (ACL) or medium trust?
                    result = InstallResults.ConfigFailed;
                }
                else if (!this.TestDbConnection())
                {
                    //Could not connect to the database
                    result = InstallResults.DBConnectionFailed;
                }
                else if (!this.InstallDb(model))
                {
                    //db creation failed.
                    result = InstallResults.DBInstallFailed;
                }
            }

            return result;
        }
示例#2
0
        private bool CreateAdminUser(IInstallModel model)
        {
            bool result = true;
            if (_membersContainer.CreateMember(model.UserName, model.Password, model.Email, true) != System.Web.Security.MembershipCreateStatus.Success)
            {
                result = false;
            }

            return result;
        }
示例#3
0
        private bool InstallDb(IInstallModel model)
        {
            bool result = true;

            if (!CreateAdminUser(model))
            {
                result = false;
            }
            else if (!SaveSymNetVersion())
            {
                result = false;
            }

            return result;
        }