Skip to content

Commit b7ecb63

Browse files
committed
force upd
1 parent 12f6451 commit b7ecb63

5 files changed

Lines changed: 28 additions & 33 deletions

File tree

Bloxstrap/App.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public partial class App : Application
2424
public const string ProjectName = "Froststrap";
2525
#endif
2626
public const string ProjectOwner = "Froststrap";
27-
public const string ProjectRepository = "RealMeddsam/Froststrap";
27+
public const string ProjectRepository = "Froststrap/Froststrap";
2828
public const string ProjectDownloadLink = "https://github.com/Froststrap/Froststrap/releases";
2929
public const string ProjectHelpLink = "https://github.com/bloxstraplabs/bloxstrap/wiki";
3030
public const string ProjectSupportLink = "https://github.com/Froststrap/Froststrap/issues/new";

Bloxstrap/Bloxstrap.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<UseWPF>true</UseWPF>
1010
<UseWindowsForms>True</UseWindowsForms>
1111
<ApplicationIcon>Bloxstrap.ico</ApplicationIcon>
12-
<Version>1.4.1.2</Version>
13-
<FileVersion>1.4.1.2</FileVersion>
12+
<Version>1.4.1.0</Version>
13+
<FileVersion>1.4.1.0</FileVersion>
1414
<ApplicationManifest>app.manifest</ApplicationManifest>
1515
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
1616
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

Bloxstrap/Bootstrapper.cs

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1149,12 +1149,12 @@ public void Cancel()
11491149
App.SoftTerminate(ErrorCode.ERROR_CANCELLED);
11501150
}
11511151
#endregion
1152-
11531152
#region App Install
11541153
private async Task<bool> CheckForUpdates()
11551154
{
11561155
const string LOG_IDENT = "Bootstrapper::CheckForUpdates";
11571156

1157+
// Basic safety check: don't update if another instance is already doing it
11581158
if (Process.GetProcessesByName(App.ProjectName).Length > 1)
11591159
{
11601160
App.Logger.WriteLine(LOG_IDENT, $"More than one {App.ProjectName} instance running, aborting update check.");
@@ -1168,30 +1168,21 @@ private async Task<bool> CheckForUpdates()
11681168
if (releaseInfo is null)
11691169
return false;
11701170

1171-
string currentVer = App.Version;
11721171
string releaseVer = releaseInfo.TagName;
11731172

1174-
var versionComparison = Utilities.CompareVersions(currentVer, releaseVer);
1175-
1176-
if (versionComparison == VersionComparison.LessThan)
1177-
{
1178-
App.Logger.WriteLine(LOG_IDENT, $"Update available: {currentVer} -> {releaseVer}");
1173+
// Logic removed: We no longer compare currentVer vs releaseVer.
1174+
// We proceed directly to the update prompt/process.
1175+
App.Logger.WriteLine(LOG_IDENT, $"Forcing update to version: {releaseVer}");
11791176

1180-
var result = Frontend.ShowMessageBox(
1181-
$"A new version {releaseVer} is available. Would you like to update now?",
1182-
MessageBoxImage.Question,
1183-
MessageBoxButton.YesNo
1184-
);
1177+
var result = Frontend.ShowMessageBox(
1178+
$"A new version {releaseVer} is available. Would you like to update now?",
1179+
MessageBoxImage.Question,
1180+
MessageBoxButton.YesNo
1181+
);
11851182

1186-
if (result != MessageBoxResult.Yes)
1187-
{
1188-
App.Logger.WriteLine(LOG_IDENT, "User declined the update.");
1189-
return false;
1190-
}
1191-
}
1192-
else
1183+
if (result != MessageBoxResult.Yes)
11931184
{
1194-
App.Logger.WriteLine(LOG_IDENT, $"No update required. Current version: {currentVer}, Release version: {releaseVer}");
1185+
App.Logger.WriteLine(LOG_IDENT, "User declined the forced update.");
11951186
return false;
11961187
}
11971188

@@ -1249,12 +1240,12 @@ private async Task<bool> CheckForUpdates()
12491240
var process = Process.Start(startInfo);
12501241
if (process == null)
12511242
{
1252-
var result = Frontend.ShowMessageBox(
1243+
var failResult = Frontend.ShowMessageBox(
12531244
string.Format(Strings.Bootstrapper_AutoUpdateFailed, version),
1254-
MessageBoxImage.Information,
1255-
MessageBoxButton.YesNo);
1245+
MessageBoxImage.Information,
1246+
MessageBoxButton.YesNo);
12561247

1257-
if (result == MessageBoxResult.Yes)
1248+
if (failResult == MessageBoxResult.Yes)
12581249
{
12591250
Utilities.ShellExecute(App.ProjectDownloadLink);
12601251
}
@@ -1265,15 +1256,15 @@ private async Task<bool> CheckForUpdates()
12651256
}
12661257
catch (Exception ex)
12671258
{
1268-
App.Logger.WriteLine(LOG_IDENT, "An exception occurred when running the auto-updater");
1259+
App.Logger.WriteLine(LOG_IDENT, "An exception occurred during the forced update.");
12691260
App.Logger.WriteException(LOG_IDENT, ex);
12701261

1271-
var result = Frontend.ShowMessageBox(
1262+
var failResult = Frontend.ShowMessageBox(
12721263
string.Format(Strings.Bootstrapper_AutoUpdateFailed, version),
12731264
MessageBoxImage.Information,
12741265
MessageBoxButton.YesNo);
12751266

1276-
if (result == MessageBoxResult.Yes)
1267+
if (failResult == MessageBoxResult.Yes)
12771268
{
12781269
Utilities.ShellExecute(App.ProjectDownloadLink);
12791270
}
@@ -1282,7 +1273,6 @@ private async Task<bool> CheckForUpdates()
12821273
return false;
12831274
}
12841275
#endregion
1285-
12861276
#region Roblox Install
12871277
private static bool TryDeleteRobloxInDirectory(string dir)
12881278
{

Bloxstrap/UI/ViewModels/Installer/WelcomeViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public class WelcomeViewModel : NotifyPropertyChangedViewModel
55
// formatting is done here instead of in xaml, it's just a bit easier
66
public string MainText => String.Format(
77
Strings.Installer_Welcome_MainText,
8-
"[github.com/RealMeddsam/Froststrap](https://github.com/RealMeddsam/Froststrap)"
8+
"[github.com/Froststrap/Froststrap](https://github.com/Froststrap/Froststrap)"
99
);
1010

1111
public bool CanContinue { get; set; } = false;

Bloxstrap/Utilities.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,19 @@ public static void ShellExecute(string website)
3030

3131
public static Version GetVersionFromString(string version)
3232
{
33+
version = version.Trim();
34+
3335
if (version.StartsWith('v'))
3436
version = version[1..];
3537

3638
int idx = version.IndexOf('+'); // commit info
3739
if (idx != -1)
3840
version = version[..idx];
3941

40-
return new Version(version);
42+
if (Version.TryParse(version, out Version? result))
43+
return result;
44+
45+
return new Version(0, 0);
4146
}
4247

4348
/// <summary>

0 commit comments

Comments
 (0)