aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core.WindowsInstaller/MspBackend.cs
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2020-02-13 14:28:58 -0500
committerBob Arnson <bob@firegiant.com>2020-02-13 15:07:43 -0500
commitadd525424e44a050d3f98f64e56a85ab5d79955d (patch)
treead02f4f8afe6dfb84db1fc10627058fc1ffe61fc /src/WixToolset.Core.WindowsInstaller/MspBackend.cs
parent7116076d1af5af5f9da51a263a3b8b6a4a2e4ab8 (diff)
downloadwix-add525424e44a050d3f98f64e56a85ab5d79955d.tar.gz
wix-add525424e44a050d3f98f64e56a85ab5d79955d.tar.bz2
wix-add525424e44a050d3f98f64e56a85ab5d79955d.zip
Make BindResult disposable to manage WixOutput disposability.
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/MspBackend.cs')
-rw-r--r--src/WixToolset.Core.WindowsInstaller/MspBackend.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs
index 8aa450bf..5dc64445 100644
--- a/src/WixToolset.Core.WindowsInstaller/MspBackend.cs
+++ b/src/WixToolset.Core.WindowsInstaller/MspBackend.cs
@@ -47,21 +47,24 @@ namespace WixToolset.Core.WindowsInstaller
47 47
48 // Create WindowsInstallerData with patch metdata and transforms as sub-storages 48 // Create WindowsInstallerData with patch metdata and transforms as sub-storages
49 // Create MSP from WindowsInstallerData 49 // Create MSP from WindowsInstallerData
50 using (var command = new BindDatabaseCommand(context, backendExtensions, subStorages, null)) 50 IBindResult result = null;
51 try
51 { 52 {
52 command.Execute(); 53 var command = new BindDatabaseCommand(context, backendExtensions, subStorages, null);
53 54 result = command.Execute();
54 var result = context.ServiceProvider.GetService<IBindResult>();
55 result.FileTransfers = command.FileTransfers;
56 result.TrackedFiles = command.TrackedFiles;
57 55
58 foreach (var extension in backendExtensions) 56 foreach (var extension in backendExtensions)
59 { 57 {
60 extension.PostBackendBind(result, command.Wixout); 58 extension.PostBackendBind(result);
61 } 59 }
62 60
63 return result; 61 return result;
64 } 62 }
63 catch
64 {
65 result?.Dispose();
66 throw;
67 }
65 } 68 }
66 69
67 public IDecompileResult Decompile(IDecompileContext context) => throw new NotImplementedException(); 70 public IDecompileResult Decompile(IDecompileContext context) => throw new NotImplementedException();