Exemplo n.º 1
0
        private void lvSelectItem_SelectedIndexChanged(object sender, EventArgs e)
        {
            foreach (ListViewItem item in lvSelectItem.Items)
            {
                item.BackColor = SystemColors.Window;
                item.ForeColor = SystemColors.WindowText;
            }

            if (lvSelectItem.Tag == null)
            {
                if (lvSelectItem.SelectedItems.Count > 0)
                {
                    SelectedItem = (RepositoryFileInfoBase)lvSelectItem.SelectedItems[0].Tag;
                    DisplayInfo();
                }
            }
        }
        public UploadInstaller(RepositoryFileInfoBase InstallItem, Functions.UpdateProgressInfo OnUploadProgress, InstallationFinished OnInstallationFinished)
        {
            this.InstallItem            = InstallItem;
            this.OnInstallationFinished = OnInstallationFinished;
            this.OnProgressChanged      = OnUploadProgress;

            LocalFolder                = Constants.TemporaryFolder;
            ExecuteScriptSequence      = new List <string>();
            DeleteFoldersBeforeInstall = new List <string>();
            UploadLocation             = "/";
            DeleteFilesBeforeInstall   = new List <string>();

            CleanupAfterInstall = true;

            InstallationFinished = false;
            InstallResult        = string.Empty;

            FillMetaInfo();
        }
Exemplo n.º 3
0
        private void AddSelectItemItem(RepositoryFileInfoBase item, int?imageIndex)
        {
            if (imageIndex == null)
            {
                if (item is RepositoryApplicationInfo)
                {
                    imageIndex = 4;
                }

                if (item is RepositoryThemeInfo)
                {
                    imageIndex = 5;
                }

                if (item is RepositoryWaitImagesInfo)
                {
                    imageIndex = 6;
                }

                if (item is RepositoryCustomMenuInfo)
                {
                    imageIndex = 7;
                }

                if (item is RepositoryWebserviceInfo)
                {
                    imageIndex = 8;
                }

                if (imageIndex == null)
                {
                    imageIndex = 4;
                }
            }

            ListViewItem lvi = new ListViewItem(item.ToString(), (int)imageIndex);

            lvi.Tag = item;

            lvSelectItem.Items.Add(lvi);
        }
Exemplo n.º 4
0
        private void pnlUploadApplication_VisibleChanged(object sender, EventArgs e)
        {
            if (this.Visible)
            {
                if (panelResults != null)
                {
                    RepositoryFileInfoBase SelectedItem = panelResults["SelectedItem"] as RepositoryFileInfoBase;

                    txtApplication.Text = ((RepositoryFileInfoBase)SelectedItem).ToString();
                    txtServer.Text      = Settings.Default.Server;
                    gbxThemeBackgroundSelect.Visible = false;

                    if (SelectedItem is RepositoryApplicationInfo)
                    {
                        lblSelectedApplication.Text = Resources.InstallItem_ApplicationString;
                    }
                    else
                    if (SelectedItem is RepositoryThemeInfo)
                    {
                        lblSelectedApplication.Text = Resources.InstallItem_ThemeString;
                        ProcessMultipleBackgrounds(SelectedItem as RepositoryThemeInfo);
                    }
                    else if (SelectedItem is RepositoryWaitImagesInfo)
                    {
                        lblSelectedApplication.Text = Resources.InstallItem_WaitImageSetString;
                    }
                    else if (SelectedItem is RepositoryCustomMenuInfo)
                    {
                        lblSelectedApplication.Text = Resources.InstallItem_IndexString;
                    }
                    else
                    {
                        lblSelectedApplication.Text = Resources.InstallItem_WebserviceString;
                    }
                }
            }
        }
Exemplo n.º 5
0
        public override bool Execute()
        {
            if (gbxApplication.Visible)
            {
                SelectedItem = new RepositoryApplicationInfo(Resources.InstallItem_ApplicationString, "", "", "", "", "", "", "", "", "", new string[0], cbxInstallScript.Text + tbInstallScriptParameters.Text, "", "");
            }

            if (SelectedItem != null)
            {
                if (SelectedItem is RepositoryThemeInfo)
                {
                    if (cbxThemeFormat.Text == Resources.Text_HighDefinition)
                    {
                        panelResults.Add("ThemeFormat", "HD");
                    }
                    else
                    {
                        panelResults.Add("ThemeFormat", "SD");
                    }
                }

                panelResults.Add("SelectedItem", SelectedItem);
            }


            if ((SelectedItem is RepositoryApplicationInfo) || (SelectedItem is RepositoryWaitImagesInfo))
            {
                HttpCommands.DownloadHTTPFileAndExtract(Settings.Default.InstallPrepareScriptURL, Constants.TemporaryFolder, false, null);
            }

            if (SelectedItem is RepositoryApplicationInfo)
            {
                HttpCommands.DownloadHTTPFileAndExtract(Settings.Default.AppInitScriptURL, Constants.TemporaryFolder, false, null);
            }

            return(SelectedItem != null);
        }
Exemplo n.º 6
0
 private void AddSelectItemItem(RepositoryFileInfoBase item)
 {
     AddSelectItemItem(item, null);
 }
Exemplo n.º 7
0
        private void AutoDetectContent()
        {
            if ((Directory.GetFiles(LocalFolder).Length == 0) && (Directory.GetDirectories(LocalFolder).Length == 1))
            {
                LocalFolder = Directory.GetDirectories(LocalFolder)[0] + Path.DirectorySeparatorChar;
            }


            //first, is it a theme?
            if (Directory.Exists(LocalFolder + "_theme_") ||
                (Directory.Exists(LocalFolder + "SD") ||
                 (Directory.Exists(LocalFolder + "HD"))))
            {
                gbxTheme.Visible       = true;
                gbxApplication.Visible = false;

                cbxThemeFormat.Items.Clear();
                lblOpenZipFile.Text = Resources.InstallItem_ThemeString;

                if (Directory.Exists(LocalFolder + "_theme_"))
                {
                    LocalFolder += Path.DirectorySeparatorChar + "_theme_";
                }

                if (Directory.Exists(LocalFolder + Path.DirectorySeparatorChar + "HD"))
                {
                    cbxThemeFormat.Items.Add(Resources.Text_HighDefinition);
                }

                if (Directory.Exists(LocalFolder + Path.DirectorySeparatorChar + "SD"))
                {
                    cbxThemeFormat.Items.Add(Resources.Text_StandardDefinition);
                }

                SelectedItem = new RepositoryThemeInfo(Resources.InstallItem_ThemeString, "", "", "", "", "", "", "", "", "", new string[0], cbxThemeFormat.Items.Contains("High Definition"), cbxThemeFormat.Items.Contains("Standard Definition"));

                cbxThemeFormat.SelectedIndex = 0;
            }

            else

            //does it contain an cgi file?
            if ((Directory.GetFiles(LocalFolder, "*.cgi").Length > 0) || (Directory.GetFiles(LocalFolder, "*.tar").Length > 0))
            {
                lblOpenZipFile.Text = Resources.InstallItem_ApplicationString;
                cbxInstallScript.Items.Clear();


                string[] files = Directory.GetFiles(LocalFolder, "*.tar");
                foreach (string file in files)
                {
                    cbxInstallScript.Items.Add(Settings.Default.AppInitLocation + "?install&" + Path.GetFileName(file).Replace(" ", "%20"));
                }

                files = Directory.GetFiles(LocalFolder, "*.cgi");
                foreach (string file in files)
                {
                    cbxInstallScript.Items.Add(Path.GetFileName(file));
                }
                cbxInstallScript.SelectedIndex = 0;
                gbxApplication.Visible         = true;
                gbxTheme.Visible = false;
            }

            else

            //is it an index?
            if (File.Exists(LocalFolder + "index.htm"))
            {
                lblOpenZipFile.Text = Resources.InstallItem_IndexString;
                SelectedItem        = new RepositoryCustomMenuInfo(Resources.InstallItem_IndexString, "", "", "", "", "", "", "", "", "", new string[0]);
                gbxTheme.Visible    = gbxApplication.Visible = false;
            }

            else

            if (File.Exists(LocalFolder + "demo.jpg"))
            {
                lblOpenZipFile.Text = Resources.InstallItem_WaitImageSetString;
                SelectedItem        = new RepositoryWaitImagesInfo(Resources.InstallItem_WaitImageSetString, "", "", "", "", "", "", "", "", "", new string[0]);
            }

            else

            if (Directory.Exists(LocalFolder + ".home"))
            {
                lblOpenZipFile.Text = Resources.InstallItem_IndexString;
                SelectedItem        = new RepositoryCustomMenuInfo(Resources.InstallItem_IndexString, "", "", "", "", "", "", "", "", "", new string[0]);
                gbxTheme.Visible    = gbxApplication.Visible = false;
            }

            else

            {
                lblOpenZipFile.Text = Resources.InstallItem_Package;
                MessageBox.Show(Resources.MessageBox_InstallFromFileInvalidZIP, Resources.MessageBox_InstallFromFileCaption, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                SelectedItem = null;
            }
        }