Skip to content

Commit

Permalink
added logo to exe
Browse files Browse the repository at this point in the history
  • Loading branch information
johnoclockdk committed Dec 27, 2023
1 parent aacf7e2 commit 9601e24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Compiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ private static async Task UpdateFromGithub(Config config)
var response = await httpClient.GetStringAsync(apiURL);
var latestRelease = JObject.Parse(response);

string latestVersion = latestRelease["tag_name"].ToString();
string latestVersion = latestRelease["tag_name"]!.ToString();
Console.WriteLine("Latest Version: " + latestVersion);

Version latestVer = new Version(latestVersion);
Version currentVer = new Version(config.Version);

if (latestVer > currentVer)
{
string downloadUrl = latestRelease["assets"][0]["browser_download_url"].ToString();
string downloadUrl = latestRelease["assets"]![0]!["browser_download_url"]!.ToString();
string tempFilePath = Path.Combine(Path.GetTempPath(), "newExecutable.exe");

var downloadResponse = await httpClient.GetAsync(downloadUrl, HttpCompletionOption.ResponseHeadersRead);
Expand Down Expand Up @@ -94,7 +94,7 @@ private static async Task UpdateFromGithub(Config config)

private static void ReplaceExecutable(string newExecutablePath)
{
string currentExecutablePath = Process.GetCurrentProcess().MainModule.FileName;
string currentExecutablePath = Process.GetCurrentProcess().MainModule!.FileName;
string backupExecutablePath = currentExecutablePath + ".bak";

try
Expand All @@ -115,7 +115,7 @@ private static void ReplaceExecutable(string newExecutablePath)

private static void RelaunchApplication()
{
string currentExecutablePath = Process.GetCurrentProcess().MainModule.FileName;
string currentExecutablePath = Process.GetCurrentProcess().MainModule!.FileName;

ProcessStartInfo startInfo = new ProcessStartInfo
{
Expand Down Expand Up @@ -195,7 +195,7 @@ private static void DotnetUpdateApi(string folderPath, Config config)
// Check if the Silencelog setting is false before logging
if (config.Silencelog != true)
{
Console.WriteLine($"Update {file} package: {package}", ConsoleColor.Magenta);
Console.WriteLine($"Update {file} package: {package}");
}
RunDotnetAddPackage(file, package, config);
}
Expand Down
1 change: 1 addition & 0 deletions Compiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<Nullable>enable</Nullable>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<ApplicationIcon>logo.ico</ApplicationIcon>
</PropertyGroup>

<ItemGroup>
Expand Down
Binary file added logo.ico
Binary file not shown.

0 comments on commit 9601e24

Please sign in to comment.