diff --git a/Source/NuGet/WixSharp/WixSharp.bin.nuspec b/Source/NuGet/WixSharp/WixSharp.bin.nuspec index a7b601cc..e504970c 100644 --- a/Source/NuGet/WixSharp/WixSharp.bin.nuspec +++ b/Source/NuGet/WixSharp/WixSharp.bin.nuspec @@ -2,7 +2,7 @@ WixSharp.bin - 1.9.3.0 + 1.9.4.0 Wix# (WixSharp) - Binaries Oleg Shilo Oleg Shilo diff --git a/Source/NuGet/WixSharp/WixSharp.lab.nuspec b/Source/NuGet/WixSharp/WixSharp.lab.nuspec index 403b68aa..77aacb83 100644 --- a/Source/NuGet/WixSharp/WixSharp.lab.nuspec +++ b/Source/NuGet/WixSharp/WixSharp.lab.nuspec @@ -2,7 +2,7 @@ WixSharp.Lab - 1.9.3.0 + 1.9.4.0 Wix# (WixSharp) - Experimantal features Oleg Shilo Oleg Shilo @@ -23,7 +23,7 @@ The package is tested against WIX (Windows Installer Xml) Toolset v3.10 (v3.10.2 - + diff --git a/Source/NuGet/WixSharp/WixSharp.nuspec b/Source/NuGet/WixSharp/WixSharp.nuspec index 5a1884bb..c1339928 100644 --- a/Source/NuGet/WixSharp/WixSharp.nuspec +++ b/Source/NuGet/WixSharp/WixSharp.nuspec @@ -2,7 +2,7 @@ WixSharp - 1.9.3.0 + 1.9.4.0 Wix# (WixSharp) - managed interface for WiX Oleg Shilo Oleg Shilo @@ -23,7 +23,7 @@ The package is tested against WIX (Windows Installer Xml) Toolset v3.10 (v3.10.2 en-AU C# scripting msi install setup wix - + diff --git a/Source/src/WixSharp.Samples/WixSharp.Lab.dll b/Source/src/WixSharp.Samples/WixSharp.Lab.dll index 63fd5daa..c3cbced0 100644 Binary files a/Source/src/WixSharp.Samples/WixSharp.Lab.dll and b/Source/src/WixSharp.Samples/WixSharp.Lab.dll differ diff --git a/Source/src/WixSharp.Samples/WixSharp.Msi.dll b/Source/src/WixSharp.Samples/WixSharp.Msi.dll index 347bddde..68e1db7f 100644 Binary files a/Source/src/WixSharp.Samples/WixSharp.Msi.dll and b/Source/src/WixSharp.Samples/WixSharp.Msi.dll differ diff --git a/Source/src/WixSharp.Samples/WixSharp.UI.dll b/Source/src/WixSharp.Samples/WixSharp.UI.dll index a8bd6271..a088a63d 100644 Binary files a/Source/src/WixSharp.Samples/WixSharp.UI.dll and b/Source/src/WixSharp.Samples/WixSharp.UI.dll differ diff --git a/Source/src/WixSharp.Samples/WixSharp.dll b/Source/src/WixSharp.Samples/WixSharp.dll index e0d00064..9b5b50a1 100644 Binary files a/Source/src/WixSharp.Samples/WixSharp.dll and b/Source/src/WixSharp.Samples/WixSharp.dll differ diff --git a/Source/src/WixSharp.Samples/WixSharp.xml b/Source/src/WixSharp.Samples/WixSharp.xml index 47de466f..226a0497 100644 --- a/Source/src/WixSharp.Samples/WixSharp.xml +++ b/Source/src/WixSharp.Samples/WixSharp.xml @@ -3408,7 +3408,7 @@ var project = new Project(); ... - Compiler.BuildWxsCmd(project); + Compiler.BuildMsiCmd(project); @@ -3798,6 +3798,37 @@ The wildcard pattern to convert. A regex equivalent of the given wildcard. + + + Implements `Error` element that can be used to define and customize runtime error messages. + + + + + + + Initializes a new instance of the class. + + The identifier. + The message. + + + + Number of the error for which a message is being provided. + + + + + Error message. + + + + + Adds itself as an XML content into the WiX source being generated from the . + See 'Wix#/samples/Extensions' sample for the details on how to implement this interface correctly. + + The context. + Searches for file and assigns to full path value of parent Property @@ -6644,6 +6675,11 @@ for 'both', the service will be stopped in both cases. + + + Initializes a new instance of the class. + + The flag indicating if after triggering the service action the setup should wait until te action is completed. @@ -9670,14 +9706,12 @@ - WiX linker Light.exe options (e.g. -sice:ICE30). - The default value is "-sw1076 -sw1079" (disable warning 1076 and 1079). + WiX linker Light.exe options (e.g. "-sice:ICE30 -sw1076" (disable warning 1076 and ICE warning 30). - WiX compiler Candle.exe options. - The default value is "-sw1076" (disable warning 1026). + WiX compiler Candle.exe options (e.g. "-sw1076" to disable warning 1026). @@ -12509,12 +12543,12 @@ String representation of the UILevel < 4 condition of the WiX Condition. - + String representation of the REMOVE="ALL" condition of the WiX Condition. - + Software is being removed and no newer version is being installed. @@ -12564,6 +12598,16 @@ The .NET4.7 installed. This condition is to be used in Project.SetNetFxPrerequisite. + + + The .NET4.7.1 installed. This condition is to be used in Project.SetNetFxPrerequisite. + + + + + The .NET4.7.2 installed. This condition is to be used in Project.SetNetFxPrerequisite. + + The .NET3.0 SP installed. This condition is to be used in Project.SetNetFxPrerequisite. @@ -13034,6 +13078,14 @@ + + + Serializes the into XML based on the members marked with + and . + + + + Serializes the into XML based on the members marked with @@ -13043,6 +13095,15 @@ + + + Serializes the into XML based on the members marked with + and . + + The obj. + The extension. + + Serializes the into XML based on the members marked with @@ -13080,6 +13141,30 @@ The attribute indicating the type member being mapped to XML element. Used by Wix# compiler to emit XML base on CLR types. + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The name. + + + + Initializes a new instance of the class. + + if set to true [is c data]. + + + + Initializes a new instance of the class. + + The name. + if set to true [is c data]. + Gets or sets the name of the mapped XML element. @@ -17151,13 +17236,13 @@ Initializes a new instance of the class. - The previous GUID. + The initial GUID. Initializes a new instance of the class. - The previous GUID. + The previous GUID. @@ -17368,6 +17453,14 @@ Base class for all Wix# types representing WiX XML elements (entities) + + + Gets or sets the id of the Component element that is to contain XML equivalent of the . + + + The component identifier. + + Name of the . diff --git a/Source/src/WixSharp/AutoElements.cs b/Source/src/WixSharp/AutoElements.cs index bac807bb..c4e96a1f 100644 --- a/Source/src/WixSharp/AutoElements.cs +++ b/Source/src/WixSharp/AutoElements.cs @@ -83,8 +83,9 @@ public static class AutoElements /// If set to Automatic then the compiler will enable this feature only if any empty directory /// is detected in the project definition. /// - [Obsolete(message: "This property will is defaulted to `Enabled`. Due to the fact that `Automatic` " + - "brings some ambiguity while no longer yielding any benefits", error: false)] + [Obsolete(message: "This property is defaulted to `CompilerSupportState.Enabled`. Due to the fact that " + + "`CompilerSupportState.Automatic` brings some ambiguity while no longer yielding any benefits", + error: false)] public static CompilerSupportState SupportEmptyDirectories = CompilerSupportState.Enabled; /// @@ -171,8 +172,8 @@ static void InsertRemoveFolder(XElement xDir, XElement xComponent, string when = .Any(); if (!alreadyPresent) xComponent.Add(new XElement("RemoveFolder", - new XAttribute("Id", xDir.Attribute("Id").Value), - new XAttribute("On", when))); + new XAttribute("Id", xDir.Attribute("Id").Value), + new XAttribute("On", when))); } } @@ -181,8 +182,8 @@ internal static XElement InsertUserProfileRemoveFolder(this XElement xComponent) var xDir = xComponent.Parent("Directory"); if (!xDir.Descendants("RemoveFolder").Any() && !xDir.IsUserProfileRoot()) xComponent.Add(new XElement("RemoveFolder", - new XAttribute("Id", xDir.Attribute("Id").Value), - new XAttribute("On", "uninstall"))); + new XAttribute("Id", xDir.Attribute("Id").Value), + new XAttribute("On", "uninstall"))); return xComponent; } @@ -245,13 +246,13 @@ internal static XElement InsertUserProfileRegValue(this XElement xComponent) xComponent.ClearKeyPath(); xComponent.Add( - new XElement("RegistryKey", - new XAttribute("Root", "HKCU"), - new XAttribute("Key", @"Software\WixSharp\Used"), - new XElement("RegistryValue", - new XAttribute("Value", "0"), - new XAttribute("Type", "string"), - new XAttribute("KeyPath", "yes")))); + new XElement("RegistryKey", + new XAttribute("Root", "HKCU"), + new XAttribute("Key", @"Software\WixSharp\Used"), + new XElement("RegistryValue", + new XAttribute("Value", "0"), + new XAttribute("Type", "string"), + new XAttribute("KeyPath", "yes")))); return xComponent; } @@ -321,7 +322,7 @@ static XElement CreateComponentFor(this XDocument doc, XElement xDir) { string compId = xDir.Attribute("Id").Value; XElement xComponent = xDir.AddElement( - new XElement("Component", + new XElement("Component", new XAttribute("Id", compId), new XAttribute("Guid", WixGuid.NewGuid(compId)))); @@ -335,15 +336,15 @@ static XElement CreateComponentFor(this XDocument doc, XElement xDir) private static string[] GetUserProfileFolders() { return new[] - { - "ProgramMenuFolder", - "AppDataFolder", - "LocalAppDataFolder", - "TempFolder", - "PersonalFolder", - "DesktopFolder", - "StartupFolder" - }; + { + "ProgramMenuFolder", + "AppDataFolder", + "LocalAppDataFolder", + "TempFolder", + "PersonalFolder", + "DesktopFolder", + "StartupFolder" + }; } static bool InUserProfile(this XElement xDir) @@ -651,9 +652,9 @@ internal static void InjectAutoElementsHandler(XDocument doc, Project project) string customAction = $"Set_DirAbsolutePath{absPathCount}"; product.Add(new XElement("CustomAction", - new XAttribute("Id", customAction), - new XAttribute("Property", actualDirName), - new XAttribute("Value", absolutePath))); + new XAttribute("Id", customAction), + new XAttribute("Property", actualDirName), + new XAttribute("Value", absolutePath))); product.SelectOrCreate("InstallExecuteSequence").Add( new XElement("Custom", $"(NOT Installed) AND (UILevel < 5) AND ({actualDirName} = ABSOLUTEPATH{absPathCount})", @@ -661,9 +662,9 @@ internal static void InjectAutoElementsHandler(XDocument doc, Project project) new XAttribute("Before", "AppSearch"))); product.SelectOrCreate("InstallUISequence").Add( - new XElement("Custom", $"(NOT Installed) AND (UILevel = 5) AND ({actualDirName} = ABSOLUTEPATH{absPathCount})", - new XAttribute("Action", customAction), - new XAttribute("Before", "AppSearch"))); + new XElement("Custom", $"(NOT Installed) AND (UILevel = 5) AND ({actualDirName} = ABSOLUTEPATH{absPathCount})", + new XAttribute("Action", customAction), + new XAttribute("Before", "AppSearch"))); if (absPathCount == null) absPathCount = 0; diff --git a/Source/src/WixSharp/Extensions.cs b/Source/src/WixSharp/Extensions.cs index b48bbc6c..813aa8fc 100644 --- a/Source/src/WixSharp/Extensions.cs +++ b/Source/src/WixSharp/Extensions.cs @@ -2,24 +2,24 @@ using System.Collections; using System.Collections.Generic; using System.Data; +using System.Diagnostics; using System.Drawing; +using System.Globalization; using System.Linq; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; using System.Security.Principal; using System.Text; +using System.Text.RegularExpressions; +using System.Windows.Forms; using System.Xml.Linq; using Microsoft.Deployment.WindowsInstaller; +using Microsoft.Tools.WindowsInstallerXml.Bootstrapper; using Microsoft.Win32; -using IO = System.IO; -using System.Globalization; -using System.Reflection; -using System.Runtime.InteropServices; -using System.Security; -using System.Text.RegularExpressions; -using static WixSharp.SetupEventArgs; using WixSharp.CommonTasks; -using Microsoft.Tools.WindowsInstallerXml.Bootstrapper; -using System.Windows.Forms; -using System.Diagnostics; +using static WixSharp.SetupEventArgs; +using IO = System.IO; namespace WixSharp { @@ -2800,40 +2800,41 @@ public static XAttribute[] MapToXmlAttributes(this object obj) var result = new List(); var items = getMemberInfo(obj) - .Select(x => - { - var xmlAttr = (XmlAttribute)x.GetCustomAttributes(typeof(XmlAttribute), false) - .FirstOrDefault(); - bool IsCData = false; - string name = null; - if (xmlAttr != null) - { - name = xmlAttr.Name ?? x.Name; - IsCData = xmlAttr.IsCData; - } - - object value = null; - if (!IsCData) - { - switch (x) - { - case FieldInfo fieldInfo: - value = fieldInfo.GetValue(obj); - break; - case PropertyInfo propertyInfo: - value = propertyInfo.GetValue(obj, emptyArgs); - break; - } - } - - return new - { - Name = name, - Value = value - }; - }) - .Where(x => x.Name != null && x.Value != null) - .ToArray(); + .Select(x => + { + var xmlAttr = (XmlAttribute)x.GetCustomAttributes(typeof(XmlAttribute), false) + .FirstOrDefault(); + bool IsCData = false; + string name = null; + if (xmlAttr != null) + { + name = xmlAttr.Name ?? x.Name; + IsCData = xmlAttr.IsCData; + } + + object value = null; + if (!IsCData) + { + switch (x) + { + case FieldInfo fieldInfo: + value = fieldInfo.GetValue(obj); + break; + + case PropertyInfo propertyInfo: + value = propertyInfo.GetValue(obj, emptyArgs); + break; + } + } + + return new + { + Name = name, + Value = value + }; + }) + .Where(x => x.Name != null && x.Value != null) + .ToArray(); foreach (var item in items) { @@ -2881,6 +2882,7 @@ private static XCData MapToXmlCData(this object obj) case FieldInfo fieldInfo: value = fieldInfo.GetValue(obj); break; + case PropertyInfo propertyInfo: value = propertyInfo.GetValue(obj, emptyArgs); break; @@ -2964,20 +2966,36 @@ public static string ToInsecureString(this SecureString input) [AttributeUsage(AttributeTargets.All, AllowMultiple = false)] public class XmlAttribute : Attribute { + /// + /// Initializes a new instance of the class. + /// public XmlAttribute() { } + /// + /// Initializes a new instance of the class. + /// + /// The name. public XmlAttribute(string name) { Name = name; } + /// + /// Initializes a new instance of the class. + /// + /// if set to true [is c data]. public XmlAttribute(bool isCData) { IsCData = isCData; } + /// + /// Initializes a new instance of the class. + /// + /// The name. + /// if set to true [is c data]. public XmlAttribute(string name, bool isCData) { Name = name; diff --git a/Source/src/WixSharp/Project.cs b/Source/src/WixSharp/Project.cs index 62449446..4f4481da 100644 --- a/Source/src/WixSharp/Project.cs +++ b/Source/src/WixSharp/Project.cs @@ -65,7 +65,7 @@ namespace WixSharp /// public class Project : WixProject { - internal string ComponentId(string seed) + internal new string ComponentId(string seed) { // Component id must be globally unique. Otherwise other products can // accidentally trigger MSI ref-counting by installing more than one product diff --git a/Source/src/WixSharp/Properties/AssemblyInfo.version.cs b/Source/src/WixSharp/Properties/AssemblyInfo.version.cs index f02864a7..7f53d3ed 100644 --- a/Source/src/WixSharp/Properties/AssemblyInfo.version.cs +++ b/Source/src/WixSharp/Properties/AssemblyInfo.version.cs @@ -7,5 +7,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("1.9.3.0")] -[assembly: AssemblyFileVersion("1.9.3.0")] \ No newline at end of file +[assembly: AssemblyVersion("1.9.4.0")] +[assembly: AssemblyFileVersion("1.9.4.0")] \ No newline at end of file diff --git a/Source/src/WixSharp/SvcEvent.cs b/Source/src/WixSharp/SvcEvent.cs index e15d0174..51a3b22a 100644 --- a/Source/src/WixSharp/SvcEvent.cs +++ b/Source/src/WixSharp/SvcEvent.cs @@ -92,6 +92,9 @@ public class SvcEvent : WixEntity, IGenericEntity [Xml] public SvcEventType? Stop; + /// + /// Initializes a new instance of the class. + /// public SvcEvent() { } diff --git a/Source/src/WixSharp/WixEntity.cs b/Source/src/WixSharp/WixEntity.cs index 4f2524ab..855e7462 100644 --- a/Source/src/WixSharp/WixEntity.cs +++ b/Source/src/WixSharp/WixEntity.cs @@ -132,10 +132,10 @@ internal string GetAttributeDefinition(string name) var preffix = name + "="; return (AttributesDefinition ?? "").Trim() - .Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) - .Where(x => x.StartsWith(preffix)) - .Select(x => x.Substring(preffix.Length)) - .FirstOrDefault(); + .Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries) + .Where(x => x.StartsWith(preffix)) + .Select(x => x.Substring(preffix.Length)) + .FirstOrDefault(); } internal void SetAttributeDefinition(string name, string value, bool append = false) @@ -297,6 +297,12 @@ internal string GetExplicitComponentId() return null; } + /// + /// Gets or sets the id of the Component element that is to contain XML equivalent of the . + /// + /// + /// The component identifier. + /// public string ComponentId { get => GetAttributeDefinition("Component:Id");