mirror of
https://github.com/safing/portmaster
synced 2025-04-17 17:39:10 +00:00
[cmds] Allow running of tauri in beta
This commit is contained in:
parent
a84bbf4262
commit
0b72e99edd
4 changed files with 126 additions and 3321 deletions
cmds/portmaster-start
desktop
service/updates/helper
|
@ -29,6 +29,9 @@ const (
|
|||
// This disables retrying and exits with an error code.
|
||||
ControlledFailureExitCode = 24
|
||||
|
||||
// StartOldUIExitCode is an exit code that is returned by the UI when there. This is manfully triaged by the user, if the new UI does not work for them.
|
||||
StartOldUIExitCode = -3
|
||||
|
||||
exeSuffix = ".exe"
|
||||
zipSuffix = ".zip"
|
||||
)
|
||||
|
@ -38,6 +41,8 @@ var (
|
|||
onWindows = runtime.GOOS == "windows"
|
||||
stdinSignals bool
|
||||
childIsRunning = abool.NewBool(false)
|
||||
|
||||
fallBackToOldUI bool = false
|
||||
)
|
||||
|
||||
// Options for starting component.
|
||||
|
@ -71,6 +76,12 @@ func init() {
|
|||
AllowDownload: false,
|
||||
AllowHidingWindow: false,
|
||||
},
|
||||
{
|
||||
Name: "Portmaster App2",
|
||||
Identifier: "app2/portmaster",
|
||||
AllowDownload: false,
|
||||
AllowHidingWindow: false,
|
||||
},
|
||||
{
|
||||
Name: "Portmaster Notifier",
|
||||
Identifier: "notifier/portmaster-notifier",
|
||||
|
@ -311,6 +322,14 @@ func persistOutputStreams(opts *Options, version string, cmd *exec.Cmd) (chan st
|
|||
}
|
||||
|
||||
func execute(opts *Options, args []string) (cont bool, err error) {
|
||||
if registry.UsePreReleases && opts.ShortIdentifier == "app" {
|
||||
// Check if new ui was already tried.
|
||||
if !fallBackToOldUI {
|
||||
opts.Identifier = "app2/portmaster"
|
||||
opts.ShortIdentifier = "app2"
|
||||
}
|
||||
}
|
||||
|
||||
file, err := registry.GetFile(
|
||||
helper.PlatformIdentifier(opts.Identifier),
|
||||
)
|
||||
|
@ -440,6 +459,9 @@ func parseExitError(err error) (restart bool, errWithCtx error) {
|
|||
return true, nil
|
||||
case ControlledFailureExitCode:
|
||||
return false, errors.New("controlled failure, check logs")
|
||||
case StartOldUIExitCode:
|
||||
fallBackToOldUI = true
|
||||
return true, errors.New("user requested old UI")
|
||||
default:
|
||||
return true, fmt.Errorf("unknown exit code %w", exErr)
|
||||
}
|
||||
|
|
3419
desktop/angular/package-lock.json
generated
3419
desktop/angular/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -154,7 +154,9 @@ pub fn may_navigate_to_ui(win: &mut WebviewWindow, force: bool) {
|
|||
}
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
win.navigate("http://localhost:817".parse().unwrap());
|
||||
{
|
||||
_ = win.navigate("http://localhost:817".parse().unwrap());
|
||||
}
|
||||
} else {
|
||||
error!(
|
||||
"not navigating to user interface: current url: {}",
|
||||
|
|
|
@ -57,6 +57,7 @@ func MandatoryUpdates() (identifiers []string) {
|
|||
PlatformIdentifier("start/portmaster-start.exe"),
|
||||
PlatformIdentifier("notifier/portmaster-notifier.exe"),
|
||||
PlatformIdentifier("notifier/portmaster-wintoast.dll"),
|
||||
PlatformIdentifier("app2/portmaster.exe"),
|
||||
)
|
||||
} else {
|
||||
identifiers = append(
|
||||
|
@ -64,6 +65,7 @@ func MandatoryUpdates() (identifiers []string) {
|
|||
PlatformIdentifier("core/portmaster-core"),
|
||||
PlatformIdentifier("start/portmaster-start"),
|
||||
PlatformIdentifier("notifier/portmaster-notifier"),
|
||||
PlatformIdentifier("app2/portmaster"),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue