Quantcast
Channel: wixsharp Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1354

New Post: Support for DifxApp/Driver Install

$
0
0
Sorry my Russian typing is rusty...

The Driver element is fairly simple and support for it seems to be straight forward. Thus I can add it very quickly. As long as I know what WXS and compilers invocation needs to be produced. And currently it isn't obvious.

I quickly generated the wxs very similar to yours and got the same error. Indeed wxs seems OK. Though I quick googling reviled that it is a common error when something is wrong with light.exe arguments or WiX bin content. It's hard for me to comment on this as I am no expert on WiX Driver and I guess you probably have a better background in this matter. Though you can help me with this.

If you execute the script below it will produce the wxs and the batch file for building msm. The batch file can be tweaked manually so you can try to find the right way of referencing DifxAppExtension.dll from light.exe. If you are successful then please share you findings and I can update Wix# with your solution to support Driver element so the feature is available in the next release (in a few days or so).
class Script
{
    staticvoid Main()
    {
        var project = new Project("MyProduct",
                          new Dir(@"%ProgramFiles%\USBServ",
                              new File("usbser.sys")));

        project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");

        project.WixExtensions.Add("WixDifxAppExtension.dll");
        project.WixNamespaces.Add("difx=\"http://schemas.microsoft.com/wix/DifxAppExtension\"");
        project.WixSourceGenerated += InstallSIA3Driver;

        project.BuildMsmCmd();
    }

    staticvoid InstallSIA3Driver(XDocument document)
    {
        XNamespace difx = "http://schemas.microsoft.com/wix/DifxAppExtension";

        document
            .FindAll("File")
            .Single(e => e.HasAttribute("Source", a => a.EndsWith("usbser.sys")))
            .Parent
            .Add(new XElement(difx + "Driver")
                     .AddAttributes(@"AddRemovePrograms=no;
                                      DeleteFiles=no; 
                                      Legacy=yes; 
                                      PlugAndPlayPrompt=no; 
                                      Sequence=1"));
    }
}

Viewing all articles
Browse latest Browse all 1354

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>