Exemplo n.º 1
0
 public ManagedUI(string prefabName, GameObject gameObject, IManagedUI uiComponent)
 {
     PrefabName    = prefabName;
     GameObject    = gameObject;
     UIComponent   = uiComponent;
     ComponentType = UIComponent?.GetType();
 }
Exemplo n.º 2
0
 public ManagedUI([NotNull] string name, [NotNull] GameObject gameObject, [NotNull] IManagedUI uiComponent)
 {
     Name          = name;
     GameObject    = gameObject;
     UIComponent   = uiComponent;
     ComponentType = UIComponent.GetType();
 }
Exemplo n.º 3
0
        override internal void Preprocess()
        {
            //Debug.Assert(false);
            base.Preprocess();

            if (!preprocessed)
            {
                preprocessed = true;

                //It is too late to set prerequisites. Launch conditions are evaluated after UI is popped up.
                //this.SetNetFxPrerequisite(Condition.Net35_Installed, "Please install .NET v3.5 first.");

                string dllEntry = "WixSharp_InitRuntime_Action";

                this.AddAction(new ManagedAction(new Id(dllEntry), dllEntry, thisAsm, Return.check, When.Before, Step.AppSearch, Condition.Always));

                if (ManagedUI != null)
                {
                    this.AddProperty(new Property("WixSharp_UI_INSTALLDIR", ManagedUI.InstallDirId ?? "INSTALLDIR"));

                    ManagedUI.BeforeBuild(this);

                    InjectDialogs("WixSharp_InstallDialogs", ManagedUI.InstallDialogs);
                    InjectDialogs("WixSharp_ModifyDialogs", ManagedUI.ModifyDialogs);

                    this.EmbeddedUI = new EmbeddedAssembly(ManagedUI.GetType().Assembly.Location);

                    this.DefaultRefAssemblies.Add(ManagedUI.GetType().Assembly.Location);

                    Bind(() => UIInitialized);
                    Bind(() => UILoaded);
                }

                Bind(() => Load, When.Before, Step.AppSearch);
                Bind(() => BeforeInstall, When.Before, Step.InstallFiles);
                Bind(() => AfterInstall, When.After, Step.InstallFiles, true);
            }
        }
Exemplo n.º 4
0
        override internal void Preprocess()
        {
            //Debug.Assert(false);
            base.Preprocess();

            if (!preprocessed)
            {
                preprocessed = true;

                //It is too late to set prerequisites. Launch conditions are evaluated after UI is popped up.
                //this.SetNetFxPrerequisite(Condition.Net35_Installed, "Please install .NET v3.5 first.");

                if (ManagedUI?.Icon != null)
                {
                    this.AddBinary(new Binary(new Id("ui_shell_icon"), ManagedUI.Icon));
                }

                string dllEntry = "WixSharp_InitRuntime_Action";

                bool needInvokeInitRuntime = (IsHandlerSet(() => UIInitialized) ||
                                              IsHandlerSet(() => Load) ||
                                              IsHandlerSet(() => UILoaded) ||
                                              IsHandlerSet(() => BeforeInstall) ||
                                              IsHandlerSet(() => AfterInstall) ||
                                              AlwaysScheduleInitRuntime);
                if (needInvokeInitRuntime)
                {
                    this.AddAction(new ManagedAction(dllEntry)
                    {
                        Id             = new Id(dllEntry),
                        ActionAssembly = thisAsm,
                        Return         = Return.check,
                        When           = When.Before,
                        Step           = Step.AppSearch,
                        Condition      = Condition.Always
                    });
                }

                if (ManagedUI != null)
                {
                    this.AddProperty(new Property("WixSharp_UI_INSTALLDIR", ManagedUI.InstallDirId ?? "INSTALLDIR"));
                    if (AutoElements.EnableUACRevealer)
                    {
                        this.AddProperty(new Property("UAC_REVEALER_ENABLED", "true"));
                    }

                    ManagedUI.BeforeBuild(this);

                    InjectDialogs("WixSharp_InstallDialogs", ManagedUI.InstallDialogs);
                    InjectDialogs("WixSharp_ModifyDialogs", ManagedUI.ModifyDialogs);

                    this.EmbeddedUI = new EmbeddedAssembly(new Id("WixSharp_EmbeddedUI_Asm"), ManagedUI.GetType().Assembly.Location);

                    this.DefaultRefAssemblies.Add(ManagedUI.GetType().Assembly.Location);

                    Bind(() => UIInitialized);
                    Bind(() => UILoaded);

                    AddCancelFromUIIHandler();
                }

                Bind(() => Load, When.Before, Step.AppSearch);
                Bind(() => BeforeInstall, When.Before, Step.InstallFiles);
                Bind(() => AfterInstall, When.After, Step.InstallFiles, true);
            }
        }