예제 #1
0
        void INvnControl.Build()
        {
            if (String.IsNullOrEmpty(txtDllEntry.Text) || String.IsNullOrEmpty(txtFalseValue.Text) || String.IsNullOrEmpty(txtProperty.Text) ||
                String.IsNullOrEmpty(txtTrueValue.Text) || String.IsNullOrEmpty(txtValidationDll.Text))
            {
                return;
            }
            else
            {
                // create custom actions
                Wix.Binary pidBinaryFile = new Wix.Binary();
                pidBinaryFile.Id             = "ProductKeyCode";
                pidBinaryFile.SourceFile     = txtValidationDll.Text;
                MsiBuilder.CustomActionItems = Common.AddItemToArray(MsiBuilder.CustomActionItems, pidBinaryFile);
                Wix.CustomAction pidCustomAction = new Wix.CustomAction();
                pidCustomAction.Id           = "MSIKey";// this must be same as in RegistrationDlg
                pidCustomAction.BinaryKey    = "ProductKeyCode";
                pidCustomAction.DllEntry     = txtDllEntry.Text;
                MsiBuilder.CustomActionItems = Common.AddItemToArray(MsiBuilder.CustomActionItems, pidCustomAction);
                // update user interface
                UICompiler.UpdatePIDInfo(txtProperty.Text, txtTrueValue.Text, txtFalseValue.Text);

                // compile user interface files
                UICompiler.Compile(true, MsiBuilder.UIRef[0].Id.Split("_".ToCharArray())[1]);
            }
        }
예제 #2
0
        public override object[] Build()
        {
            List <object> items = new List <object>();

            // create custom acton
            Wix.CustomAction action = new Wix.CustomAction();
            action.Id = Common.GetId();
            if (String.IsNullOrEmpty(SourcePath))
            {
                Wix.Property property = new Wix.Property();
                property.Id   = Common.GetId();
                property.Text = new string[] { "<![CDATA[" + Script + "]]>" };
                items.Add(property);
                action.Property = property.Id;
            }
            else
            {
                if (IsInstalledFile == "True")
                {
                    if (Tag != null)
                    {
                        action.FileKey = ((ComponentNode)Tag).Property.Id;
                    }
                }
                else
                {
                    Wix.Binary binary = new Wix.Binary();
                    binary.Id         = Common.GetId();
                    binary.SourceFile = SourcePath;
                    action.BinaryKey  = binary.Id;
                    items.Add(binary);
                }
            }
            action.JScriptCall = Function;
            items.Add(action);
            // create install execute sequence
            Wix.InstallExecuteSequence executeSequence = new Wix.InstallExecuteSequence();
            executeSequence.ItemsElementName = new Wix.ItemsChoiceType2[] { Wix.ItemsChoiceType2.Custom };
            Wix.Custom custom = new Wix.Custom();
            custom.Action = action.Id;
            base.SetExecutionSequence(custom);
            base.SetExecuteType(custom);
            executeSequence.Items = new object[] { custom };
            items.Add(executeSequence);

            return(items.ToArray());
        }
예제 #3
0
        public override object[] Build()
        {
            List <object> items = new List <object>();

            // create custom acton
            Wix.CustomAction action = new Wix.CustomAction();
            action.Id = Common.GetId();
            if (IsInstalledFile == "True")
            {
                if (Tag != null)
                {
                    action.FileKey = ((ComponentNode)Tag).Property.Id;
                }
            }
            else
            {
                Wix.Binary binary = new Wix.Binary();
                binary.Id         = Common.GetId();
                binary.SourceFile = SourcePath;
                action.BinaryKey  = binary.Id;
                items.Add(binary);
            }
            action.ExeCommand = Function;
            items.Add(action);
            // create install execute sequence
            Wix.InstallExecuteSequence executeSequence = new Wix.InstallExecuteSequence();
            executeSequence.ItemsElementName = new Wix.ItemsChoiceType2[] { Wix.ItemsChoiceType2.Custom };
            Wix.Custom custom = new Wix.Custom();
            custom.Action = action.Id;
            base.SetExecutionSequence(custom);
            base.SetExecuteType(custom);
            executeSequence.Items = new object[] { custom };
            items.Add(executeSequence);

            return(items.ToArray());
        }