wixsharp

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

MIT License

Stars
1.1K
Committers
52

Bot releases are hidden (Show)

wixsharp - Release v1.5.0.0

Published by oleg-shilo almost 7 years ago

This release delivers defect fixes and quite a few new features (majority is contributed by @Xaddan).

The most important feature to be aware of is the customization of the ID allocation algorithm. This feature may affect some users so please read about it in more details in the bottom section.


  • Added IniFile element support
  • Add ProgressText element support
  • Add UrlReservation element support
  • Add CustomActionRef element support
  • Add CustomAction rollback customization
  • Issue #201: WixStandardBootstrapperApplication ShowVersion
  • Issue #198: Files.AddRange not work; Extension method AddRange is renamed in Combine
  • Issue #208: Unable to sign msi file
  • Issue #214: Add InstallPrivileges property to project
  • Issue #206: WixQuietExecAction and deferred
  • Custom hash based ID-generation algorithm has been embedded as WixSharp.Project.HashedTargetPathIdAlgorithm
  • Separated Project.CustomIdAlgorithm and Compiler.CustomIdAlgorithm
  • Added Compiler.AutoGeneration.IsWxsGenerationThreadSafe
  • Compiler.AutoGeneration settings object made read-only

ID allocation customization

The need for user defined ID allocation algorithm was expressed in the multiple reports. The existing ID auto-generation algorithm exhibited certain practical limitations in some scenarios. While manual ID allocation gives the user the complete control over ID allocation, having a hybrid solution when user has ability to customize the auto-allocation was an attractive option.

Starting from this release user as an ability to provide a customid-allocation algorithm, which is invoked by WixSharp if no explicit Id for the WixEntity is specified:

project.CustomIdAlgorithm = 
        entity =>
        {
            if (entity is File file)
            {
                var target_path = this.GetTargetPathOf(file);

                var dir_hash = Math.Abs(target_path.PathGetDirName().GetHashCode32());
                var file_name = target_path.PathGetFileName();

                return $"File.{dir_hash}.{file_name}"; // pass to default ID generator
            }
        };

WixSharp also provides an alternative ready to go id-allocation algorithm, which addresses the reported limitations. Thus instead of emitting indexed IDs it produces ID with the target path hash for all File entities/elements. Note this feature does not affect user ability to set IDs manually.

// globally via configuration
Compiler.AutoGeneration.LegacyDefaultIdAlgorithm = false;

// for project only via delegate
project.CustomIdAlgorithm = project.HashedTargetPathIdAlgorithm;

The feature implementation took into account the community feedback provided via #204.

The new approach is more reliable but it will affect the users who stores the generated WXS files under source control. That's why the new API allows switching back to legacy ID-allocation algorithm if required.

Currently (in this release) the new hash-based algorithm is disabled by default to allow the users some time to get used to the new algorithm. But it will be made enabled by default in the next release.

Support for new WiX elements

Sample for UrlReservation element:

var project =
    new Project("MyProduct",
        new Dir(@"%ProgramFiles%\My Company\My Product",
        new UrlReservation("http://+:2131/url/device_service/", 
                           "*S-1-1-0", 
                           UrlReservationRights.register),
        ...

Sample for IniFile:

var project =
    new Project("MyProduct",
        new Dir(@"%ProgramFiles%\My Company\My Product",
            new File(@"..\Install Files\Files\Bin\MyApp.exe")),
        new Property("IP_ADRESS", "127.0.0.1"),
        new IniFile("config.ini", "INSTALLDIR", IniFileAction.createLine, "discovery", "enabled", "false"),
        new IniFile("config.ini", "INSTALLDIR", IniFileAction.createLine, "info", "enabled_server", "[IP_ADRESS]"));

Support for CustomActionsRef:

var project = 
    new Project("MyProduct",
        new Dir(@"%ProgramFiles%\My Company\My Product",
            new CustomActionRef ("WixFailWhenDeferred", 
                                 When.Before, 
                                 Step.InstallFinalize, 
                                 "WIXFAILWHENDEFERRED=1")
...
project.IncludeWixExtension(WixExtension.Util);

Sample for Rollback customization:

var project = 
    new Project("MyProduct",
        new Dir(@"%ProgramFiles%\My Company\My Product",
            new ElevatedManagedAction(CustomActions.Install, 
                                      Return.check, 
                                      When.After, 
                                      Step.InstallFiles, 
                                      Condition.NOT_Installed, 
                                      CustomActions.Rollback)
                                      {
                                          RollbackArg = "Prop=Rollback"
                                      }
...
public class CustomActions
{
    [CustomAction]
    public static ActionResult Rollback(Session session)
    {
        MessageBox.Show(session.Property("Prop"), "Rollback");

        return ActionResult.Success;
    }
...
wixsharp - Release v1.4.11.0 (RC)

Published by oleg-shilo almost 7 years ago

  • Custom Id-generation algorithm support (sample):
    • Custom hash based ID-generation algorithm has been embedded as WixSharp.Project.HashedTargetPathIdAlgorithm
    • Separated Project.CustomIdAlgorithm and Compiler.CustomIdAlgorithm
    • Added Compiler.AutoGeneration.LegacyDefaultIdAlgorithm flag to control the algorithm selection (incremantal vs. hashed)
  • Added Compiler.AutoGeneration.IsWxsGenerationThreadSafe
  • Compiler.AutoGeneration settings object made read-only
  • Issue #201: WixStandardBootstrapperApplication ShowVersion
  • Issue #198: Files.AddRange not work; Extension method AddRange is renamed in Combine
wixsharp - Release v1.4.10.0

Published by oleg-shilo almost 7 years ago

  • Issue #182: RegistrySearch has "Win64=no" when building x64 installers
  • Issue #184: Certificate - SetComponentPermanent(true) does not make component permanent
  • Issue #185: INSTALLDIR with russian symbols
  • Issue #191: Setup crash in feature selection dialog
  • Issue #193: Localization
  • Issue #196: ID Generation is weak
  • Issue #197: How can I get wixpdb?
wixsharp - Release v1.4.9.0

Published by oleg-shilo about 7 years ago

  • Issue #172: Request for IsSilent() extension method
  • Issue #166: How to make a Single Package Authoring
  • XElement extension method AddOrUpdateElement has been renamed in SetElementValue
  • Added AddOrUpdateElement XElement extension method
  • Updated SelectOrCreate XContainer extension method to handle XDocument objects
  • Added support for Bundle downgrade detection and graceful exit from SilentBootstrapperApplication BA
  • Updated sample DeferredActiosn sample with extra ConfigFile manipulation code. To assist with question #165.
  • Issue #160: Question: Registry Key Permissions Handling
  • Implemented changing the title and description of the ManagedUI.ExitDialog depending on the Install error or cancellation.
wixsharp - Release v1.4.8.0

Published by oleg-shilo about 7 years ago

v1.4.8.0

  • Issue #103: Compiler.WixLocation, WixSharp.wix.bin and new csproj format in Visual Studio 2017
  • Implemented showing MSI messages (Error, Warning and User) fro message handler of ManagedUI.
  • Added IManagedUIShell.Errors
  • Implemented changing the title and description of the ManagedUI.ExitDialog depending on the Install error or cancellation. (#156, #154, #150)
  • Added sample on how to change fonts and font color in Wix# native UI
  • Issue #151: UAC prompt appears minimized in TaskBar
  • Issue #141: Default UI header not transparent (completed)
  • Issue #145: Suggestion to add extra pre-defined Condition to be triggered when uninstalling.
  • Issue #141: Default UI header not transparent
  • Issue #137: Add custom attribute to Bundle project (Bootstrapper)
  • Added support for XML namespace prefix in 'AttributesDefinition AttributesDefinition = "{dep}ProviderKey = 01234567-8901-2345-6789-012345678901"`
  • Added support for ActionResult.SkipRemainingActions in UIInitialized event handler.
  • Issue #130: ManagedUI does not visually indicate upgrade failure
  • Added extension methods:
    • Session.LookupInstalledVersion
    • Session.QueryProductVersion
    • Session.QueryProperty
  • SetupEventArgs.ManagedUIShell renamed into SetupEventArgs.ManagedUI and marked as obsolete.
  • Added SetupEventArgs.ManagedUI.Shell to allow UI navigation to be triggered from ManagedSetup events (e.g. e.ManagedUI.Shell.GoTo<ExitDialog>()).
  • e.ManagedUI.Shell.ErrorDetected made writable to allow failing the setup from from ManagedSetup events.
  • Project.UIInitialized is reworked to make UI dialogs available as soon as possible. Useful for hooking to e.ManagedUI.OnCurrentDialogChanged before the UI sequence is started.
  • Added sample for MajorUpgrade scenario with ManagedUI.
  • Issue #128: [ManagedUI] INSTALLDIR with SourceName attribute
  • Issue #125: RegParser needs to handle a string value ending with "\n", not only with "\r\n"
  • Issue #123: Folder not removed on uninstalling
    v1.4.7.2 (beta)
  • Added support for client assembly %this% with non '.dll' extension. This solves the problem with DTF runtime asm probing failing to locate non standard assemblies (e.g. '.compiled').
  • Fixed payload serialization problem for ExePackage
    v1.4.7.1 (beta)
  • Issue #116: DigitalySign with Keystore
wixsharp - Release v1.4.7.2 (Beta)

Published by oleg-shilo about 7 years ago

Release v1.4.7.1-2

v1.4.7.2

  • Added support for client assembly %this% with non '.dll' extension. This solves the problem with DTF runtime asm probing failing to locate non standard assemblies (e.g. '.compiled').
  • Fixed payload serialization problem for ExePackage
    v1.4.7.1
  • Issue #116: DigitalySign with Keystore
wixsharp - Release v1.4.7.0

Published by oleg-shilo about 7 years ago

  • Issue #111: Display attribute & Reset link doesn't work in FeaturesDialog window
  • Issue #107: ManagedBootstrapperApplication Payloads
  • issue #108: [ManagedUI] feature checkbox can be unchecked when allowChange is false
  • Issue #109: [ManagedUI] backgroup image dimensions
  • Issue #103: Compiler.WixLocation, WixSharp.wix.bin and new csproj format in Visual Studio 2017
  • Issue #99: Working with embedded WPF UI and MSI; Updated code sample.
  • Issue #102: Update nuget package WixSharp.bin to include WIX (Windows Installer Xml) Toolset v3.11
  • Migration of WiX Toolset from v3.10.3 (v3.10.3007.0) to v3.11.0 (v3.11.1701.0)
wixsharp - Release v1.4.6.2

Published by oleg-shilo over 7 years ago

Release v1.4.6.2

  • Issue #96: Using WxsFiles and OutDir causes build to fail
  • Added Conditions for .NET Frameworks 4.5.1, 4.5.2, 4.6, 4.6.1 and 4.6.2
  • Fixed problem with AddXmlInclude when custom Project.OutDir is specified. Triggered but not related to the issue #96.
wixsharp - Release v1.4.6.0-1

Published by oleg-shilo over 7 years ago

  • Removed accidental DigitalSignature XML attribute form Bundle.
  • Issue #90: WixEntity.DoNotResetIdGenerator is broken
  • Issue #80: Error in AddRegValue
  • Issue #86: NHibernate.dll in Custom Actions
  • Issue #79: How to set the visible attribute of MsiPackages in a bootstrapper bundle
  • Extended digital signing support (https://github.com/alxcp/wixsharp branch):
    • Signing example is changed to using new signature functionality
    • Add digitally sign params to Project and Bundle
    • Added DigitalySign and DigitalySignBootstrapper classes was added.
    • Using insignia tool for signing the bootstrapper
    • Digitally sign logic now support /d (Description) parameter of SignTool. When UAC ask user about elevation rights, it`s used Description for showing name of MSI. If digitally signature has no Description, UAC shows temp file name instead.
  • Fixed problem with SilentBA staying in memory on update (cutesy of Alexey Che...ev)
wixsharp - Release v1.4.5.0

Published by oleg-shilo over 7 years ago

  • Additional work for Issue #48: WixSharp.Files generation : same folder on different features
  • Issue #71: Can`t build Wix# Samples\Shortcuts
  • Fixed an error with path to signtool.exe from ClickOnce's SDK
  • Issue #74: How to add file into install subdir?
  • Issue #75: Passing data via SetupEventArgs.Data to AfterInstall handler
  • Fixed typo in UnescapeKeyValue implementation
wixsharp - Release v1.4.4.1

Published by oleg-shilo over 7 years ago

This release is identical functionality wise to v1.4.4.0.
It's just re-packaged according new CI to include all binaries stamped with the same version number.

wixsharp - Release v1.4.4.0

Published by oleg-shilo over 7 years ago

  • Issue #56: Install Dir Problem
  • Issue #58: Signtool could not be found on Win10
  • Improved Compiler.BuildPackageAsmCmd(...)
  • Added InstallDir_DynamicPath sample
  • Issue #56: Escaping "minus" - character in folder names
wixsharp - Release v1.4.3.0

Published by oleg-shilo over 7 years ago

  • Added support for multiple absolute paths. Part of Issue #55 effort.
  • Issue #55: AbsolutePath support is broken
  • Issue #48: WixSharp.Files generation: same folder on different features.
  • Issue #45: Can't install dll to windows/system32
  • issues#43: How to mark a .NET assembly to be NGen'd during install
  • Generic items (IGenericEntity) are now allowed in File and Assembly constructor.
  • Implemented N-to-N relationship between Wix object/components and Features. Triggered by issue#48.
  • [Bootstrapper]support exit code feature
  • Project Templates extension is migrated to VS2017
wixsharp - Release v1.4.2.0

Published by oleg-shilo over 7 years ago

  • Issues #31: Enhancement: add session.IsUpgrade / setupEventArgs.IsUpgrading
  • Added new API AppSearch.GetProductVersionFromUpgradeCode
static void project_BeforeInstall(SetupEventArgs e)
{
    var installedVersion = AppSearch.GetProductVersionFromUpgradeCode(e.UpgradeCode);
}
wixsharp - Release v1.4.1.0 (HotFix)

Published by oleg-shilo over 7 years ago

  • Issue #27: Fixing AppSearch.GetProducts() crash
  • Added support for MediaTemplate element.
  • Added tunneling of Files and DirFiles attributes to the aggregated File items
  • Issue #23: Attributes inheritance in Files and DirFiles
  • Added Compiler.GetMappedWixConstants() for exploring WiX constants mapping
  • Adding %CommonAppDataFolder% to Dir.cs description
  • Issue #20: File.Attributes (on parent Component) after setting File.NeverOverwrite will not work
wixsharp - Release v1.4.0

Published by oleg-shilo over 7 years ago

  • Issue #14: Support for InternetShortcut element
  • Issue #10:*.g.wxs not created in TeamCity build
  • Added MSBuild.EmitAutoGenFiles
static void Main()
{
    // suppress generation of .\wix\MyProduct.g.wxs
    MsBuild.EmitAutoGenFiles = false;
    ...
wixsharp - Release v1.3.0

Published by oleg-shilo over 7 years ago

Release v1.3.0

  • Issue #7: Wix error when using multiple directories
  • Issue #8: Arguments are not supported on FileShortcut
  • Issue #9: Property SetupEventArgs.IsModifying has other behavior than method Extensions.IsModifying()
  • Implemented burn compiler output to catch WixMbaPrereqVars conflicts and suggest the work around. (Related to CP issue#149)
  • Update/fix for inadequate IsUpgrading analysis.
  • Updated WiX binaries to WiX Toolset v3.10.3 (v3.10.3007.0)
  • Added sample for adjusting the ManagedUI dialog sequence at runtime
  • Added MspPackage work around sample
wixsharp - Release v1.2.0

Published by oleg-shilo almost 8 years ago

Changes:

  • Issue#1: Compiler.BuildMsi() & async/await
  • Issue#2: Cannot add environment variables to project object if only merge modules are present.
  • Implemented burn compiler output to catch WixMbaPrereqVars conflicts and suggest the work around. (Related to CP issue#149)
wixsharp - Release v1.1.0

Published by oleg-shilo almost 8 years ago

Please note this is the release identical to the CodePlex v1.1 release before moving to to GitHub.

Changes:

  • Code prepared for the move to GitHub
  • e.Session.CustomActionData and e.Data of ManagedProject.AfterInstall event argument are pushed into environment variables.
  • Added auto deflating malti-language values of Project.Language properties on assignment.
  • Added IGenericEntity sample
  • Misc documentation/samples improvements
  • Issue#143: NeverOverwrite attribute missing from Registry elements
  • Issue#146: Problem with Environment Variables in project OutFileName
  • Added support for WixVariable element
  • Issue#149: Compile Error
  • Added auto probing for WixSharp.wix.bin during MSBuild authoring
  • Added support for build scripts being executed as in-memory CS-Script scripts.
  • Issue#151: Compiler.BuildMsi() & logging
  • Implemented SuppressWixMbaPrereqVars for Bundle