Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions ClickOnce/Builders/ApplicationBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,33 @@ private static bool Add(this Manifest application, Project project, string sourc
}
else if (application.AssemblyReferences.FindTargetPath(target) is null
&& application.FileReferences.FindTargetPath(target) is null)
{
application.FileReferences.Add(new FileReference
{
FileReference fileReference = new FileReference
{
SourcePath = source,
TargetPath = target,
IsDataFile = kind == GlobKind.DataFiles,
IsOptional = group != null,
Group = group
});
};
if(project.MergeCom.Value)
{
string manifestFile = $"{source}.manifest";
if(File.Exists(manifestFile))
{
Manifest manifest = ManifestReader.ReadManifest(manifestFile, false);
if(manifest?.FileReferences?.Count > 0)
{
FileReference matchedFile = manifest.FileReferences[0];
if (fileReference.TargetPath == matchedFile.TargetPath)
{
fileReference.XmlComClasses = matchedFile.ComClasses;
fileReference.XmlTypeLibs = matchedFile.TypeLibs;
}
}
}
}
application.FileReferences.Add(fileReference);
}
else
{
Expand Down
12 changes: 6 additions & 6 deletions ClickOnce/ClickOnce.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.7.82" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.5.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.3" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="3.1.3" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="17.14.28" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.10" />
<PackageReference Include="Microsoft.Extensions.FileSystemGlobbing" Version="9.0.10" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.ComponentModel.DataAnnotations" />
Expand Down
5 changes: 5 additions & 0 deletions ClickOnce/Command/Args/Args.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ protected Args(ArgsSource source, CommandVerb? verb = null)
private string fileAssociations;
public static string Help_Arg_FileAssociations => GetHelpText();

[Option(SetName = "MergeCom", HelpText = nameof(Help_Arg_MergeCom), ResourceType = typeof(Args))]
public virtual bool? MergeCom { get => mergeCom; set => SetValue(value, ref mergeCom); }
private bool? mergeCom;
public static string Help_Arg_MergeCom => GetHelpText();

[Option(HelpText = nameof(Help_Arg_UseApplicationTrust), ResourceType = typeof(Args))]
public virtual bool? UseApplicationTrust { get => useApplicationTrust; set => SetValue(value, ref useApplicationTrust); }
private bool? useApplicationTrust;
Expand Down
5 changes: 3 additions & 2 deletions ClickOnce/Project/Project.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ internal Project(params Args[] args)
internal EnumOption<UseLauncher> UseLauncher => args.GetEnum<UseLauncher>();
internal BooleanOption CreateDesktopShortcut => args.GetBoolean();
internal BooleanOption CreateAutoRun => args.GetBoolean();
internal StringOption FileAssociations => args.GetString();
internal StringOption FileAssociations => args.GetString();
internal BooleanOption MergeCom => args.GetBoolean();
internal BooleanOption UseApplicationTrust => args.GetBoolean();
internal TrustOption TrustInfo => args.GetTrust(SameSite.Value, Source.RootedPath);
internal BooleanOption SameSite => args.GetBoolean();
Expand All @@ -62,7 +63,7 @@ internal Project(params Args[] args)
internal StringOption TimestampUrl => args.GetString();
internal BooleanOption Quiet => args.GetBoolean();
internal BooleanOption Verbose => args.GetBoolean();

internal void Validate()
{
if (!Directory.Exists(Source.Value))
Expand Down
Loading
Loading