mirror of
https://github.com/rfvgyhn/min-ed-launcher.git
synced 2026-02-04 13:05:30 +00:00
allow skipping the prompt to install a product via new argument
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
"keepOpen": true
|
||||
}]
|
||||
```
|
||||
- Allow skipping the prompt to install a product when `/autorun` isn't specified with the new flag `/skipInstallPrompt`.
|
||||
|
||||
### Enhancements
|
||||
- Read additional processes' STDOUT/ERR asynchronously. This should allow [EDOMH] to launch without locking up.
|
||||
|
||||
@ -176,6 +176,7 @@ The following arguments are in addition to the above:
|
||||
| /frontier profile-name | Use this argument to login with a Frontier Store account. `profile-name` can be any name you want. Keep it to letters, numbers, dashes and underscores. See more details in the [multi-account] section |
|
||||
| /restart delay | Restart the game after it has closed with _delay_ being the number of seconds given to cancel the restart (i.e `/restart 3`) |
|
||||
| /dryrun | Prints output without launching any processes |
|
||||
| /skipInstallPrompt | Skips the prompt to install uninstalled products when `/autorun` is not specified |
|
||||
|
||||
##### Epic accounts and the /restart feature
|
||||
The restart feature requires either [Legendary] or [Heroic] to work with Epic accounts.
|
||||
|
||||
@ -442,8 +442,10 @@ let run settings launcherVersion cancellationToken = taskResult {
|
||||
|> List.toArray
|
||||
if settings.AutoRun then
|
||||
Product.selectProduct settings.ProductWhitelist missing |> Option.map(fun p -> [| p |]) |> Option.defaultWith(fun () -> [||])
|
||||
else
|
||||
else if not settings.SkipInstallPrompt then
|
||||
missing |> Console.promptForProductsToUpdate "install"
|
||||
else
|
||||
[||]
|
||||
let productsRequiringUpdate =
|
||||
products
|
||||
|> Product.filterByUpdateRequired
|
||||
|
||||
@ -15,6 +15,7 @@ let defaults =
|
||||
QuitMode = WaitForInput
|
||||
WatchForCrashes = true
|
||||
ProductWhitelist = OrdinalIgnoreCaseSet.empty
|
||||
SkipInstallPrompt = false
|
||||
ForceLocal = false
|
||||
CompatTool = None
|
||||
CbLauncherDir = "."
|
||||
@ -151,6 +152,7 @@ let parseArgs defaults (findCbLaunchDir: Platform -> Result<string,string>) (arg
|
||||
| "/autoquit", _ -> { s with QuitMode = Immediate }
|
||||
| "/forcelocal", _ -> { s with ForceLocal = true }
|
||||
| "/dryrun", _ -> { s with DryRun = true }
|
||||
| "/skipinstallprompt", _ -> { s with SkipInstallPrompt = true }
|
||||
| arg, _ when arg.StartsWith('/')
|
||||
&& arg.Length > 1 -> { s with ProductWhitelist = s.ProductWhitelist.Add (arg.TrimStart('/')) }
|
||||
| _ -> s) defaults
|
||||
|
||||
@ -111,6 +111,7 @@ type LauncherSettings =
|
||||
QuitMode: QuitMode
|
||||
WatchForCrashes: WatchForCrashes
|
||||
ProductWhitelist: OrdinalIgnoreCaseSet
|
||||
SkipInstallPrompt: bool
|
||||
ForceLocal: ForceLocal
|
||||
CompatTool: CompatTool option
|
||||
CbLauncherDir: string
|
||||
|
||||
@ -79,6 +79,10 @@ let tests =
|
||||
let settings = parse [| "/novr" |]
|
||||
Expect.equal settings.DisplayMode Pancake ""
|
||||
}
|
||||
test "Matches /skipInstallPrompt" {
|
||||
let settings = parse [| "/skipInstallPrompt" |]
|
||||
Expect.equal settings.SkipInstallPrompt true ""
|
||||
}
|
||||
test "Matches /dryrun" {
|
||||
let settings = parse [| "/dryrun" |]
|
||||
Expect.isTrue settings.DryRun ""
|
||||
|
||||
Reference in New Issue
Block a user