Skip to content

Commit 250fe4c

Browse files
authored
Merge pull request #1242 from szanto90balazs/use-icon-for-taskbar-icon-too
set the already sepcified icon to AnimatedGifWindow, too
2 parents aede392 + aead1c5 commit 250fe4c

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

src/Update/AnimatedGifWindow.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ public AnimatedGifWindow()
2121
var img = new Image();
2222
var src = default(BitmapImage);
2323

24+
var executionLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
2425
var source = Path.Combine(
25-
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
26+
executionLocation,
2627
"background.gif");
2728

2829
if (File.Exists(source)) {
@@ -36,6 +37,11 @@ public AnimatedGifWindow()
3637
this.Width = src.Width;
3738
this.Height = src.Height;
3839
}
40+
41+
var setupIcon = Path.Combine(executionLocation, "setupIcon.ico");
42+
if (File.Exists(setupIcon)) {
43+
Icon = BitmapFrame.Create(new Uri(setupIcon, UriKind.Relative));
44+
}
3945

4046
this.AllowsTransparency = true;
4147
this.WindowStyle = WindowStyle.None;

src/Update/Program.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ public void Releasify(string package, string targetDir = null, string packagesDi
443443
var newestFullRelease = releaseEntries.MaxBy(x => x.Version).Where(x => !x.IsDelta).First();
444444

445445
File.Copy(bootstrapperExe, targetSetupExe, true);
446-
var zipPath = createSetupEmbeddedZip(Path.Combine(di.FullName, newestFullRelease.Filename), di.FullName, backgroundGif, signingOpts).Result;
446+
var zipPath = createSetupEmbeddedZip(Path.Combine(di.FullName, newestFullRelease.Filename), di.FullName, backgroundGif, signingOpts, setupIcon).Result;
447447

448448
var writeZipToSetup = Utility.FindHelperExecutable("WriteZipToSetup.exe");
449449

@@ -581,7 +581,7 @@ void waitForParentToExit()
581581
}
582582
}
583583

584-
async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir, string backgroundGif, string signingOpts)
584+
async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir, string backgroundGif, string signingOpts, string setupIcon)
585585
{
586586
string tempPath;
587587

@@ -598,6 +598,12 @@ async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir
598598
}, "Failed to write animated GIF to temp dir: " + tempPath);
599599
}
600600

601+
if (!String.IsNullOrWhiteSpace(setupIcon)) {
602+
this.ErrorIfThrows(() => {
603+
File.Copy(setupIcon, Path.Combine(tempPath, "setupIcon.ico"));
604+
}, "Failed to write icon to temp dir: " + tempPath);
605+
}
606+
601607
var releases = new[] { ReleaseEntry.GenerateFromFile(fullPackage) };
602608
ReleaseEntry.WriteReleaseFile(releases, Path.Combine(tempPath, "RELEASES"));
603609

0 commit comments

Comments
 (0)