Skip to content

Commit

Permalink
WiX4: added WixProject.WixBuildCommandGenerated even. Triggered by #…
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-shilo committed Jun 15, 2024
1 parent 6046809 commit 9477fd5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Source/src/WixSharp/Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,17 @@ static public bool EmitAutoGenFiles
}
}
}

/// <summary>
/// Delegate for <see cref="Compiler"/> event <c>WixSourceGenerated</c>
/// </summary>
public delegate void XDocumentGeneratedDlgt(XDocument document);

/// <summary>
/// Delegate for <see cref="WixProject.WixBuildCommandGenerated"/> event.
/// </summary>
public delegate string WixBuildCommandGeneratedDlgt(string command);

/// <summary>
/// Delegate for <see cref="Compiler"/> event <c>WixSourceSaved</c>
/// </summary>
Expand Down Expand Up @@ -708,7 +714,11 @@ static string GenerateWixCommand(WixProject project, string wxsFile)
if (extraWxsFiles.IsNotEmpty())
candleCmdLineParams.Append(extraWxsFiles);

return candleCmdLineParams.ToString().ExpandEnvVars();
var buildCmd = candleCmdLineParams.ToString().ExpandEnvVars();

buildCmd = project.WixBuildCommandGenerated?.Invoke(buildCmd) ?? buildCmd;

return buildCmd;
}

static string Build(Project project, string path, OutputType type)
Expand Down
7 changes: 7 additions & 0 deletions Source/src/WixSharp/WixProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ public string Language
/// </summary>
public event XDocumentGeneratedDlgt WixSourceGenerated;

/// <summary>
/// Occurs when `wix.exe` build command generated.
/// Use this event if you want to modify the command before
/// it is executed by `wix.exe`.
/// </summary>
public WixBuildCommandGeneratedDlgt WixBuildCommandGenerated = x => x;

internal string SetVersionFromIdValue = "";

/// <summary>
Expand Down

0 comments on commit 9477fd5

Please sign in to comment.