summaryrefslogtreecommitdiff
path: root/src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs')
-rw-r--r--src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs35
1 files changed, 24 insertions, 11 deletions
diff --git a/src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs b/src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs
index 54f1dfc9..8211bf83 100644
--- a/src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs
+++ b/src/wix/WixToolset.Core.Burn/Bundles/CreateBundleExeCommand.cs
@@ -259,11 +259,11 @@ namespace WixToolset.Core.Burn.Bundles
259 return new Version(major, minor, build, revision); 259 return new Version(major, minor, build, revision);
260 } 260 }
261 261
262 private static void UpdateBurnResources(string bundleTempPath, string outputPath, WixBundleSymbol bundleInfo, Version windowsAssemblyVersion, byte[] applicationManifestData) 262 private void UpdateBurnResources(string bundleTempPath, string outputPath, WixBundleSymbol bundleInfo, Version windowsAssemblyVersion, byte[] applicationManifestData)
263 { 263 {
264 const int burnLocale = 1033; 264 const int burnLocale = 1033;
265 var resources = new Dtf.Resources.ResourceCollection(); 265 var resources = new ResourceCollection();
266 var version = new Dtf.Resources.VersionResource("#1", burnLocale); 266 var version = new VersionResource("#1", burnLocale);
267 267
268 version.Load(bundleTempPath); 268 version.Load(bundleTempPath);
269 resources.Add(version); 269 resources.Add(version);
@@ -292,10 +292,10 @@ namespace WixToolset.Core.Burn.Bundles
292 strings["CompanyName"] = String.Empty; 292 strings["CompanyName"] = String.Empty;
293 } 293 }
294 294
295 if (!String.IsNullOrEmpty(bundleInfo.IconSourceFile)) 295 if (bundleInfo.IconSourceFile != null)
296 { 296 {
297 var iconGroup = new Dtf.Resources.GroupIconResource("#1", burnLocale); 297 var iconGroup = new GroupIconResource("#1", burnLocale);
298 iconGroup.ReadFromFile(bundleInfo.IconSourceFile); 298 iconGroup.ReadFromFile(bundleInfo.IconSourceFile.Path);
299 resources.Add(iconGroup); 299 resources.Add(iconGroup);
300 300
301 foreach (var icon in iconGroup.Icons) 301 foreach (var icon in iconGroup.Icons)
@@ -306,10 +306,10 @@ namespace WixToolset.Core.Burn.Bundles
306 306
307 var splashScreenType = BURN_SPLASH_SCREEN_TYPE.BURN_SPLASH_SCREEN_TYPE_NONE; 307 var splashScreenType = BURN_SPLASH_SCREEN_TYPE.BURN_SPLASH_SCREEN_TYPE_NONE;
308 308
309 if (!String.IsNullOrEmpty(bundleInfo.SplashScreenSourceFile)) 309 if (bundleInfo.SplashScreenSourceFile != null)
310 { 310 {
311 var bitmap = new Dtf.Resources.BitmapResource("#1", burnLocale); 311 var bitmap = new BitmapResource("#1", burnLocale);
312 bitmap.ReadFromFile(bundleInfo.SplashScreenSourceFile); 312 bitmap.ReadFromFile(bundleInfo.SplashScreenSourceFile.Path);
313 resources.Add(bitmap); 313 resources.Add(bitmap);
314 314
315 splashScreenType = BURN_SPLASH_SCREEN_TYPE.BURN_SPLASH_SCREEN_TYPE_BITMAP_RESOURCE; 315 splashScreenType = BURN_SPLASH_SCREEN_TYPE.BURN_SPLASH_SCREEN_TYPE_BITMAP_RESOURCE;
@@ -321,13 +321,26 @@ namespace WixToolset.Core.Burn.Bundles
321 ResourceId = 1, 321 ResourceId = 1,
322 }; 322 };
323 323
324 var splashScreenConfigResource = new Dtf.Resources.Resource(ResourceType.RCData, "#1", burnLocale, splashScreenConfig.ToBytes()); 324 var splashScreenConfigResource = new Resource(ResourceType.RCData, "#1", burnLocale, splashScreenConfig.ToBytes());
325 resources.Add(splashScreenConfigResource); 325 resources.Add(splashScreenConfigResource);
326 326
327 var manifestResource = new Resource(ResourceType.Manifest, "#1", burnLocale, applicationManifestData); 327 var manifestResource = new Resource(ResourceType.Manifest, "#1", burnLocale, applicationManifestData);
328 resources.Add(manifestResource); 328 resources.Add(manifestResource);
329 329
330 resources.Save(bundleTempPath); 330 try
331 {
332 resources.Save(bundleTempPath);
333 }
334 catch (IOException)
335 {
336 // If there was no icon or splash screen then this is unexpected so rethrow.
337 if (bundleInfo.IconSourceFile == null && bundleInfo.SplashScreenSourceFile == null)
338 {
339 throw;
340 }
341
342 this.Messaging.Write(BurnBackendErrors.FailedToAddIconOrSplashScreenToBundle(bundleInfo.SourceLineNumbers, bundleInfo.IconSourceFile?.Path, bundleInfo.SplashScreenSourceFile?.Path));
343 }
331 } 344 }
332 345
333 enum BURN_SPLASH_SCREEN_TYPE 346 enum BURN_SPLASH_SCREEN_TYPE