Include Version.txt to prevent updater issues atm

This commit is contained in:
KillzXGaming 2019-05-15 16:54:49 -04:00
parent 9c8f023a75
commit 33f8c5892b
7 changed files with 28 additions and 8 deletions

Binary file not shown.

View file

@ -82,6 +82,10 @@ namespace Toolbox
Runtime.CommitInfo = version.CommitInfo;
Runtime.CompileDate = version.CompileDate;
}
else
{
version.SaveVersionInfo();
}
ThreadStart t = new ThreadStart(UpdateProgram.CheckLatest);
Thread thread = new Thread(t);

View file

@ -9,9 +9,9 @@ namespace Toolbox
{
public class VersionCheck
{
public string ProgramVersion;
public string CompileDate;
public string CommitInfo;
public string ProgramVersion = "";
public string CompileDate = "";
public string CommitInfo = "";
public VersionCheck(bool HasVersionTxt)
{
@ -32,6 +32,9 @@ namespace Toolbox
public void SaveVersionInfo()
{
string path = Runtime.ExecutableDir + "Version.txt";
if (!File.Exists(path))
File.Create(path);
using (StreamWriter writer = new StreamWriter(path))
{
writer.WriteLine($"{ProgramVersion}");

View file

@ -26,10 +26,22 @@ namespace Updater
var client = new GitHubClient(new ProductHeaderValue("ST_UpdateTool"));
GetReleases(client).Wait();
string[] versionInfo = File.ReadLines(Path.Combine(execDirectory, "Version.txt")).ToArray();
string ProgramVersion = versionInfo[0];
string CompileDate = versionInfo[1];
string CommitInfo = versionInfo[2];
string versionTxt = Path.Combine(execDirectory, "Version.txt");
if (!File.Exists(versionTxt))
File.Create(versionTxt);
string[] versionInfo = File.ReadLines(versionTxt).ToArray();
string ProgramVersion = "";
string CompileDate = "";
string CommitInfo = "";
if (versionInfo.Length >= 3)
{
ProgramVersion = versionInfo[0];
CompileDate = versionInfo[1];
CommitInfo = versionInfo[2];
}
foreach (string arg in args)
{

View file

@ -19,9 +19,10 @@ deploy:
force_update: true
after_build:
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Toolbox.exe"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Version.txt"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Toolbox.exe.config"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Toolbox.pdb"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Toolbox.exe"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Lib"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Updater.exe"
- 7z a "Switch-Toolbox-Latest.zip" "%APPVEYOR_BUILD_FOLDER%\Toolbox\bin\Release\Updater.pdb"