Merge pull request #1242 from szanto90balazs/use-icon-for-taskbar-icon-too

set the already sepcified icon to AnimatedGifWindow, too
This commit is contained in:
Paul Betts
2018-05-01 14:08:39 -07:00
committed by GitHub
2 changed files with 15 additions and 3 deletions

View File

@@ -21,8 +21,9 @@ namespace Squirrel.Update
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)) {
@@ -37,6 +38,11 @@ namespace Squirrel.Update
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;
this.WindowStartupLocation = WindowStartupLocation.CenterScreen;

View File

@@ -443,7 +443,7 @@ namespace Squirrel.Update
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 @@ namespace Squirrel.Update
}
}
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;
@@ -598,6 +598,12 @@ namespace Squirrel.Update
}, "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"));