Skip to content

Commit

Permalink
Merge pull request #1242 from szanto90balazs/use-icon-for-taskbar-ico…
Browse files Browse the repository at this point in the history
…n-too

set the already sepcified icon to AnimatedGifWindow, too
  • Loading branch information
anaisbetts committed May 1, 2018
2 parents aede392 + aead1c5 commit 250fe4c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/Update/AnimatedGifWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down
10 changes: 8 additions & 2 deletions src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -581,7 +581,7 @@ void waitForParentToExit()
}
}

async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir, string backgroundGif, string signingOpts)
async Task<string> createSetupEmbeddedZip(string fullPackage, string releasesDir, string backgroundGif, string signingOpts, string setupIcon)
{
string tempPath;

Expand All @@ -598,6 +598,12 @@ async Task<string> 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"));

Expand Down

0 comments on commit 250fe4c

Please sign in to comment.