Skip to content

Commit a933fc5

Browse files
committed
Link to exiled.Loader
Testing is rly needed on this as i cant test it locally because it takes the installer from github release
1 parent c0da411 commit a933fc5

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

EXILED/Exiled.Installer/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ internal static async Task MainSafe(CommandSettings args)
8989
GitHubClient.Credentials = new Credentials(args.GitHubToken, AuthenticationType.Bearer);
9090
}
9191

92-
if (string.IsNullOrEmpty(args.TargetVersion))
92+
if (string.IsNullOrEmpty(args.TargetVersion) && !args.PreReleases)
9393
{
9494
Console.WriteLine(Resources.Program_MainSafe_Which_version_would_you_like_to_install_);
9595
Console.WriteLine(Resources.Program_MainSafe__1___Latest_stable_release);

EXILED/Exiled.Loader/Models/NewVersion.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,22 @@ public readonly struct NewVersion
2424
/// </summary>
2525
public readonly ReleaseAsset Asset;
2626

27+
/// <summary>
28+
/// Indicates if the release is a prerelease.
29+
/// </summary>
30+
public readonly bool IsPrerelease;
31+
2732
/// <summary>
2833
/// Initializes a new instance of the <see cref="NewVersion"/> struct.
2934
/// </summary>
3035
/// <param name="release"><inheritdoc cref="Release"/></param>
3136
/// <param name="asset"><inheritdoc cref="Asset"/></param>
32-
public NewVersion(Release release, ReleaseAsset asset)
37+
/// /// <param name="isPrerelease">Indicates whether the release is a prerelease.</param>
38+
public NewVersion(Release release, ReleaseAsset asset, bool isPrerelease)
3339
{
3440
Release = release;
3541
Asset = asset;
42+
IsPrerelease = isPrerelease;
3643
}
3744
}
3845
}

EXILED/Exiled.Loader/Updater.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,11 @@ private bool FindUpdate(HttpClient client, bool forced, out NewVersion newVersio
167167
}
168168
else
169169
{
170+
bool isPrerelease = targetRelease.PreRelease;
171+
Log.Info($"Release type: {(isPrerelease ? "Prerelease" : "Stable")}");
172+
170173
Log.Info($"Found asset - Name: {asset.Name} | Size: {asset.Size} Download: {asset.BrowserDownloadUrl}");
171-
newVersion = new NewVersion(targetRelease, asset);
174+
newVersion = new NewVersion(targetRelease, asset, isPrerelease);
172175
return true;
173176
}
174177
}
@@ -226,7 +229,7 @@ private void Update(HttpClient client, NewVersion newVersion)
226229
FileName = installerPath,
227230
UseShellExecute = false,
228231
CreateNoWindow = true,
229-
Arguments = $"--exit {(Folder == "global" ? string.Empty : $"--target-port {Folder}")} --target-version {newVersion.Release.TagName} --appdata \"{Paths.AppData}\" --exiled \"{Path.Combine(Paths.Exiled, "..")}\"",
232+
Arguments = $"--exit {(Folder == "global" ? string.Empty : $"--target-port {Folder}")} --target-version {newVersion.Release.TagName} --appdata \"{Paths.AppData}\" --exiled \"{Path.Combine(Paths.Exiled, "..")}\" {(newVersion.IsPrerelease ? "--pre-releases" : string.Empty)}",
230233
RedirectStandardOutput = true,
231234
RedirectStandardError = true,
232235
StandardErrorEncoding = ProcessEncoding,

0 commit comments

Comments
 (0)