diff --git a/src/Update/AnimatedGifWindow.cs b/src/Update/AnimatedGifWindow.cs index b133cca89..9c32d5b32 100644 --- a/src/Update/AnimatedGifWindow.cs +++ b/src/Update/AnimatedGifWindow.cs @@ -21,8 +21,9 @@ public AnimatedGifWindow() var img = new Image(); var src = default(BitmapImage); + var executionLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var source = Path.Combine( - Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), + executionLocation, "background.gif"); if (File.Exists(source)) { @@ -36,6 +37,11 @@ public AnimatedGifWindow() this.Width = src.Width; this.Height = src.Height; } + + var setupIcon = Path.Combine(executionLocation, "setupIcon.ico"); + if (File.Exists(setupIcon)) { + Icon = BitmapFrame.Create(new Uri(setupIcon, UriKind.Relative)); + } this.AllowsTransparency = true; this.WindowStyle = WindowStyle.None; diff --git a/src/Update/Program.cs b/src/Update/Program.cs index 24c564075..f87ab691b 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -443,7 +443,7 @@ public void Releasify(string package, string targetDir = null, string packagesDi var newestFullRelease = releaseEntries.MaxBy(x => x.Version).Where(x => !x.IsDelta).First(); File.Copy(bootstrapperExe, targetSetupExe, true); - var zipPath = createSetupEmbeddedZip(Path.Combine(di.FullName, newestFullRelease.Filename), di.FullName, backgroundGif, signingOpts).Result; + var zipPath = createSetupEmbeddedZip(Path.Combine(di.FullName, newestFullRelease.Filename), di.FullName, backgroundGif, signingOpts, setupIcon).Result; var writeZipToSetup = Utility.FindHelperExecutable("WriteZipToSetup.exe"); @@ -581,7 +581,7 @@ void waitForParentToExit() } } - async Task createSetupEmbeddedZip(string fullPackage, string releasesDir, string backgroundGif, string signingOpts) + async Task createSetupEmbeddedZip(string fullPackage, string releasesDir, string backgroundGif, string signingOpts, string setupIcon) { string tempPath; @@ -598,6 +598,12 @@ async Task createSetupEmbeddedZip(string fullPackage, string releasesDir }, "Failed to write animated GIF to temp dir: " + tempPath); } + if (!String.IsNullOrWhiteSpace(setupIcon)) { + this.ErrorIfThrows(() => { + File.Copy(setupIcon, Path.Combine(tempPath, "setupIcon.ico")); + }, "Failed to write icon to temp dir: " + tempPath); + } + var releases = new[] { ReleaseEntry.GenerateFromFile(fullPackage) }; ReleaseEntry.WriteReleaseFile(releases, Path.Combine(tempPath, "RELEASES"));