Skip to content

Commit

Permalink
merged changes related to the proepr install of plugin mods such as @…
Browse files Browse the repository at this point in the history
…cat_or_not s kyurid

mod
  • Loading branch information
BigSpice committed Apr 18, 2023
1 parent 3f5cc6c commit b074ad4
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 167 deletions.
Binary file modified VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
34 changes: 27 additions & 7 deletions VTOL_2.0.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,25 @@ static void Main(string[] args)


}
public string ProductVersion
{
get
{
try
{
string file = (FileVersionInfo.GetVersionInfo(Assembly.GetCallingAssembly().Location).ProductVersion).ToString();
return file.Substring(0, file.IndexOf("+") + 1).Replace("+", "");
}
catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");

}
return "1.0.0";

}
}

public MainWindow()
{
try
Expand Down Expand Up @@ -268,9 +286,9 @@ public MainWindow()
true // Whether to change accents automatically
);





VERSION_TEXT.Text = "VTOL - " + ProductVersion + " |";

if (IsAdministrator())
{
Expand All @@ -283,13 +301,13 @@ public MainWindow()

}


}


catch (Exception ex)
{

Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");
}


Expand Down Expand Up @@ -643,8 +661,8 @@ private void Log_Folder_warning_Click(object sender, RoutedEventArgs e)
}
catch (Exception ex)
{


Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");


}
Expand Down Expand Up @@ -724,6 +742,7 @@ private void Changelog_Click(object sender, RoutedEventArgs e)

catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");
}
}

Expand Down Expand Up @@ -930,11 +949,12 @@ private void Main_Win_Control_StateChanged(object sender, EventArgs e)

catch (Exception ex)
{

Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");



}

}


}
Expand Down
19 changes: 10 additions & 9 deletions VTOL_2.0.0/Pages/Page_Home.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ public string ProductVersion
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");

}
return "0.0.0";
return "1.0.0";

}
}
Expand All @@ -752,7 +752,7 @@ async void Auto_Install_(bool resart_ = false)
if (File.Exists(Current_Install_Folder + @"NorthstarLauncher.exe") && File.Exists(Current_Install_Folder + @"Titanfall2.exe"))
{
NSExe = Get_And_Set_Filepaths(Current_Install_Folder, "NorthstarLauncher.exe");
await Task.Delay(1500);
await Task.Delay(200);

// Get the file version info for the notepad.
FileVersionInfo myFileVersionInfo = FileVersionInfo.GetVersionInfo(Current_Install_Folder + @"NorthstarLauncher.exe");
Expand Down Expand Up @@ -780,7 +780,7 @@ async void Auto_Install_(bool resart_ = false)
NSExe = Get_And_Set_Filepaths(Current_Install_Folder, "NorthstarLauncher.exe");
});
await Task.Delay(1500);
await Task.Delay(200);

if (resart_ == true)
{
Expand Down Expand Up @@ -3240,7 +3240,7 @@ private void Parse_Release(string json_name = "temp.json")

}
}

void Check_For_New_Northstar_Install()
{
try
Expand Down Expand Up @@ -3312,13 +3312,14 @@ void Check_For_New_Northstar_Install()
catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}");
//Removed PaperTrailSystem Due to lack of reliability.
//Removed PaperTrailSystem Due to lack of reliability.

}



}

async Task Install_NS_METHOD()
{
await Task.Run(async () =>
Expand Down Expand Up @@ -3596,7 +3597,7 @@ private void Completed(object sender, AsyncCompletedEventArgs e)
public bool TryDeleteDirectory(
string directoryPath, bool overwrite = true,
int maxRetries = 10,
int millisecondsDelay = 300)
int millisecondsDelay = 100)
{
if (directoryPath == null)
throw new ArgumentNullException(directoryPath);
Expand Down Expand Up @@ -3631,7 +3632,7 @@ public bool TryDeleteDirectory(
public bool TryCreateDirectory(
string directoryPath,
int maxRetries = 10,
int millisecondsDelay = 200)
int millisecondsDelay = 100)
{
if (directoryPath == null)
throw new ArgumentNullException(directoryPath);
Expand Down Expand Up @@ -3670,7 +3671,7 @@ public bool TryCreateDirectory(
public bool TryMoveFile(
string Origin, string Destination, bool overwrite = true,
int maxRetries = 10,
int millisecondsDelay = 200)
int millisecondsDelay = 100)
{
if (Origin == null)
throw new ArgumentNullException(Origin);
Expand Down Expand Up @@ -3705,7 +3706,7 @@ public bool TryMoveFile(
public bool TryCopyFile(
string Origin, string Destination, bool overwrite = true,
int maxRetries = 10,
int millisecondsDelay = 300)
int millisecondsDelay = 100)
{
if (Origin == null)
throw new ArgumentNullException(Origin);
Expand Down
2 changes: 1 addition & 1 deletion VTOL_2.0.0/Pages/Page_Thunderstore.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
</Border>

<ui:Button x:Name="Install_Bttn_Thunderstore" Margin="130,250,10,0" Background="{Binding Button_Color}" HorizontalAlignment="Stretch" Height="29" Content="{Binding Button_label}" FontSize="14" Icon="ArrowDownload16" BorderBrush="{x:Null}" VerticalAlignment="Top" Padding="0,0,0,0" Tag="{Binding download_url}" Click="Install_Bttn_Thunderstore_Click" ToolTip ="{Binding Tag}" ToolTipService.IsEnabled="False" AutomationProperties.IsRequiredForForm="False" CommandParameter="{Binding Update_data}"/>
<TextBlock TextAlignment="Left" Text="{Binding date_created}" Margin="10,161,10,107" Background="{x:Null}" Foreground="#FFC7C7C7" FontSize="11" RenderTransformOrigin="0.5,0.5">
<TextBlock TextAlignment="Left" Text="{Binding date_created}" Margin="10,161,10,107" Background="{x:Null}" Foreground="#FFC7C7C7" FontSize="11.5" RenderTransformOrigin="0.5,0.5">
<TextBlock.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="1"/>
Expand Down
Loading

7 comments on commit b074ad4

@BigSpice
Copy link
Collaborator Author

@BigSpice BigSpice commented on b074ad4 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@catornot any special changes you would want for plugins in the future?.

@catornot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not

@ASpoonPlaysGames
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning for users would be nice, as plugins are a compiled dll after all

@catornot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, a warning would be cool
for flight core @GeckoEidechse wants plugins installing to be in dev view only :(
so that could also be a solution but probably less ideal imo

@BigSpice
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning for users would be nice, as plugins are a compiled dll after all

will add on for 3.0.0

@BigSpice
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it currently does indeed tell you it is a plugin thankfully

@GeckoEidechse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A warning for users would be nice, as plugins are a compiled dll after all

100% this. Plugins can fuck your whole system. And if we have a malicious one on Thunderstore it will be Northstar who will get all the blame directed at, regardless of whether valid or not.

Personally I'd prefer a combo of requiring to toggle an initial setting and then also showing a warning pop-up everytime a plugin is installed with a request to confirm. End-users will always ignore stuff whenever convenient so you need to make it as much in your face as possible.

Please sign in to comment.