diff options
| author | Rob Mensching <rob@firegiant.com> | 2017-11-29 22:03:26 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2017-11-29 22:03:26 -0800 |
| commit | 71c52d5af2293d3eb79882ce36b0411f81185c11 (patch) | |
| tree | 23dd116bdd6abc2b0f7b488f490d1b77faa41812 /src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs | |
| parent | 0fa198ed8c6c6fc81e649466879752a99fe37d08 (diff) | |
| download | wix-71c52d5af2293d3eb79882ce36b0411f81185c11.tar.gz wix-71c52d5af2293d3eb79882ce36b0411f81185c11.tar.bz2 wix-71c52d5af2293d3eb79882ce36b0411f81185c11.zip | |
Fix source path and cabinet processing
Diffstat (limited to 'src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs')
| -rw-r--r-- | src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs index 229e75b4..7985c120 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs | |||
| @@ -7,7 +7,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind | |||
| 7 | using System.Collections.Specialized; | 7 | using System.Collections.Specialized; |
| 8 | using System.Globalization; | 8 | using System.Globalization; |
| 9 | using System.IO; | 9 | using System.IO; |
| 10 | using WixToolset.Core.Cab; | 10 | using WixToolset.Core.Native; |
| 11 | using WixToolset.Data; | 11 | using WixToolset.Data; |
| 12 | using WixToolset.Data.Rows; | 12 | using WixToolset.Data.Rows; |
| 13 | using WixToolset.Msi; | 13 | using WixToolset.Msi; |
| @@ -88,9 +88,9 @@ namespace WixToolset.Core.WindowsInstaller.Unbind | |||
| 88 | string cabinetFile = Path.Combine(this.IntermediateFolder, String.Concat("Media", Path.DirectorySeparatorChar, diskId.ToString(CultureInfo.InvariantCulture), ".cab")); | 88 | string cabinetFile = Path.Combine(this.IntermediateFolder, String.Concat("Media", Path.DirectorySeparatorChar, diskId.ToString(CultureInfo.InvariantCulture), ".cab")); |
| 89 | 89 | ||
| 90 | // ensure the parent directory exists | 90 | // ensure the parent directory exists |
| 91 | System.IO.Directory.CreateDirectory(Path.GetDirectoryName(cabinetFile)); | 91 | Directory.CreateDirectory(Path.GetDirectoryName(cabinetFile)); |
| 92 | 92 | ||
| 93 | using (FileStream fs = System.IO.File.Create(cabinetFile)) | 93 | using (FileStream fs = File.Create(cabinetFile)) |
| 94 | { | 94 | { |
| 95 | int bytesRead; | 95 | int bytesRead; |
| 96 | byte[] buffer = new byte[512]; | 96 | byte[] buffer = new byte[512]; |
| @@ -128,16 +128,14 @@ namespace WixToolset.Core.WindowsInstaller.Unbind | |||
| 128 | 128 | ||
| 129 | foreach (string cabinetFile in cabinetFiles) | 129 | foreach (string cabinetFile in cabinetFiles) |
| 130 | { | 130 | { |
| 131 | using (var extractCab = new WixExtractCab()) | 131 | try |
| 132 | { | 132 | { |
| 133 | try | 133 | var cabinet = new Cabinet(cabinetFile); |
| 134 | { | 134 | cabinet.Extract(fileDirectory); |
| 135 | extractCab.Extract(cabinetFile, fileDirectory); | 135 | } |
| 136 | } | 136 | catch (FileNotFoundException) |
| 137 | catch (FileNotFoundException) | 137 | { |
| 138 | { | 138 | throw new WixException(WixErrors.FileNotFound(new SourceLineNumber(this.InputFilePath), cabinetFile)); |
| 139 | throw new WixException(WixErrors.FileNotFound(new SourceLineNumber(this.InputFilePath), cabinetFile)); | ||
| 140 | } | ||
| 141 | } | 139 | } |
| 142 | } | 140 | } |
| 143 | } | 141 | } |
