Skip to content

Commit

Permalink
Issue #111: Display attribute & Reset link doesn't work in FeaturesDi…
Browse files Browse the repository at this point in the history
…alog window
  • Loading branch information
oleg-shilo committed Aug 2, 2017
1 parent 91479e1 commit 852dd8f
Show file tree
Hide file tree
Showing 11 changed files with 218 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static public void Main(string[] args)
//msiOnlinePackage, //just a demo sample

new MsiPackage(crtMsi) { DisplayInternalUI = true, Visible = true, MsiProperties = "PACKAGE_PROPERTY=[BundleVariable]" },
new MsiPackage(productMsi) { DisplayInternalUI = true, Payloads = new[] { "script.dll".ToPayload() }, });
new MsiPackage(productMsi) { DisplayInternalUI = true, Payloads = new[] { "script.dll".ToPayload() } });

bootstrapper.AboutUrl = "https://wixsharp.codeplex.com/";
bootstrapper.IconFile = "app_icon.ico";
Expand Down Expand Up @@ -80,6 +80,7 @@ static public void Main(string[] args)
});
bootstrapper.StringVariablesDefinition += "BundleVariable=333";
bootstrapper.PreserveTempFiles = true;

// Add MspPackage manually (demo only).
// In the future releases the direct support for MspPackage element will be added.
// bootstrapper.WixSourceGenerated += (doc) => doc.FindSingle("Chain")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ static Script()

static public void Main()
{
var binaries = new Feature("Binaries", "Product binaries", true, false);
var docs = new Feature("Documentation", "Product documentation (manuals and user guides)", true);
var tuts = new Feature("Tutorials", "Product tutorials", false);
var manuals = new Feature("Manuals", "Product Manuals", false);
var user_manuals = new Feature("User Manuals", "User Manuals", false);
var dev_manuals = new Feature("Developer Manuals", "Developer Manuals", false);
var binaries = new Feature("Binaries", "Product binaries", true, false) { Display = FeatureDisplay.expand };
var docs = new Feature("Documentation", "Product documentation (manuals and user guides)", true) { Display = FeatureDisplay.expand };
var tuts = new Feature("Tutorials", "Product tutorials", false) { Display = FeatureDisplay.expand };
var manuals = new Feature("Manuals", "Product Manuals", false) { Display = FeatureDisplay.expand };
var user_manuals = new Feature("User Manuals", "User Manuals", false) { Display = FeatureDisplay.expand };
var dev_manuals = new Feature("Developer Manuals", "Developer Manuals", false) { Display = FeatureDisplay.expand };

docs.Children.Add(tuts);
tuts.Children.Add(manuals);
Expand All @@ -52,10 +52,10 @@ static public void Main()

//removing all entry dialogs and installdir
project.ManagedUI.InstallDialogs.Add(Dialogs.Welcome)
//.Add(Dialogs.Licence) //decide if to show (or not) this dialog at runtime
//.Add(Dialogs.Licence) // decide if to show (or not) this dialog at runtime
.Add(Dialogs.Features)
.Add(Dialogs.SetupType)
.Add(Dialogs.InstallDir)
// .Add(Dialogs.InstallDir)
.Add(Dialogs.Progress)
.Add(Dialogs.Exit);

Expand Down
Binary file modified Source/src/WixSharp.Samples/WixSharp.UI.dll
Binary file not shown.
7 changes: 6 additions & 1 deletion Source/src/WixSharp.Samples/WixSharp.UI.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Source/src/WixSharp.Samples/WixSharp.dll
Binary file not shown.
110 changes: 85 additions & 25 deletions Source/src/WixSharp.Samples/WixSharp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1610,8 +1610,22 @@
</member>
<member name="F:WixSharp.Bootstrapper.Package.Payloads">
<summary>
Collection of paths to the package dependencies.
Collection of Payloads (the package dependencies).
</summary>
<example>
<code>
var bootstrapper =
new Bundle("My Product",
new MsiPackage(productMsi)
{
DisplayInternalUI = true,
Payloads = new[] {
"script.dll".ToPayload()
"utils.dll".ToPayload()
}
...
</code>
</example>
</member>
<member name="T:WixSharp.Bootstrapper.ChainItem">
<summary>
Expand Down Expand Up @@ -4287,6 +4301,27 @@
<param name="defaultValue">The default value.</param>
<returns></returns>
</member>
<member name="M:WixSharp.Extensions.IsEven(System.Int32)">
<summary>
Determines if the integer is an even value
</summary>
<param name="value"></param>
<returns></returns>
</member>
<member name="M:WixSharp.Extensions.IsOdd(System.Int32)">
<summary>
Determines if the integer is an odd value
</summary>
<param name="value"></param>
<returns></returns>
</member>
<member name="M:WixSharp.Extensions.MapToFeatureDisplay(System.Int32)">
<summary>
Determines the <see cref="T:WixSharp.FeatureDisplay"/> from a given integer.
</summary>
<param name="value">The value.</param>
<returns></returns>
</member>
<member name="M:WixSharp.Extensions.ToId(System.String)">
<summary>
Converts string to <see cref="T:WixSharp.Id"/>.
Expand Down Expand Up @@ -8836,10 +8871,10 @@
</member>
<member name="T:WixSharp.Feature">
<summary>
Defines WiX Feature.
Defines WiX Feature.
<para>
All installable WiX components belong to one or more features. By default, if no <see cref="T:WixSharp.Feature"/>s are defined by user, Wix# creates "Complete"
feature, which contains all installable components.
All installable WiX components belong to one or more features. By default, if no <see cref="T:WixSharp.Feature"/>s are defined by user, Wix# creates "Complete"
feature, which contains all installable components.
</para>
</summary>
<example>
Expand All @@ -8850,7 +8885,7 @@
<code>
Feature binaries = new Feature("My Product Binaries");
Feature docs = new Feature("My Product Documentation");

var project =
new Project("My Product",
new Dir(@"%ProgramFiles%\My Company\My Product",
Expand All @@ -8859,7 +8894,7 @@
</code>
</description>
</item>

<item>
<description>The example of defining nested features .
<code>
Expand All @@ -8871,7 +8906,7 @@
</code>
</description>
</item>

<item>
<description>The example of defining "Complete" <see cref="T:WixSharp.Feature"/> implicitly.
Note <see cref="T:WixSharp.File"/> constructor does not use <see cref="T:WixSharp.Feature"/> argument.
Expand All @@ -8883,7 +8918,7 @@
...
</code>
</description>
</item>
</item>
</list>
</example>
</member>
Expand All @@ -8910,8 +8945,8 @@
Initializes a new instance of the <see cref="T:WixSharp.Feature"/> class with properties/fields initialized with specified parameters.
</summary>
<param name="name">The feature name.</param>
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
processing the <c>Condition Table</c> or user input.</param>
</member>
<member name="M:WixSharp.Feature.#ctor(System.String,System.String,System.Boolean)">
Expand All @@ -8920,8 +8955,8 @@
</summary>
<param name="name">The feature name.</param>
<param name="description">The feature description.</param>
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
processing the <c>Condition Table</c> or user input.</param>
</member>
<member name="M:WixSharp.Feature.#ctor(System.String,System.String,System.Boolean,System.Boolean)">
Expand All @@ -8930,8 +8965,8 @@
</summary>
<param name="name">The feature name.</param>
<param name="description">The feature description.</param>
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
processing the <c>Condition Table</c> or user input.</param>
<param name="allowChange">Defines if setup allows the user interface to display an option to change the <see cref="T:WixSharp.Feature"/> state to Absent.</param>
</member>
Expand All @@ -8940,8 +8975,8 @@
Initializes a new instance of the <see cref="T:WixSharp.Feature"/> class with properties/fields initialized with specified parameters.
</summary>
<param name="name">The feature name.</param>
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
processing the <c>Condition Table</c> or user input.</param>
<param name="allowChange">Defines if setup allows the user interface to display an option to change the <see cref="T:WixSharp.Feature"/> state to Absent.</param>
</member>
Expand All @@ -8951,7 +8986,7 @@
</summary>
<param name="name">The feature name.</param>
<param name="description">The feature description.</param>
<param name="configurableDir">The default path of the feature <c>ConfigurableDirectory</c>. If set to non-empty string, MSI runtime will place
<param name="configurableDir">The default path of the feature <c>ConfigurableDirectory</c>. If set to non-empty string, MSI runtime will place
<c>Configure</c> button for the feature in the <c>Feature Selection</c> dialog.</param>
</member>
<member name="M:WixSharp.Feature.#ctor(System.String,System.String,System.Boolean,System.Boolean,System.String)">
Expand All @@ -8960,18 +8995,18 @@
</summary>
<param name="name">The feature name.</param>
<param name="description">The feature description.</param>
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
<param name="isEnabled">Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
processing the <c>Condition Table</c> or user input.</param>
<param name="allowChange">Defines if setup allows the user interface to display an option to change the <see cref="T:WixSharp.Feature"/> state to Absent.</param>
<param name="configurableDir">The default path of the feature <c>ConfigurableDirectory</c>. If set to non-empty string, MSI runtime will place
<param name="configurableDir">The default path of the feature <c>ConfigurableDirectory</c>. If set to non-empty string, MSI runtime will place
<c>Configure</c> button for the feature in the <c>Feature Selection</c> dialog.</param>
</member>
<member name="F:WixSharp.Feature.IsEnabled">
<summary>
<para>
Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
Defines if the <see cref="T:WixSharp.Feature"/> is enabled at startup.
Use this parameter if the feature should be disabled by default and only enabled after
processing the <c>Condition Table</c> or user input.
</para>
The default value is <c>true</c>.
Expand All @@ -8980,7 +9015,7 @@
<member name="F:WixSharp.Feature.AllowChange">
<summary>
<para>
Defines if setup allows the user interface to display an option to change the <see cref="T:WixSharp.Feature"/> state to Absent.
Defines if setup allows the user interface to display an option to change the <see cref="T:WixSharp.Feature"/> state to Absent.
</para>
<para>This property is translated into WiX Feature.Absent attribute.</para>
The default value is <c>true</c>.
Expand All @@ -8993,7 +9028,7 @@
</member>
<member name="F:WixSharp.Feature.ConfigurableDir">
<summary>
The default path of the feature <c>ConfigurableDirectory</c>. If set to non-empty string, MSI runtime will place
The default path of the feature <c>ConfigurableDirectory</c>. If set to non-empty string, MSI runtime will place
<c>Configure</c> button for the feature in the <c>Feature Selection</c> dialog.
</summary>
</member>
Expand All @@ -9011,10 +9046,15 @@
</member>
<member name="F:WixSharp.Feature.Condition">
<summary>
Defines the installation <see cref="F:WixSharp.Feature.Condition"/>, which is to be checked during the installation to
Defines the installation <see cref="F:WixSharp.Feature.Condition"/>, which is to be checked during the installation to
determine if the feature should be installed on the target system.
</summary>
</member>
<member name="F:WixSharp.Feature.Display">
<summary>
Determines the initial display of this feature in the feature tree.
</summary>
</member>
<member name="M:WixSharp.Feature.ToString">
<summary>
Returns a <see cref="T:System.String" /> that represents this instance.
Expand Down Expand Up @@ -13153,6 +13193,26 @@
Does nothing; this element is used merely in WiX authoring for organization and does nothing to the final output.
</summary>
</member>
<member name="T:WixSharp.FeatureDisplay">
<summary>
Determines the initial display of this feature in the feature tree.
</summary>
</member>
<member name="F:WixSharp.FeatureDisplay.collapse">
<summary>
Initially shows the feature collapsed. This is the default value.
</summary>
</member>
<member name="F:WixSharp.FeatureDisplay.expand">
<summary>
Initially shows the feature expanded.
</summary>
</member>
<member name="F:WixSharp.FeatureDisplay.hidden">
<summary>
Prevents the feature from displaying in the user interface.
</summary>
</member>
<member name="T:WixSharp.WixQuietExecAction">
<summary>
Defines WiX <c>QtExecCmdLineAction</c> CustomAction.
Expand Down
20 changes: 18 additions & 2 deletions Source/src/WixSharp.UI/ManagedUI/Forms/FeatureItem.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Microsoft.Deployment.WindowsInstaller;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace WixSharp.UI.Forms
Expand All @@ -13,14 +14,17 @@ public class FeatureItem
/// The name of the Feature
/// </summary>
public string Name;

/// <summary>
/// The name of the parent Feature
/// </summary>
public string ParentName;

/// <summary>
/// The title of the Feature
/// </summary>
public string Title;

/// <summary>
/// The description of the Feature
/// </summary>
Expand All @@ -30,6 +34,7 @@ public class FeatureItem
/// The view of the Feature. Typically a TreeNode
/// </summary>
public object View;

/// <summary>
/// The parent FeatureItem
/// </summary>
Expand All @@ -39,16 +44,22 @@ public class FeatureItem
/// The requested state. Defines the InstallState of the feature to be achieved as the result of the MSI execution.
/// </summary>
public InstallState RequestedState;

/// <summary>
/// The current state. Defines the InstallState of the feature before the MSI execution.
/// </summary>
public InstallState CurrentState;

/// <summary>
/// The defines how the feature should be displayed in the feature tree.
/// Defines how the feature should be displayed in the feature tree.
/// </summary>
public FeatureAttributes Attributes;

/// <summary>
/// Determines the initial display of this feature in the feature tree.
/// </summary>
public FeatureDisplay Display;

/// <summary>
/// Gets a value indicating whether the feature is allowed to be "absent".
/// </summary>
Expand All @@ -74,6 +85,8 @@ public FeatureItem()
/// <param name="name">The name.</param>
public FeatureItem(Session session, string name)
{
// Debug.Assert(false);

var data = session.OpenView("select * from Feature where Feature = '" + name + "'");

Dictionary<string, object> row = data.FirstOrDefault();
Expand All @@ -82,9 +95,12 @@ public FeatureItem(Session session, string name)
{
Name = name;
ParentName = (string)row["Feature_Parent"];
Title = (string)row["Title"].ToString();
Title = (string)row["Title"];
Description = (string)row["Description"];

var rawDisplay = (int)row["Display"];
Display = rawDisplay.MapToFeatureDisplay();

var defaultState = (InstallState)row["Level"];

CurrentState = DetectFeatureState(session, name);
Expand Down
Loading

0 comments on commit 852dd8f

Please sign in to comment.