Skip to content

Commit

Permalink
[Windows][Installer] Fix NullReferenceException when INSTALL_CWS
Browse files Browse the repository at this point in the history
…is `null` (#20717)
  • Loading branch information
julien-lebot authored Nov 8, 2023
1 parent c50f63a commit eb09813
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,6 @@ public AgentInstaller(string version = null)

public Project ConfigureProject()
{
// Conditionally include the PROCMON MSM while it is in active development to make it easier
// to build/ship without it.
Property cwsProperty = null;
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WINDOWS_DDPROCMON_DRIVER")))
{
cwsProperty = new Property("INSTALL_CWS", "1");
}
var project = new ManagedProject("Datadog Agent",
// Use 2 LaunchConditions, one for server versions,
// one for client versions.
Expand Down Expand Up @@ -128,12 +121,16 @@ public Project ConfigureProject()
)
{
Win64 = true
},
// cwsProperty is conditionally declared above, it is either NULL
// or the property indicating that cws is to be included.
cwsProperty
}
);

// Conditionally include the PROCMON MSM while it is in active development to make it easier
// to build/ship without it.
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("WINDOWS_DDPROCMON_DRIVER")))
{
project.AddProperty(new Property("INSTALL_CWS", "1"));
}

// Always generate a new GUID otherwise WixSharp will generate one based on
// the version
project.ProductId = Guid.NewGuid();
Expand Down

0 comments on commit eb09813

Please sign in to comment.