コード例 #1
0
        private static void InstallApplication(HttpContext context)
        {
            String strApp = context.Request["app"];

            if (strApp == null)
            {
                context.Response.Write("No app name");
            }
            else
            {
                if (MyWeb.GetApplication(strApp) != null)
                {
                    context.Response.Write("App already exists");
                }
                else
                {
                    MyWebManifest manifest = MyWeb.GetManifest(strApp);
                    if (manifest == null)
                    {
                        context.Response.Write("Manifest not found");
                    }
                    else
                    {
                        if (manifest.Install() != null)
                        {
                            context.Response.Write("Installed successfully");
                        }
                        else
                        {
                            context.Response.Write("Couldnt install");
                        }
                    }
                }
            }
        }
コード例 #2
0
        private static void UpdateApplication(HttpContext context)
        {
            String strApp = context.Request["app"];

            if (strApp == null)
            {
                context.Response.Write("No app name");
                return;
            }
            MyWebApplication app = MyWeb.GetApplication(strApp);

            if (app == null)
            {
                context.Response.Write("App not found");
                return;
            }

            MyWebManifest manifest = MyWeb.GetManifest(strApp);

            if (manifest == null)
            {
                context.Response.Write("manifest not found");
                return;
            }
            String strC = context.Request["confirmed"];

            if (strC == null || strC.Equals("y") == false)
            {
                context.Response.Write("Current installed version: " + app.Manifest.Version);
                context.Response.Write("<p>Version on server: " + manifest.Version);
                if (!manifest.Version.Equals(app.Manifest.Version))
                {
                    context.Response.Write("<a href=\"myweb://Home/myweb.axd?Action=update&app=" + strApp +
                                           "&confirmed=y\"/> Update now (recommended) </a>");
                }
                else
                {
                    context.Response.Write("<a href=\"myweb://Home/myweb.axd?Action=update&app=" + strApp +
                                           "&confirmed=y\"/> Update now (not-recommended) </a>");
                }
            }
            else
            {
                app.Remove();
                if (manifest.Install() != null)
                {
                    context.Response.Write("Successfully updated");
                }
                else
                {
                    context.Response.Write("couldnt update: app has been removed");
                }
            }
        }
コード例 #3
0
ファイル: install.cs プロジェクト: wolewd/Windows-Server-2003
        /// <include file='doc\install.uex' path='docs/doc[@for="installPage.Install"]/*' />
        /// <devdoc>
        ///    <para>[To be supplied.]</para>
        /// </devdoc>
        public void Install(Object sender, EventArgs e)
        {
            MyWebManifest manifest = MyWeb.GetManifest(HiddenUrl.Value);

            if (manifest == null)
            {
                Response.Redirect("myweb://Home/myweb1.aspx?success=no");
            }
            else
            {
                if (manifest.Install() == null)
                {
                    Response.Redirect("myweb://Home/myweb1.aspx?success=no");
                }
                else
                {
                    Response.Redirect("myweb://Home/myweb1.aspx?success=yes&URL=" + HiddenUrl.Value);
                }
            }
        }