mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
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:
@@ -21,8 +21,9 @@ namespace Squirrel.Update
|
|||||||
var img = new Image();
|
var img = new Image();
|
||||||
var src = default(BitmapImage);
|
var src = default(BitmapImage);
|
||||||
|
|
||||||
|
var executionLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
|
||||||
var source = Path.Combine(
|
var source = Path.Combine(
|
||||||
Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location),
|
executionLocation,
|
||||||
"background.gif");
|
"background.gif");
|
||||||
|
|
||||||
if (File.Exists(source)) {
|
if (File.Exists(source)) {
|
||||||
@@ -36,6 +37,11 @@ namespace Squirrel.Update
|
|||||||
this.Width = src.Width;
|
this.Width = src.Width;
|
||||||
this.Height = src.Height;
|
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.AllowsTransparency = true;
|
||||||
this.WindowStyle = WindowStyle.None;
|
this.WindowStyle = WindowStyle.None;
|
||||||
|
|||||||
@@ -443,7 +443,7 @@ namespace Squirrel.Update
|
|||||||
var newestFullRelease = releaseEntries.MaxBy(x => x.Version).Where(x => !x.IsDelta).First();
|
var newestFullRelease = releaseEntries.MaxBy(x => x.Version).Where(x => !x.IsDelta).First();
|
||||||
|
|
||||||
File.Copy(bootstrapperExe, targetSetupExe, true);
|
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");
|
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;
|
string tempPath;
|
||||||
|
|
||||||
@@ -598,6 +598,12 @@ namespace Squirrel.Update
|
|||||||
}, "Failed to write animated GIF to temp dir: " + tempPath);
|
}, "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) };
|
var releases = new[] { ReleaseEntry.GenerateFromFile(fullPackage) };
|
||||||
ReleaseEntry.WriteReleaseFile(releases, Path.Combine(tempPath, "RELEASES"));
|
ReleaseEntry.WriteReleaseFile(releases, Path.Combine(tempPath, "RELEASES"));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user