Giter VIP home page Giter VIP logo

wixsharp's Introduction

Wix# (WixSharp) - managed interface for WiX

Framework for building a complete MSI or WiX source code by using script files written with the C# syntax.

In July 2014 Wix# was migrated to CodePlex Wix# and re-released under MIT license. It was subsequently migrated from CodePlex to GitHub. You can still find old releases and some useful content from the past discussions on CodePlex.

Project Description

Wix# (WixSharp) is a member in the CS-Script family. Wix# allows building a complete MSI or WiX source code by executing script files written with the plain C# syntax. Wix# engine uses a C# class structure to mimic WiX entities and their relationships in order to produce a valid deployment model.

Wix# answers many MSI authoring challenges. It solves the common MSI/WiX authoring limitations in a very elegant and yet unorthodox way. Wix# follows the steps of other transcompilers like Script#, CoffeeScript or GWT by using source code of a more manageable syntax (C# in this case) to produce the desired source code of a less manageable syntax (WiX). A "more manageable syntax" in this context means less verbose and more readable code, better compile-time error checking and availability of more advanced tools.

Wix# also removes necessity to develop MSI sub-modules (Custom Actions) in the completely different language (e.g. C++) by allowing both the components and behaviour to be defined in the same language (C#). This also allows homogeneous, simplified and more consistent source code structure.

Overview

If you are planing to use Wix# on Linux you my find this article being useful.

You can find the instructions on how to author MSI setups with WixSharp in the Documentation section. And this section only highlights some of the available features.

You can use Visual Studio console application project and NuGet package as the starting point. image

Alternatively you can install "WixSharp Project Templates" Visual Studio extension. Read more about the Wix# VS templates here.

Wix# allows very simple and expressive deployment definition. This is an example of a simple Wix# script:

using System;
using WixSharp;
 
class Script
{
    static public void Main(string[] args)
    {
        var project = new Project("MyProduct",
                          new Dir(@"%ProgramFiles%\My Company\My Product",
                              new File(@"Files\Docs\Manual.txt"),
                              new File(@"Files\Bin\MyApp.exe")));
 
        project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
 
        Compiler.BuildMsi(project);
    }
}

One of the most intriguing features of Wix# is the ability to define/implement managed Custom Actions directly in the script file:

using System;
using System.Windows.Forms;
using WixSharp;
using Microsoft.Deployment.WindowsInstaller;
 
class Script
{
    static public void Main(string[] args)
    {
        var project = new Project("CustomActionTest",
                          new Dir(@"%ProgramFiles%\My Company\My Product",
                              new DirFiles(@"Release\Bin\*.*")),
                          new ManagedAction("MyAction"));
 
        BuildMsi(project);
    }
}
 
public class CustomActions
{
    [CustomAction]
    public static ActionResult MyAction(Session session)
    {
        MessageBox.Show("Hello World!", "Embedded Managed CA");
        session.Log("Begin MyAction Hello World");
 
        return ActionResult.Success;
    }
}

Another important feature is the support for custom UI including WPF external UI: image

The package in the Releases section contains an extensive collection of Wix# samples covering the following development scenarios:

  • Visual Studio integration including NuGet packages and VS2013/2015 project templates extension
  • Installing file(s) into Program Files directory
  • Changing installation directory
  • Installing shortcuts to installed files
  • Conditional installations
  • Installing Windows service
  • Installing IIS Web site
  • Modifying app config file as a post-install action (Deferred actions)
  • Installing "Uninstall Product" shortcut into "Program Menu" directory
  • Installing registry key
  • Showing custom licence file during the installation
  • Launching installed application after/during the installation with Custom Action
  • Executing VBScript Custom Action
  • Executing Managed (C#) Custom Action
  • Executing conditional actions
  • Targeting x64 OSs
  • Registering assembly in GAC
  • File Type registration
  • Setting/Reading MSI properties during the installation
  • Run setup with no/minimal/full UI
  • Localization
  • Major Upgrade deployment
  • Authoring and using MergeModules
  • Pre-install registry search
  • Customization of setup dialogs images
  • Rebooting OS after the installation
  • Building MSI with and without Visual Studio
  • Simplified Managed bootstrapper for UI based deployments
  • Simple Native bootstrapper
  • Custom MSI dialogs
  • Custom WinForms dialogs
  • Custom external UI
  • Console setup application
  • WinForm setup application
  • WPF setup application

wixsharp's People

Contributors

bradh avatar dosarf avatar oleg-shilo avatar pbalassone-nrgsys avatar taras-au avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.