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

New Post: Internetshortcut

$
0
0
InternetShortcut as some other non-mainstream WiX elements is supported via custom user defined code elements. The whole InjectXML sample is dedicated to the technique.

In your case you need to define a little InternetShortcut class and then use it in the project declaration:
var project =
    new Project("MyProduct",
        new Dir(@"%ProgramFiles64Folder%\My Company\My Product",
            new InternetShortcut
            {
                Id = "OnlineDocumentationShortcut",
                Name = "My Online Documentation",
                Target = "http://wixtoolset.org"
            },
...
publicclass InternetShortcut : WixEntity, IGenericEntity
{
    [WixSharp.Xml]
    newpublicstring Id;
    [WixSharp.Xml]
    newpublicstring Name;
    [WixSharp.Xml]
    publicstring Target;

    publicvoid Process(ProcessingContext context)
    {
        var util = WixExtension.Util;

        //reflect new dependency
        context.Project.IncludeWixExtension(util);

        //serialize itself and add to the parent component
        context.XParent
               .FindSingle("Component")
               .Add(this.ToXElement(util, "InternetShortcut"));
    }
}
The Wix# strategy is to include (into the distribution) direct support for the less popular/frequent elements only in response to the user demand. If you feel that support InternetShortcut needs to be available directly (out of box) then please log the feature request on the project home page: https://github.com/oleg-shilo/wixsharp.

Viewing all articles
Browse latest Browse all 1354

Trending Articles



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