示例#1
0
    protected void Check2Activate()
    {
        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = true;
        //Disable skip button
        var skipButton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("SkipButton");

        skipButton.Visible = false;

        //CRON

        if (File.Exists(Server.MapPath("~/Handlers/RENAME_ME_SCHEDULED_TASK.ashx")))
        {
            string newlocation = HashingManager.GenerateMD5(DateTime.Now + DomainName + BaseUrl);
            File.Move(Server.MapPath("~/Handlers/RENAME_ME_SCHEDULED_TASK.ashx"), Server.MapPath("~/Handlers/cron" + newlocation + ".ashx"));
        }

        string[] files = System.IO.Directory.GetFiles(Server.MapPath("~/Handlers/"), "*.ashx");

        foreach (var file in files)
        {
            if (Path.GetFileName(file).StartsWith("cron"))
            {
                CRONFile.Text = BaseUrl + "Handlers/" + Path.GetFileName(file);
            }
        }
    }
示例#2
0
    protected void WizardStep7_Activate(object sender, EventArgs e)
    {
        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = false;
    }
示例#3
0
    protected void WizardStep10_Activate(object sender, EventArgs e)
    {
        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = false;

        bool hasMachineKey = false;

        using (StreamReader sr = new StreamReader(Server.MapPath("~/Web.config")))
        {
            String line = sr.ReadToEnd();
            if (line.Contains("<machineKey"))
            {
                hasMachineKey = true;
            }
        }

        if (hasMachineKey)
        {
            MKEYHolder.Visible = false;
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = true;
        }
        else
        {
            MKEYHolder.Visible = true;
            //Disable the button
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = false;
        }
    }
示例#4
0
    protected void Check1Activate()
    {
        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = true;

        //Permissions

        bool canGoNext = true;


        //File0
        try
        {
            //Modify Web.config
            var configuration = WebConfigurationManager.OpenWebConfiguration("~");
            var section       = (ConnectionStringsSection)configuration.GetSection("connectionStrings");
            section.ConnectionStrings["ClientDbString"].ConnectionString = "CHANGE_ME";
            section.ConnectionStrings["yafnet"].ConnectionString         = "CHANGE_ME";
            configuration.Save();

            File0Status.Text     = "OK";
            File0Status.CssClass = "okgreen";
        }
        catch (Exception ex)
        {
            ErrorLogger.Log(ex);
            File0Status.Text     = "NO";
            File0Status.CssClass = "red";
            canGoNext            = false;
        }


        FileCheckHelper(File1Status, FileCreateCheck("~/Images/b_ads/"), ref canGoNext);
        FileCheckHelper(File2Status, FileCreateCheck("~/Logs/"), ref canGoNext);
        FileCheckHelper(File3Status, FileCreateCheck("~/App_Data/"), ref canGoNext);
        FileCheckHelper(File4Status, FileCreateCheck("~/Handlers/CPAGPT/"), ref canGoNext);
        FileCheckHelper(File4Status, FileCreateCheck("~/Handlers/Offerwalls/"), ref canGoNext);
        FileCheckHelper(File5Status, FileRenameCheck("~/Handlers/RENAME_ME_SCHEDULED_TASK.ashx"), ref canGoNext);

        if (canGoNext == false)
        {
            //Disable the button
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = false;
        }
        else
        {
            //Disable the button
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = true;
        }
    }
示例#5
0
    protected void WizardStep4_Activate(object sender, EventArgs e)
    {
        settings_ForwardEmail.Text    = "contact@" + DomainName.Replace("www.", "");
        settings_ForwardEmail.Enabled = false;

        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = false;
        //Enable skip button
        var skipButton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("SkipButton");

        skipButton.Visible = true;
    }
示例#6
0
    protected void WizardStep3_Activate(object sender, EventArgs e)
    {
        bool canGoNext = true;

        //ASP.NET version
        try
        {
            ASPVersion.Text = Environment.Version.ToString();
            if (Environment.Version.Major >= 4)
            {
                //OK
                ASPStatus.Text      = "OK";
                ASPStatus.Font.Bold = true;
                ASPStatus.CssClass  = "okgreen";
            }
            else
            {
                //BAD
                ASPStatus.Text      = "BAD";
                ASPStatus.Font.Bold = true;
                ASPStatus.CssClass  = "red";

                ASPStatus2.Text     = "You need to change your ASP.NET version to >= 4.0";
                ASPStatus2.CssClass = "red small";

                canGoNext = false;
            }
        }
        catch (Exception ex)
        {
            ASPVersion.Text      = "???";
            ASPVersion.ForeColor = System.Drawing.Color.Orange;
            ASPStatus.Text       = "I'm unable to check it. Do it manually.";
            ASPStatus.CssClass   = "orange small";
        }


        if (canGoNext == false)
        {
            //Disable the button
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = false;
        }
    }
示例#7
0
    protected void WizardStep8_Activate(object sender, EventArgs e)
    {
        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = false;

        var configuration = WebConfigurationManager.OpenWebConfiguration("~");
        var section       = (ConnectionStringsSection)configuration.GetSection("connectionStrings");

        FinalCS.Text  = section.ConnectionStrings["ClientDbString"].ConnectionString;
        FinalFCS.Text = section.ConnectionStrings["yafnet"].ConnectionString;

        //Forum config setup
        var section2 = (AppSettingsSection)configuration.GetSection("appSettings");

        section2.Settings["YAF.ConfigPassword"].Value = HashingManager.GenerateMD5(DateTime.Now + DomainName);
        configuration.Save();
    }
示例#8
0
        public void StartSdbCommandPrompt()
        {
            Process proc = new Process();

            proc.StartInfo.FileName = "cmd.exe";
            try
            {
                proc.StartInfo.WorkingDirectory = Path.GetDirectoryName(sdbpath);
                proc.Start();
            }
            catch
            {
                if (string.IsNullOrEmpty(ToolsPathInfo.SDBPath))
                {
                    InstallWizard iWizard = new InstallWizard();
                    iWizard.ShowDialog();
                }
            }
        }
        private void TryInstall()
        {
            PackageManagerLauncher pkgMgr = new PackageManagerLauncher();

            if (pkgMgr.IsInstalled)
            {
                string msg = string.Format("Can not find {0}.\n\nDo you want to install it with {1}?", externalToolDesc, pkgMgr.externalToolDesc);
                if (MessageBox.Show(msg, pkgMgr.externalToolDesc, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
                {
                    pkgMgr.Launch();
                }

                return;
            }

            InstallWizard iWizard = new InstallWizard();

            if (iWizard.ShowDialog() == true && iWizard.info.NewPath)
            {
                return;
            }
        }
示例#10
0
    protected void Check3Activate()
    {
        //Disable the refreshbutton
        var refreshbutton = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("RefreshButton");

        refreshbutton.Visible = true;

        bool canGoNext = true;

        //ASP.NET version
        try
        {
            ASPVersion.Text = Environment.Version.ToString();
            if (Environment.Version.Major >= 4)
            {
                //OK
                ASPStatus.Text      = "OK";
                ASPStatus.Font.Bold = true;
                ASPStatus.CssClass  = "okgreen";
            }
            else
            {
                //BAD
                ASPStatus.Text      = "BAD";
                ASPStatus.Font.Bold = true;
                ASPStatus.CssClass  = "red";

                ASPStatus2.Text     = "You need to change your ASP.NET version to >= 4.0";
                ASPStatus2.CssClass = "red small";

                canGoNext = false;
            }
        }
        catch (Exception ex)
        {
            ASPVersion.Text      = "???";
            ASPVersion.ForeColor = System.Drawing.Color.Orange;
            ASPStatus.Text       = "I'm unable to check it. Do it manually.";
            ASPStatus.CssClass   = "orange small";
        }


        //TRUST LEVEL
        var trustLevel = GetCurrentTrustLevel();

        TrustLevel.Text = trustLevel.ToString();

        if (trustLevel == AspNetHostingPermissionLevel.Unrestricted ||
            trustLevel == AspNetHostingPermissionLevel.High)
        {
            //OK
            TrustStatus.Text      = "OK";
            TrustStatus.Font.Bold = true;
            TrustStatus.CssClass  = "okgreen";
        }
        else if (trustLevel == AspNetHostingPermissionLevel.None)
        {
            TrustLevel.Text      = "???";
            TrustLevel.ForeColor = System.Drawing.Color.Orange;
            TrustStatus.Text     = "I'm unable to check it. Do it manually.";
            TrustStatus.CssClass = "orange small";
        }
        else
        {
            //BAD
            TrustStatus.Text      = "BAD";
            TrustStatus.Font.Bold = true;
            TrustStatus.CssClass  = "red";

            TrustStatus2.Text     = "You need to have Full or High trust level on the server.";
            TrustStatus2.CssClass = "red small";

            canGoNext = false;
        }


        //FILE CHECKS
        int FilesProperCount = 0;

        using (StreamReader sr = new StreamReader(Server.MapPath("~/install/files_count.txt")))
        {
            String line = sr.ReadToEnd();
            FilesProperCount = Convert.ToInt32(line);
        }

        int AllFilesCount   = 0;
        int FilesCount      = 0;
        int ForumFilesCount = 0;

        foreach (string file in Directory.EnumerateFiles(
                     Server.MapPath("~/"), "*.*", SearchOption.AllDirectories))
        {
            AllFilesCount++;
        }

        foreach (string file in Directory.EnumerateFiles(
                     Server.MapPath("~/forum/"), "*.*", SearchOption.AllDirectories))
        {
            ForumFilesCount++;
        }

        FilesCount = AllFilesCount - ForumFilesCount;


        if (FilesCount >= FilesProperCount)
        {
            //All OK
            FilesStatus.Text      = "OK";
            FilesStatus.Font.Bold = true;
            FilesStatus.CssClass  = "okgreen";

            FilesStatus2.Text = "(" + FilesCount + "/" + FilesProperCount + ")";
        }
        else
        {
            //File not found

            FilesStatus.Text      = "NO";
            FilesStatus.Font.Bold = true;
            FilesStatus.CssClass  = "red";
            FilesStatus2.Text     = "(" + FilesCount + "/" + FilesProperCount + "). Make sure all files have been uploaded.";

            canGoNext = false;
        }

        if (ForumFilesCount >= ForumFilesProperCount)
        {
            //All OK
            FFilesStatus.Text      = "OK";
            FFilesStatus.Font.Bold = true;
            FFilesStatus.CssClass  = "okgreen";

            FFilesStatus2.Text = "(" + ForumFilesCount + "/" + ForumFilesProperCount + ")";
        }
        else
        {
            //File not found

            FFilesStatus.Text      = "NO";
            FFilesStatus.Font.Bold = true;
            FFilesStatus.CssClass  = "red";
            FFilesStatus2.Text     = "(" + ForumFilesCount + "/" + ForumFilesProperCount + "). Make sure all files have been uploaded.";

            canGoNext = false;
        }

        if (canGoNext == false)
        {
            //Disable the button
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = false;
        }
        else
        {
            var button = (Button)InstallWizard.FindControl("StepNavigationTemplateContainerID").FindControl("StepNextButton");
            button.Visible = true;
        }
    }