Skip to content

Commit 3078433

Browse files
committed
Added support for client assembly %this% with non '.dll' extension. This solves the problem with DTF runtime asm probing failing to locate non standard assemblies (e.g. '.compiled').
1 parent 94c0d6e commit 3078433

6 files changed

Lines changed: 7 additions & 9 deletions

File tree

1.5 KB
Binary file not shown.
5 KB
Binary file not shown.
20 KB
Binary file not shown.

Source/src/WixSharp/Bootstrapper/BootstrapperApplication.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public override void AutoGenerateSources(string outDir)
4949
rawAppAssembly = AppAssembly;
5050
if (rawAppAssembly.EndsWith("%this%"))
5151
{
52-
rawAppAssembly = Compiler.ResolveClientAsm(rawAppAssembly, outDir); //NOTE: if a new file is generated then the Compiler takes care for cleaning any temps
52+
rawAppAssembly = Compiler.ResolveClientAsm(outDir); //NOTE: if a new file is generated then the Compiler takes care for cleaning any temps
5353
if (Payloads.FirstOrDefault(x => x.SourceFile == "%this%") is Payload payload_this)
5454
payload_this.SourceFile = rawAppAssembly;
5555
}

Source/src/WixSharp/Compiler.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ static void Build(Project project, string path, OutputType type)
757757

758758
try
759759
{
760-
//System.Diagnostics.Debug.Assert(false);
760+
// System.Diagnostics.Debug.Assert(false);
761761
Compiler.TempFiles.Clear();
762762
string compiler = Utils.PathCombine(WixLocation, @"candle.exe");
763763
string linker = Utils.PathCombine(WixLocation, @"light.exe");
@@ -3032,12 +3032,13 @@ static public string ClientAssembly
30323032
/// </summary>
30333033
static public bool IgnoreClientAssemblyPDB = false;
30343034

3035-
internal static string ResolveClientAsm(string asmName, string outDir)
3035+
internal static string ResolveClientAsm(string outDir)
30363036
{
30373037
//restore the original assembly name as MakeSfxCA does not like renamed assemblies
30383038
string newName = Utils.OriginalAssemblyFile(ClientAssembly);
30393039
newName = newName.PathChangeDirectory(outDir);
30403040

3041+
30413042
if (!ClientAssembly.SamePathAs(newName))
30423043
{
30433044
IO.File.Copy(ClientAssembly, newName, true);
@@ -3118,7 +3119,7 @@ static void PackageManagedAsm(string asm, string nativeDll, string[] refAssembli
31183119
var outDll = IO.Path.GetFullPath(nativeDll);
31193120
var asmFile = IO.Path.GetFullPath(asm);
31203121

3121-
var clientAsmPath = ResolveClientAsm(asmFile, outDir);
3122+
var clientAsmPath = ResolveClientAsm(outDir);
31223123
if (asmFile.EndsWith("%this%"))
31233124
asmFile = clientAsmPath;
31243125

@@ -3141,7 +3142,7 @@ static void PackageManagedAsm(string asm, string nativeDll, string[] refAssembli
31413142

31423143
if (file == "%this%")
31433144
{
3144-
refAasmFile = ResolveClientAsm(file, outDir);
3145+
refAasmFile = ResolveClientAsm(outDir);
31453146
}
31463147
else
31473148
{

Source/src/WixSharp/ProjectValidator.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,8 @@ public string OriginalAssemblyFile(string file)
226226
if (asm == null)
227227
asm = System.Reflection.Assembly.ReflectionOnlyLoadFrom(file);
228228

229+
// for example 'setup.cs.dll' vs 'setup.cs.compiled'
229230
var name = asm.ManifestModule.ScopeName;
230-
if (Path.GetExtension(name) != Path.GetExtension(file))
231-
{
232-
name = Path.GetFileNameWithoutExtension(name) + Path.GetExtension(file);
233-
}
234231

235232
return IO.Path.Combine(dir, name);
236233
}

0 commit comments

Comments
 (0)