Skip to content

Commit

Permalink
Fixed Updater
Browse files Browse the repository at this point in the history
  • Loading branch information
BigSpice committed Jan 24, 2024
1 parent 1029154 commit 1848531
Show file tree
Hide file tree
Showing 16 changed files with 50 additions and 60 deletions.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/v17/fileList.bin
Binary file not shown.
45 changes: 45 additions & 0 deletions VTOL_2.0.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,52 @@ private void Reload__Click(object sender, RoutedEventArgs e)
Restart();

}
public void Check_For_New_Update()
{
try
{

var thisApp = Assembly.GetExecutingAssembly();
AssemblyName name = new AssemblyName(thisApp.FullName);
Updater Update = new Updater("BigSpice", "VTOL");


if (Update.CheckForUpdate())
{
VTOL_UPDATE_BADGE.Visibility = Visibility.Visible;

Snackbar.Message = "Update Available!, Please Check and Download The latest portable release.";
Snackbar.Title = "INFO";
Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Info;
Snackbar.Show();



}
else
{
VTOL_UPDATE_BADGE.Visibility = Visibility.Hidden;


Snackbar.Message = "No Update Found";
Snackbar.Title = "INFO";
Snackbar.Appearance = Wpf.Ui.Common.ControlAppearance.Info;
Snackbar.Show();
}




}
catch (Exception ex)
{


}



}
private void Main_Win_Control_Loaded(object sender, RoutedEventArgs e)
{
var geometry = new RectangleGeometry();
Expand Down
65 changes: 5 additions & 60 deletions VTOL_2.0.0/Pages/Page_About.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ public partial class Page_About : Page

private static String updaterModulePath;
bool is_portable_ = true;
Wpf.Ui.Controls.Snackbar SnackBar;

async Task Set_About()
{

About_BOX.IsReadOnly = true;
Paragraph paragraph = new Paragraph();
SnackBar = Main.Snackbar;


string Text = @"-This Application Installs The Northstar Launcher Created by BobTheBob and can install the countless Mods Authored by the many Titanfall2 Modders.
Expand Down Expand Up @@ -59,7 +57,7 @@ Big Thanks to -
@rrrfffrrr
@themoonisacheese
@xamionex
Every cent counts towards feeding my baby Ticks - https://www.buymeacoffee.com/Ju1cy ";
";

About_BOX.Document.Blocks.Clear();
Run run = new Run(Text);
Expand Down Expand Up @@ -121,78 +119,25 @@ private void Button_Click(object sender, RoutedEventArgs e)
{
try
{
Main.VTOL_UPDATE_BADGE.Visibility = Visibility.Hidden;
Process process = Process.Start(updaterModulePath, "/configure ");

Process[] processes = Process.GetProcessesByName(updaterModulePath);
if (processes.Length > 0)
processes[0].CloseMainWindow();
}
catch (Exception ex)
{

}
}
else
{
//Send_Error_Notif(GetTextResource("NOTIF_ERROR_UPDATER_NOT_FOUND"));

}
}
void Check_For_New_Update()
{
try
{

var thisApp = Assembly.GetExecutingAssembly();
AssemblyName name = new AssemblyName(thisApp.FullName);
Updater Update = new Updater("BigSpice", "VTOL");


if (Update.CheckForUpdate())
{

SnackBar.Message = "Update Available!, Please Check and Download The latest portable release.";
SnackBar.Title = "INFO";
SnackBar.Appearance = Wpf.Ui.Common.ControlAppearance.Info;
SnackBar.Show();



}
else
{
Main.VTOL_UPDATE_BADGE.Visibility = Visibility.Hidden;


SnackBar.Message = "No Update Found";
SnackBar.Title = "INFO";
SnackBar.Appearance = Wpf.Ui.Common.ControlAppearance.Info;
SnackBar.Show();
}




}
catch (Exception ex)
{


}




}

private void Check_Click(object sender, RoutedEventArgs e)
{

if (is_portable_ == false)
{
if (File.Exists(updaterModulePath))
{
// StartSilent();
Process process = Process.Start(updaterModulePath, "/checknow ");
// process.Close();
}

}
Expand All @@ -201,7 +146,7 @@ private void Check_Click(object sender, RoutedEventArgs e)



Check_For_New_Update();
Main.Check_For_New_Update();


}
Expand Down

0 comments on commit 1848531

Please sign in to comment.