Skip to content

Commit

Permalink
Release v1.10.0.0
Browse files Browse the repository at this point in the history
- Issue #658: Question: how to close running application or wait until user close application manually
- Issue #656: ExeFileShortcut changing folder name
- Issue #649: How to add permissions to regkey
- Issue #647: Interrupt CA execution #647;
- Implemented `Session.IsCanceled`
- Added `File.OnProcess` and `DirFiles.OnProcess` to provide custom handling on processing wildcards:
  ```
  new Files(@"..\Release Folder\test\*.exe")
  {
      OnProcess = file =>
      {
          file.OverwriteOnInstall = true;
      }
  }, . . .
  ```
  • Loading branch information
lbs-contributor committed Jul 4, 2019
1 parent aec0988 commit ea7c7cb
Show file tree
Hide file tree
Showing 17 changed files with 188 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Source/NuGet/WixSharp/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ After building the project the corresponding .msi file can be found in the root
Tips and Hints:
If you are implementing managed CA you may want to set "Target Framework" to "v3.5" as the lower CLR version will help avoid potential conflicts during the installation (e.g. target system has .NET v3.5 only).

Note:
Note:
Wix# requires WiX Toolset (tools and binaries) to function properly. Wix# is capable of automatically finding WiX tools only if WiX Toolset installed. In all other cases you need to set the environment variable WIXSHARP_WIXDIR or WixSharp.Compiler.WixLocation to the valid path to the WiX binaries.

WiX binaries can be brought to the build environment by either installing WiX Toolset, downloading Wix# suite or by adding WixSharp.wix.bin NuGet package to your project.

Because of the excessive size of the WiX Toolset the WixSharp.wix.bin NuGet package isn't a direct dependency of the WixSharp package and it needs to be added to the project explicitly:

Compiler.WixLocation = @"..\packages\WixSharp.wix.bin.<version>\tools\bin";
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ static public void Main()
project.OutFileName = "setup";

project.PreserveTempFiles = true;
//uncomment the line below if you want to associate the web site with the app pool via WebApplicaion element
//project.WixSourceGenerated += Project_WixSourceGenerated;
// uncomment the line below if you want to associate the web site with the app pool via WebApplicaion element
// project.WixSourceGenerated += Project_WixSourceGenerated;
project.BuildMsi();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ static void project_Load(SetupEventArgs e)
if (!e.IsInstalling && !e.IsUpgrading)
SetEnvVersion(e.Session);

//MSI doesn't preserve any e.Session properties if they are accessed from deferred actions (e.g. project_AfterInstall)
//Wix# forces some of the properties to be persisted (via CustomActionData) by using user defined
//project.DefaultDeferredProperties ("INSTALLDIR,UILevel" by default).
//Alternatively you can save any data to the Wix# specific fully persisted data properties "bag" SetupEventArgs.Data.
//SetupEventArgs.Data values can be set and accesses at any time from any custom action including deferred one.
// MSI doesn't preserve any e.Session properties if they are accessed from deferred actions (e.g. project_AfterInstall)
// Wix# forces some of the properties to be persisted (via CustomActionData) by using user defined
// project.DefaultDeferredProperties ("INSTALLDIR,UILevel" by default).
// Alternatively you can save any data to the Wix# specific fully persisted data properties "bag" SetupEventArgs.Data.
// SetupEventArgs.Data values can be set and accesses at any time from any custom action including deferred one.
var conn = @"Data Source=.\SQLEXPRESS;Initial Catalog=RequestManagement;Integrated Security=SSPI";
e.Data["persisted_data"] = conn;

Expand Down
Binary file modified Source/src/WixSharp.Samples/WixSharp.Lab.dll
Binary file not shown.
Binary file modified Source/src/WixSharp.Samples/WixSharp.Msi.dll
Binary file not shown.
Binary file modified Source/src/WixSharp.Samples/WixSharp.UI.dll
Binary file not shown.
Binary file modified Source/src/WixSharp.Samples/WixSharp.dll
Binary file not shown.
167 changes: 161 additions & 6 deletions Source/src/WixSharp.Samples/WixSharp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1475,8 +1475,6 @@
Controls automatic insertion of CreateFolder and RemoveFolder for the directories containing no files.
Required for: NativeBootstrapper, EmbeddedMultipleActions, EmptyDirectories, InstallDir, Properties,
ReleaseFolder, Shortcuts and WildCardFiles samples.
<para>If set to <c>Automatic</c> then the compiler will enable this feature only if any empty directory
is detected in the project definition.</para>
</summary>
</member>
<member name="F:WixSharp.AutoElements.DisableAutoKeyPath">
Expand Down Expand Up @@ -2825,6 +2823,17 @@
<member name="T:WixSharp.CloseApplication">
<summary>
Closes applications or schedules a reboot if application cannot be closed.
<example>The following is an example of closing <c>MyApp.exe</c> application.
The example also illustrates the use of a condition for the <c>CloseApplication</c> entry.
<code>
var project =
new Project("My Product",
new CustomActionRef("WixCloseApplications", When.Before, Step.CostFinalize, new Condition("VersionNT > 400"),
new CloseApplication("MyApp.exe", true, false)),
...
Compiler.BuildMsi(project);
</code>
</example>
</summary>
</member>
<member name="F:WixSharp.CloseApplication.Id">
Expand All @@ -2833,6 +2842,12 @@
If the Id is not specified, one will be generated.
</summary>
</member>
<member name="P:WixSharp.CloseApplication.MyProperty">
<summary>
asAdsa
</summary>
<value>The Name property gets/sets the value of the string field, _name.</value>
</member>
<member name="F:WixSharp.CloseApplication.Property">
<summary>
Property to be set if application is still running. Useful for launch conditions or
Expand Down Expand Up @@ -5866,6 +5881,16 @@
Equivalent of https://wixtoolset.org/documentation/manual/v3/xsd/wix/permission.html
</summary>
</member>
<member name="F:WixSharp.Permission.Append">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.ChangePermission">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.CreateChild">
<summary>
For a directory, the right to create a subdirectory. Only valid under a 'CreateFolder' parent.
Expand All @@ -5876,31 +5901,131 @@
For a directory, the right to create a file in the directory. Only valid under a 'CreateFolder' parent.
</summary>
</member>
<member name="F:WixSharp.Permission.CreateLink">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.CreateSubkeys">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.Delete">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.DeleteChild">
<summary>
For a directory, the right to delete a directory and all the files it contains, including read-only files. Only valid under a 'CreateFolder' parent.
</summary>
</member>
<member name="F:WixSharp.Permission.Domain">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.EnumerateSubkeys">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.Execute">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.FileAllRights">
<summary>
Bit mask for FILE_ALL_ACCESS from WinNT.h (0x001F01FF).
</summary>
</member>
<member name="F:WixSharp.Permission.GenericAll">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.GenericExecute">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.GenericRead">
<summary>
specifying this will fail to grant read access
</summary>
</member>
<member name="F:WixSharp.Permission.GenericWrite">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.Notify">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.Read">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.ReadAttributes">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.ReadExtendedAttributes">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.ReadPermission">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.SpecificRightsAll">
<summary>
Bit mask for SPECIFIC_RIGHTS_ALL from WinNT.h (0x0000FFFF).
</summary>
</member>
<member name="F:WixSharp.Permission.Synchronize">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.TakeOwnership">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.Traverse">
<summary>
For a directory, the right to traverse the directory. By default, users are assigned the BYPASS_TRAVERSE_CHECKING privilege, which ignores the FILE_TRAVERSE access right. Only valid under a 'CreateFolder' parent.
</summary>
</member>
<member name="F:WixSharp.Permission.User">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.Write">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.WriteAttributes">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="F:WixSharp.Permission.WriteExtendedAttributes">
<summary>
The documentation is unavailable on WiX
</summary>
</member>
<member name="T:WixSharp.DirPermission">
<summary>
Represents applying permission(s) to the containing File entity
Expand Down Expand Up @@ -7331,6 +7456,15 @@
</summary>
<param name="attributesDefinition">The attributes definition.</param>
</member>
<member name="M:WixSharp.Extensions.SetAttribute(System.Xml.Linq.XElement,System.Xml.Linq.XName,System.Object)">
<summary>
Sets the attribute.
</summary>
<param name="obj">The object.</param>
<param name="name">The name.</param>
<param name="value">The value.</param>
<returns></returns>
</member>
<member name="M:WixSharp.Extensions.SetAttribute(System.Xml.Linq.XElement,System.String,System.Object)">
<summary>
Sets the value of the attribute. This is a fluent version of XElement.SetAttributeValue.
Expand Down Expand Up @@ -13525,8 +13659,8 @@
</member>
<member name="F:WixSharp.Files.OnProcess">
<summary>
The delegate that is called when a file matching the wildcard of the sourcePath is rocessed
and a <see cref="T:WixSharp.File"/> item is added to the project. It is the most convelient way of
The delegate that is called when a file matching the wildcard of the sourcePath is processed
and a <see cref="T:WixSharp.File"/> item is added to the project. It is the most convenient way of
adjusting the <see cref="T:WixSharp.File"/> item properties.
</summary>
</member>
Expand Down Expand Up @@ -14058,6 +14192,27 @@
The never overwrite.
</value>
</member>
<member name="F:WixSharp.File.AddCloseAction">
<summary>
The flag that indicates if <c>CloseApplication</c> needs to be added for the specified file.
<example>
<code>
new Project("MyProduct",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File(@"..\Install Files\Files\Bin\MyApp.exe") { AddCloseAction = true }),
...

// the code above is equivalent of code below

new Project("MyProduct",
new Dir(@"%ProgramFiles%\My Company\My Product",
new File(@"..\Install Files\Files\Bin\MyApp.exe"),
new CloseApplication("MyApp.exe", true, false)),
...
</code>
</example>
</summary>
</member>
<member name="P:WixSharp.File.TargetFileName">
<summary>
Gets or sets the custom name of the target file. By default the name is
Expand Down Expand Up @@ -14149,8 +14304,8 @@
</member>
<member name="F:WixSharp.DirFiles.OnProcess">
<summary>
The delegate that is called when a file matching the wildcard of the sourcePath is rocessed
and a <see cref="T:WixSharp.File"/> item is added to the project. It is the most convelient way of
The delegate that is called when a file matching the wildcard of the sourcePath is processed
and a <see cref="T:WixSharp.File"/> item is added to the project. It is the most convenient way of
adjusting the <see cref="T:WixSharp.File"/> item properties.
</summary>
</member>
Expand Down
18 changes: 5 additions & 13 deletions Source/src/WixSharp/AutoElements.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,19 @@ public enum CompilerSupportState
/// <summary>
/// The feature will be enabled automatically when needed
/// </summary>
Automatic,
[Obsolete(message: "This value is no longer used by any of the compiler features. " +
"Use `CompilerSupportState.Enabled` instead.", error: false)]
Automatic = 0,

/// <summary>
/// The feature will be enabled
/// </summary>
Enabled,
Enabled = 0,

/// <summary>
/// The feature will be disabled
/// </summary>
Disabled
Disabled = 1
}

/// <summary>
Expand All @@ -80,11 +82,7 @@ public static class AutoElements
/// Controls automatic insertion of CreateFolder and RemoveFolder for the directories containing no files.
/// Required for: NativeBootstrapper, EmbeddedMultipleActions, EmptyDirectories, InstallDir, Properties,
/// ReleaseFolder, Shortcuts and WildCardFiles samples.
/// <para>If set to <c>Automatic</c> then the compiler will enable this feature only if any empty directory
/// is detected in the project definition.</para>
/// </summary>
[Obsolete(message: "This property is defaulted to `CompilerSupportState.Enabled`. It is due to the fact that " +
"`CompilerSupportState.Automatic` brings some ambiguity while no longer yielding any benefits", error: false)]
public static CompilerSupportState SupportEmptyDirectories = CompilerSupportState.Enabled;

/// <summary>
Expand Down Expand Up @@ -566,12 +564,6 @@ internal static void HandleEmptyDirectories(XDocument doc)
.Where(e => e.HasAttribute("Id", v => v.EndsWith(".EmptyDirectory")))
.Select(x => x.Parent("Directory")).ToArray();

if (SupportEmptyDirectories == CompilerSupportState.Automatic)
{
SupportEmptyDirectories = dummyDirs.Any() ? CompilerSupportState.Enabled : CompilerSupportState.Disabled; //it wasn't set by user so set it if any empty dir is detected
Compiler.OutputWriteLine("Wix# support for EmptyDirectories is automatically " + SupportEmptyDirectories.ToString().ToLower());
}

if (SupportEmptyDirectories == CompilerSupportState.Enabled)
{
if (dummyDirs.Any())
Expand Down
8 changes: 7 additions & 1 deletion Source/src/WixSharp/CloseApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/// <summary>
/// Closes applications or schedules a reboot if application cannot be closed.
/// <example>The following is an example of closing <c>MyApp.exe</c> application.
/// The example also illustrates the use of a condition for the <c>CloseApplication</c> entry..
/// The example also illustrates the use of a condition for the <c>CloseApplication</c> entry.
/// <code>
/// var project =
/// new Project("My Product",
Expand All @@ -23,6 +23,12 @@ public class CloseApplication : WixEntity, IGenericEntity
[Xml]
public new string Id;

/// <summary>
/// asAdsa
/// </summary>
/// <value>The Name property gets/sets the value of the string field, _name.</value>
public int MyProperty { get; set; } = 9;

/// <summary>
/// Property to be set if application is still running. Useful for launch conditions or
/// to conditionalize custom UI to ask user to shutdown apps.
Expand Down
1 change: 0 additions & 1 deletion Source/src/WixSharp/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,6 @@ static void ProcessDirectory(Dir wDir, Project wProject, Dictionary<Feature, Lis
// addresses the issue. Though, in turn, effectively disables auto mode and requires explicit declaration
// of `AutoElements.SupportEmptyDirectories = CompilerSupportState.Enabled` for empty dir scenarios.
// Restoring the original approach for now... (15/09/2018)

if (existingCompElement.Count() == 0 && AutoElements.SupportEmptyDirectories != CompilerSupportState.Disabled)
{
string compId = wDir.GenerateComponentId(wProject, ".EmptyDirectory");
Expand Down
4 changes: 2 additions & 2 deletions Source/src/WixSharp/DirFiles.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ public DirFiles(Feature feature, string sourcePath, Predicate<string> filter)
public Predicate<string> Filter = (file => true);

/// <summary>
/// The delegate that is called when a file matching the wildcard of the sourcePath is rocessed
/// and a <see cref="WixSharp.File"/> item is added to the project. It is the most convelient way of
/// The delegate that is called when a file matching the wildcard of the sourcePath is processed
/// and a <see cref="WixSharp.File"/> item is added to the project. It is the most convenient way of
/// adjusting the <see cref="WixSharp.File"/> item properties.
/// </summary>
public Action<File> OnProcess = null;
Expand Down
4 changes: 2 additions & 2 deletions Source/src/WixSharp/Files.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ public Files(Feature feature, string sourcePath, Predicate<string> filter)
public Predicate<string> Filter = (file => true);

/// <summary>
/// The delegate that is called when a file matching the wildcard of the sourcePath is rocessed
/// and a <see cref="WixSharp.File"/> item is added to the project. It is the most convelient way of
/// The delegate that is called when a file matching the wildcard of the sourcePath is processed
/// and a <see cref="WixSharp.File"/> item is added to the project. It is the most convenient way of
/// adjusting the <see cref="WixSharp.File"/> item properties.
/// </summary>
public Action<File> OnProcess = null;
Expand Down
Loading

0 comments on commit ea7c7cb

Please sign in to comment.