mirror of
https://github.com/safing/portmaster
synced 2025-09-02 10:39:22 +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
|
@ -29,6 +29,9 @@ const (
|
||||||
// This disables retrying and exits with an error code.
|
// This disables retrying and exits with an error code.
|
||||||
ControlledFailureExitCode = 24
|
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"
|
exeSuffix = ".exe"
|
||||||
zipSuffix = ".zip"
|
zipSuffix = ".zip"
|
||||||
)
|
)
|
||||||
|
@ -38,6 +41,8 @@ var (
|
||||||
onWindows = runtime.GOOS == "windows"
|
onWindows = runtime.GOOS == "windows"
|
||||||
stdinSignals bool
|
stdinSignals bool
|
||||||
childIsRunning = abool.NewBool(false)
|
childIsRunning = abool.NewBool(false)
|
||||||
|
|
||||||
|
fallBackToOldUI bool = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// Options for starting component.
|
// Options for starting component.
|
||||||
|
@ -71,6 +76,12 @@ func init() {
|
||||||
AllowDownload: false,
|
AllowDownload: false,
|
||||||
AllowHidingWindow: false,
|
AllowHidingWindow: false,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "Portmaster App2",
|
||||||
|
Identifier: "app2/portmaster",
|
||||||
|
AllowDownload: false,
|
||||||
|
AllowHidingWindow: false,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "Portmaster Notifier",
|
Name: "Portmaster Notifier",
|
||||||
Identifier: "notifier/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) {
|
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(
|
file, err := registry.GetFile(
|
||||||
helper.PlatformIdentifier(opts.Identifier),
|
helper.PlatformIdentifier(opts.Identifier),
|
||||||
)
|
)
|
||||||
|
@ -440,6 +459,9 @@ func parseExitError(err error) (restart bool, errWithCtx error) {
|
||||||
return true, nil
|
return true, nil
|
||||||
case ControlledFailureExitCode:
|
case ControlledFailureExitCode:
|
||||||
return false, errors.New("controlled failure, check logs")
|
return false, errors.New("controlled failure, check logs")
|
||||||
|
case StartOldUIExitCode:
|
||||||
|
fallBackToOldUI = true
|
||||||
|
return true, errors.New("user requested old UI")
|
||||||
default:
|
default:
|
||||||
return true, fmt.Errorf("unknown exit code %w", exErr)
|
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))]
|
#[cfg(not(debug_assertions))]
|
||||||
win.navigate("http://localhost:817".parse().unwrap());
|
{
|
||||||
|
_ = win.navigate("http://localhost:817".parse().unwrap());
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
error!(
|
error!(
|
||||||
"not navigating to user interface: current url: {}",
|
"not navigating to user interface: current url: {}",
|
||||||
|
|
|
@ -57,6 +57,7 @@ func MandatoryUpdates() (identifiers []string) {
|
||||||
PlatformIdentifier("start/portmaster-start.exe"),
|
PlatformIdentifier("start/portmaster-start.exe"),
|
||||||
PlatformIdentifier("notifier/portmaster-notifier.exe"),
|
PlatformIdentifier("notifier/portmaster-notifier.exe"),
|
||||||
PlatformIdentifier("notifier/portmaster-wintoast.dll"),
|
PlatformIdentifier("notifier/portmaster-wintoast.dll"),
|
||||||
|
PlatformIdentifier("app2/portmaster.exe"),
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
identifiers = append(
|
identifiers = append(
|
||||||
|
@ -64,6 +65,7 @@ func MandatoryUpdates() (identifiers []string) {
|
||||||
PlatformIdentifier("core/portmaster-core"),
|
PlatformIdentifier("core/portmaster-core"),
|
||||||
PlatformIdentifier("start/portmaster-start"),
|
PlatformIdentifier("start/portmaster-start"),
|
||||||
PlatformIdentifier("notifier/portmaster-notifier"),
|
PlatformIdentifier("notifier/portmaster-notifier"),
|
||||||
|
PlatformIdentifier("app2/portmaster"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue