Ejemplo n.º 1
0
        public BindResult Bind(WixToolset.Extensibility.IBindContext context)
        {
            var extensionManager = context.ServiceProvider.GetService <IExtensionManager>();

            var backendExtensions = extensionManager.Create <IWindowsInstallerBackendExtension>();

            foreach (var extension in backendExtensions)
            {
                extension.PreBackendBind(context);
            }

            var validator = Validator.CreateFromContext(context, "darice.cub");

            var command = new BindDatabaseCommand(context, backendExtensions, validator);

            command.Execute();

            var result = new BindResult {
                FileTransfers = command.FileTransfers, ContentFilePaths = command.ContentFilePaths
            };

            foreach (var extension in backendExtensions)
            {
                extension.PostBackendBind(result, command.Pdb);
            }

            if (!String.IsNullOrEmpty(context.OutputPdbPath))
            {
                command.Pdb?.Save(context.OutputPdbPath);
            }

            return(result);
        }
Ejemplo n.º 2
0
        public bool TryCreateBackend(string outputType, string outputFile, WixToolset.Extensibility.IBindContext context, out IBackend backend)
        {
            if (String.IsNullOrEmpty(outputType))
            {
                outputType = Path.GetExtension(outputFile);
            }

            switch (outputType.ToLowerInvariant())
            {
            case "bundle":
            case ".exe":
                backend = new BundleBackend();
                return(true);
            }

            backend = null;
            return(false);
        }
Ejemplo n.º 3
0
        public static Validator CreateFromContext(WixToolset.Extensibility.IBindContext context, string cubeFilename)
        {
            Validator validator = null;

            // Tell the binder about the validator if validation isn't suppressed
            if (!context.SuppressValidation)
            {
                validator = new Validator(context.Messaging);
                validator.IntermediateFolder = Path.Combine(context.IntermediateFolder, "validate");

                // set the default cube file
                string thisPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                validator.AddCubeFile(Path.Combine(thisPath, cubeFilename));

                // Set the ICEs
                validator.ICEs = new SortedSet <string>(context.Ices);

                // Set the suppressed ICEs and disable ICEs that have equivalent-or-better checks in WiX.
                validator.SuppressedICEs = new SortedSet <string>(context.SuppressIces.Union(new[] { "ICE08", "ICE33", "ICE47", "ICE66" }));
            }

            return(validator);
        }
Ejemplo n.º 4
0
 public BindResult Bind(WixToolset.Extensibility.IBindContext context)
 {
     throw new NotImplementedException();
 }