5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 19:50:15 +08:00

[windows-x] Experimental -> Default

This commit is contained in:
Lea Anthony 2021-08-15 21:07:34 +10:00
parent de255729e6
commit b7cd36921e
15 changed files with 136 additions and 481 deletions

View File

@ -113,10 +113,10 @@ func Build(options *Options) (string, error) {
}
// Build the base assets
err = builder.BuildAssets(options)
if err != nil {
return "", err
}
//err = builder.BuildAssets(options)
//if err != nil {
// return "", err
//}
// If we are building for windows, we will need to generate the asset bundle before
// compilation. This will be a .syso file in the project root

View File

@ -2,7 +2,6 @@ package build
import (
"fmt"
"github.com/leaanthony/slicer"
"github.com/wailsapp/wails/v2/pkg/buildassets"
"io/ioutil"
"path/filepath"
@ -24,7 +23,6 @@ func newDesktopBuilder(options *Options) *DesktopBuilder {
// BuildAssets builds the assets for the desktop application
func (d *DesktopBuilder) BuildAssets(options *Options) error {
var err error
// Check assets directory exists
if !fs.DirExists(options.ProjectData.BuildDir) {
@ -36,22 +34,20 @@ func (d *DesktopBuilder) BuildAssets(options *Options) error {
}
// We only build assets for cgo builds
userTags := slicer.String(options.UserTags)
if userTags.Contains("experimental") {
return nil
}
// Get a list of assets from the HTML
assets, err := d.BaseBuilder.ExtractAssets()
if err != nil {
return err
}
// Build base assets (HTML/JS/CSS/etc)
err = d.BuildBaseAssets(assets, options)
if err != nil {
return err
}
//userTags := slicer.String(options.UserTags)
//if userTags.Contains("cgo") {
// // Get a list of assets from the HTML
// assets, err := d.BaseBuilder.ExtractAssets()
// if err != nil {
// return err
// }
//
// // Build base assets (HTML/JS/CSS/etc)
// err = d.BuildBaseAssets(assets, options)
// if err != nil {
// return err
// }
//}
return nil
}

View File

@ -2,24 +2,16 @@
package build
import (
"github.com/leaanthony/slicer"
"github.com/wailsapp/wails/v2/internal/ffenestri/windows/x64"
"os"
"path/filepath"
)
// PostCompilation is called after the compilation step, if successful
func (d *DesktopBuilder) PostCompilation(options *Options) error {
// Dump the DLLs
userTags := slicer.String(options.UserTags)
if userTags.Contains("experimental") {
return nil
}
err := os.WriteFile(filepath.Join(options.BuildDirectory, "WebView2Loader.dll"), x64.WebView2Loader, 0755)
if err != nil {
return err
}
//userTags := slicer.String(options.UserTags)
//if userTags.Contains("cgo") {
// err := os.WriteFile(filepath.Join(options.BuildDirectory, "WebView2Loader.dll"), x64.WebView2Loader, 0755)
// if err != nil {
// return err
// }
//}
return nil
}

View File

@ -1,59 +0,0 @@
//+build experimental
package runtime
import (
"context"
"github.com/wailsapp/wails/v2/internal/frontend"
)
// FileFilter defines a filter for dialog boxes
type FileFilter = frontend.FileFilter
// OpenDialogOptions contains the options for the OpenDialogOptions runtime method
type OpenDialogOptions = frontend.OpenDialogOptions
// SaveDialogOptions contains the options for the SaveDialog runtime method
type SaveDialogOptions = frontend.SaveDialogOptions
type DialogType = frontend.DialogType
const (
InfoDialog = frontend.InfoDialog
WarningDialog = frontend.WarningDialog
ErrorDialog = frontend.ErrorDialog
QuestionDialog = frontend.QuestionDialog
)
// MessageDialogOptions contains the options for the Message dialogs, EG Info, Warning, etc runtime methods
type MessageDialogOptions = frontend.MessageDialogOptions
// OpenDirectoryDialog prompts the user to select a directory
func OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
frontend := getFrontend(ctx)
return frontend.OpenDirectoryDialog(dialogOptions)
}
// OpenFileDialog prompts the user to select a file
func OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
frontend := getFrontend(ctx)
return frontend.OpenFileDialog(dialogOptions)
}
// OpenMultipleFilesDialog prompts the user to select a file
func OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error) {
frontend := getFrontend(ctx)
return frontend.OpenMultipleFilesDialog(dialogOptions)
}
// SaveFileDialog prompts the user to select a file
func SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error) {
frontend := getFrontend(ctx)
return frontend.SaveFileDialog(dialogOptions)
}
// MessageDialog show a message dialog to the user
func MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error) {
frontend := getFrontend(ctx)
return frontend.MessageDialog(dialogOptions)
}

View File

@ -1,192 +1,57 @@
// +build !experimental
package runtime
import (
"context"
"fmt"
"github.com/wailsapp/wails/v2/internal/crypto"
"github.com/wailsapp/wails/v2/internal/servicebus"
"github.com/wailsapp/wails/v2/internal/frontend"
)
// FileFilter defines a filter for dialog boxes
type FileFilter struct {
DisplayName string // Filter information EG: "Image Files (*.jpg, *.png)"
Pattern string // semi-colon separated list of extensions, EG: "*.jpg;*.png"
}
type FileFilter = frontend.FileFilter
// OpenDialogOptions contains the options for the OpenDialogOptions runtime method
type OpenDialogOptions struct {
DefaultDirectory string
DefaultFilename string
Title string
Filters []FileFilter
AllowFiles bool
AllowDirectories bool
ShowHiddenFiles bool
CanCreateDirectories bool
ResolvesAliases bool
TreatPackagesAsDirectories bool
}
type OpenDialogOptions = frontend.OpenDialogOptions
// SaveDialogOptions contains the options for the SaveDialog runtime method
type SaveDialogOptions struct {
DefaultDirectory string
DefaultFilename string
Title string
Filters []FileFilter
ShowHiddenFiles bool
CanCreateDirectories bool
TreatPackagesAsDirectories bool
}
type SaveDialogOptions = frontend.SaveDialogOptions
type DialogType string
type DialogType = frontend.DialogType
const (
InfoDialog DialogType = "info"
WarningDialog DialogType = "warning"
ErrorDialog DialogType = "error"
QuestionDialog DialogType = "question"
InfoDialog = frontend.InfoDialog
WarningDialog = frontend.WarningDialog
ErrorDialog = frontend.ErrorDialog
QuestionDialog = frontend.QuestionDialog
)
// MessageDialogOptions contains the options for the Message dialogs, EG Info, Warning, etc runtime methods
type MessageDialogOptions struct {
Type DialogType
Title string
Message string
Buttons []string
DefaultButton string
CancelButton string
Icon string
}
type MessageDialogOptions = frontend.MessageDialogOptions
// OpenDirectoryDialog prompts the user to select a directory
func OpenDirectoryDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
bus := servicebus.ExtractBus(ctx)
// Create unique dialog callback
uniqueCallback := crypto.RandomID()
// Subscribe to the respose channel
responseTopic := "dialog:opendirectoryselected:" + uniqueCallback
dialogResponseChannel, err := bus.Subscribe(responseTopic)
if err != nil {
return "", fmt.Errorf("ERROR: Cannot subscribe to bus topic: %+v\n", err.Error())
}
message := "dialog:select:directory:" + uniqueCallback
bus.Publish(message, dialogOptions)
// Wait for result
var result = <-dialogResponseChannel
// Delete subscription to response topic
bus.UnSubscribe(responseTopic)
return result.Data().(string), nil
appFrontend := getFrontend(ctx)
return appFrontend.OpenDirectoryDialog(dialogOptions)
}
// OpenFileDialog prompts the user to select a file
func OpenFileDialog(ctx context.Context, dialogOptions OpenDialogOptions) (string, error) {
bus := servicebus.ExtractBus(ctx)
// Create unique dialog callback
uniqueCallback := crypto.RandomID()
// Subscribe to the respose channel
responseTopic := "dialog:openselected:" + uniqueCallback
dialogResponseChannel, err := bus.Subscribe(responseTopic)
if err != nil {
return "", fmt.Errorf("ERROR: Cannot subscribe to bus topic: %+v\n", err.Error())
}
message := "dialog:select:open:" + uniqueCallback
bus.Publish(message, dialogOptions)
// Wait for result
var result = <-dialogResponseChannel
// Delete subscription to response topic
bus.UnSubscribe(responseTopic)
return result.Data().(string), nil
appFrontend := getFrontend(ctx)
return appFrontend.OpenFileDialog(dialogOptions)
}
// OpenMultipleFilesDialog prompts the user to select a file
func OpenMultipleFilesDialog(ctx context.Context, dialogOptions OpenDialogOptions) ([]string, error) {
bus := servicebus.ExtractBus(ctx)
uniqueCallback := crypto.RandomID()
// Subscribe to the respose channel
responseTopic := "dialog:openmultipleselected:" + uniqueCallback
dialogResponseChannel, err := bus.Subscribe(responseTopic)
if err != nil {
return nil, fmt.Errorf("ERROR: Cannot subscribe to bus topic: %+v\n", err.Error())
}
message := "dialog:select:openmultiple:" + uniqueCallback
bus.Publish(message, dialogOptions)
// Wait for result
var result = <-dialogResponseChannel
// Delete subscription to response topic
bus.UnSubscribe(responseTopic)
return result.Data().([]string), nil
appFrontend := getFrontend(ctx)
return appFrontend.OpenMultipleFilesDialog(dialogOptions)
}
// SaveFileDialog prompts the user to select a file
func SaveFileDialog(ctx context.Context, dialogOptions SaveDialogOptions) (string, error) {
bus := servicebus.ExtractBus(ctx)
uniqueCallback := crypto.RandomID()
// Subscribe to the respose channel
responseTopic := "dialog:saveselected:" + uniqueCallback
dialogResponseChannel, err := bus.Subscribe(responseTopic)
if err != nil {
return "", fmt.Errorf("ERROR: Cannot subscribe to bus topic: %+v\n", err.Error())
}
message := "dialog:select:save:" + uniqueCallback
bus.Publish(message, dialogOptions)
// Wait for result
var result = <-dialogResponseChannel
// Delete subscription to response topic
bus.UnSubscribe(responseTopic)
return result.Data().(string), nil
appFrontend := getFrontend(ctx)
return appFrontend.SaveFileDialog(dialogOptions)
}
// MessageDialog show a message dialog to the user
func MessageDialog(ctx context.Context, dialogOptions MessageDialogOptions) (string, error) {
bus := servicebus.ExtractBus(ctx)
// Create unique dialog callback
uniqueCallback := crypto.RandomID()
// Subscribe to the respose channel
responseTopic := "dialog:messageselected:" + uniqueCallback
dialogResponseChannel, err := bus.Subscribe(responseTopic)
if err != nil {
return "", fmt.Errorf("ERROR: Cannot subscribe to bus topic: %+v\n", err.Error())
}
message := "dialog:select:message:" + uniqueCallback
bus.Publish(message, dialogOptions)
// Wait for result
var result = <-dialogResponseChannel
// Delete subscription to response topic
bus.UnSubscribe(responseTopic)
return result.Data().(string), nil
appFrontend := getFrontend(ctx)
return appFrontend.MessageDialog(dialogOptions)
}

View File

@ -1,38 +0,0 @@
// +build experimental
package runtime
import (
"context"
)
// EventsOn registers a listener for the given event name
func EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) {
events := getEvents(ctx)
events.On(eventName, callback)
}
// EventsOff unregisters a listener for the given event name
func EventsOff(ctx context.Context, eventName string) {
events := getEvents(ctx)
events.Off(eventName)
}
// EventsOnce registers a listener for the given event name. After the first callback, the
// listener is deleted.
func EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) {
events := getEvents(ctx)
events.Once(eventName, callback)
}
// EventsOnMultiple registers a listener for the given event name, that may be called a maximum of 'counter' times
func EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) {
events := getEvents(ctx)
events.OnMultiple(eventName, callback, counter)
}
// EventsEmit pass through
func EventsEmit(ctx context.Context, eventName string, optionalData ...interface{}) {
events := getEvents(ctx)
events.Emit(eventName, optionalData...)
}

View File

@ -1,45 +1,36 @@
// +build !experimental
package runtime
import (
"context"
"github.com/wailsapp/wails/v2/internal/messagedispatcher/message"
"github.com/wailsapp/wails/v2/internal/servicebus"
)
// On registers a listener for a particular event
func On(ctx context.Context, eventName string, callback func(optionalData ...interface{})) {
bus := servicebus.ExtractBus(ctx)
eventMessage := &message.OnEventMessage{
Name: eventName,
Callback: callback,
Counter: -1,
}
bus.Publish("event:on", eventMessage)
// EventsOn registers a listener for the given event name
func EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) {
events := getEvents(ctx)
events.On(eventName, callback)
}
// Once registers a listener for a particular event. After the first callback, the
// EventsOff unregisters a listener for the given event name
func EventsOff(ctx context.Context, eventName string) {
events := getEvents(ctx)
events.Off(eventName)
}
// EventsOnce registers a listener for the given event name. After the first callback, the
// listener is deleted.
func Once(ctx context.Context, eventName string, callback func(optionalData ...interface{})) {
bus := servicebus.ExtractBus(ctx)
eventMessage := &message.OnEventMessage{
Name: eventName,
Callback: callback,
Counter: 1,
}
bus.Publish("event:on", eventMessage)
func EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) {
events := getEvents(ctx)
events.Once(eventName, callback)
}
// Emit pass through
func Emit(ctx context.Context, eventName string, optionalData ...interface{}) {
bus := servicebus.ExtractBus(ctx)
eventMessage := &message.EventMessage{
Name: eventName,
Data: optionalData,
}
bus.Publish("event:emit:from:g", eventMessage)
// EventsOnMultiple registers a listener for the given event name, that may be called a maximum of 'counter' times
func EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) {
events := getEvents(ctx)
events.OnMultiple(eventName, callback, counter)
}
// EventsEmit pass through
func EventsEmit(ctx context.Context, eventName string, optionalData ...interface{}) {
events := getEvents(ctx)
events.Emit(eventName, optionalData...)
}

View File

@ -1,4 +1,4 @@
// +build !experimental
// +build cgo
package runtime

View File

@ -1,34 +0,0 @@
//+build experimental
package runtime
import (
"context"
)
func UpdateApplicationMenu(ctx context.Context) {
frontend := getFrontend(ctx)
frontend.UpdateApplicationMenu()
}
/*
func UpdateContextMenu(ctx context.Context, contextMenu *menu.ContextMenu) {
frontend := getFrontend(ctx)
bus.Publish("menu:updatecontextmenu", contextMenu)
}
func SetTrayMenu(ctx context.Context, trayMenu *menu.TrayMenu) {
frontend := getFrontend(ctx)
bus.Publish("menu:settraymenu", trayMenu)
}
func UpdateTrayMenuLabel(ctx context.Context, trayMenu *menu.TrayMenu) {
frontend := getFrontend(ctx)
bus.Publish("menu:updatetraymenulabel", trayMenu)
}
func DeleteTrayMenu(ctx context.Context, trayMenu *menu.TrayMenu) {
frontend := getFrontend(ctx)
bus.Publish("menu:deletetraymenu", trayMenu)
}
*/

View File

@ -1,34 +1,32 @@
// +build !experimental
package runtime
import (
"context"
"github.com/wailsapp/wails/v2/internal/servicebus"
"github.com/wailsapp/wails/v2/pkg/menu"
)
func UpdateApplicationMenu(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("menu:updateappmenu", nil)
frontend := getFrontend(ctx)
frontend.UpdateApplicationMenu()
}
/*
func UpdateContextMenu(ctx context.Context, contextMenu *menu.ContextMenu) {
bus := servicebus.ExtractBus(ctx)
frontend := getFrontend(ctx)
bus.Publish("menu:updatecontextmenu", contextMenu)
}
func SetTrayMenu(ctx context.Context, trayMenu *menu.TrayMenu) {
bus := servicebus.ExtractBus(ctx)
frontend := getFrontend(ctx)
bus.Publish("menu:settraymenu", trayMenu)
}
func UpdateTrayMenuLabel(ctx context.Context, trayMenu *menu.TrayMenu) {
bus := servicebus.ExtractBus(ctx)
frontend := getFrontend(ctx)
bus.Publish("menu:updatetraymenulabel", trayMenu)
}
func DeleteTrayMenu(ctx context.Context, trayMenu *menu.TrayMenu) {
bus := servicebus.ExtractBus(ctx)
frontend := getFrontend(ctx)
bus.Publish("menu:deletetraymenu", trayMenu)
}
*/

View File

@ -1,38 +0,0 @@
//+build experimental
package runtime
import (
"context"
"github.com/wailsapp/wails/v2/internal/frontend"
"log"
goruntime "runtime"
)
func getFrontend(ctx context.Context) frontend.Frontend {
result := ctx.Value("frontend")
if result != nil {
return result.(frontend.Frontend)
}
pc, _, _, _ := goruntime.Caller(1)
funcName := goruntime.FuncForPC(pc).Name()
log.Fatalf("cannot call '%s': Application not initialised", funcName)
return nil
}
func getEvents(ctx context.Context) frontend.Events {
result := ctx.Value("events")
if result != nil {
return result.(frontend.Events)
}
pc, _, _, _ := goruntime.Caller(1)
funcName := goruntime.FuncForPC(pc).Name()
log.Fatalf("cannot call '%s': Application not initialised", funcName)
return nil
}
// Quit the application
func Quit(ctx context.Context) {
appFrontend := getFrontend(ctx)
appFrontend.Quit()
}

View File

@ -1,15 +1,36 @@
// +build !experimental
package runtime
import (
"context"
"github.com/wailsapp/wails/v2/internal/servicebus"
"github.com/wailsapp/wails/v2/internal/frontend"
"log"
goruntime "runtime"
)
func getFrontend(ctx context.Context) frontend.Frontend {
result := ctx.Value("frontend")
if result != nil {
return result.(frontend.Frontend)
}
pc, _, _, _ := goruntime.Caller(1)
funcName := goruntime.FuncForPC(pc).Name()
log.Fatalf("cannot call '%s': Application not initialised", funcName)
return nil
}
func getEvents(ctx context.Context) frontend.Events {
result := ctx.Value("events")
if result != nil {
return result.(frontend.Events)
}
pc, _, _, _ := goruntime.Caller(1)
funcName := goruntime.FuncForPC(pc).Name()
log.Fatalf("cannot call '%s': Application not initialised", funcName)
return nil
}
// Quit the application
func Quit(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
// Start shutdown of Wails
bus.Publish("quit", "runtime.Quit()")
appFrontend := getFrontend(ctx)
appFrontend.Quit()
}

View File

@ -1,98 +1,89 @@
// +build !experimental
package runtime
import (
"context"
"fmt"
"github.com/wailsapp/wails/v2/internal/servicebus"
)
// WindowSetTitle sets the title of the window
func WindowSetTitle(ctx context.Context, title string) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:settitle", title)
appFrontend := getFrontend(ctx)
appFrontend.WindowSetTitle(title)
}
// WindowFullscreen makes the window fullscreen
func WindowFullscreen(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:fullscreen", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowFullscreen()
}
// WindowUnFullscreen makes the window UnFullscreen
func WindowUnFullscreen(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:unfullscreen", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowUnFullscreen()
}
// WindowCenter the window on the current screen
func WindowCenter(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:center", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowCenter()
}
// WindowShow shows the window if hidden
func WindowShow(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:show", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowShow()
}
// WindowHide the window
func WindowHide(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:hide", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowHide()
}
// WindowSetSize sets the size of the window
func WindowSetSize(ctx context.Context, width int, height int) {
bus := servicebus.ExtractBus(ctx)
message := fmt.Sprintf("window:size:%d:%d", width, height)
bus.Publish(message, "")
appFrontend := getFrontend(ctx)
appFrontend.WindowSetSize(width, height)
}
// WindowSetSize sets the size of the window
// WindowSetMinSize sets the minimum size of the window
func WindowSetMinSize(ctx context.Context, width int, height int) {
bus := servicebus.ExtractBus(ctx)
message := fmt.Sprintf("window:minsize:%d:%d", width, height)
bus.Publish(message, "")
appFrontend := getFrontend(ctx)
appFrontend.WindowSetMinSize(width, height)
}
// WindowSetSize sets the size of the window
// WindowSetMaxSize sets the maximum size of the window
func WindowSetMaxSize(ctx context.Context, width int, height int) {
bus := servicebus.ExtractBus(ctx)
message := fmt.Sprintf("window:maxsize:%d:%d", width, height)
bus.Publish(message, "")
appFrontend := getFrontend(ctx)
appFrontend.WindowSetMaxSize(width, height)
}
// WindowSetPosition sets the position of the window
func WindowSetPosition(ctx context.Context, x int, y int) {
bus := servicebus.ExtractBus(ctx)
message := fmt.Sprintf("window:position:%d:%d", x, y)
bus.Publish(message, "")
appFrontend := getFrontend(ctx)
appFrontend.WindowSetPos(x, y)
}
// WindowMaximise the window
func WindowMaximise(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:maximise", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowMaximise()
}
// WindowUnmaximise the window
func WindowUnmaximise(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:unmaximise", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowUnmaximise()
}
// WindowMinimise the window
func WindowMinimise(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:minimise", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowMinimise()
}
// WindowUnminimise the window
func WindowUnminimise(ctx context.Context) {
bus := servicebus.ExtractBus(ctx)
bus.Publish("window:unminimise", "")
appFrontend := getFrontend(ctx)
appFrontend.WindowUnminimise()
}

View File

@ -1,11 +1,9 @@
// +build !experimental
// Package wails is the main package of the Wails project.
// It is used by client applications.
package wails
import (
"github.com/wailsapp/wails/v2/internal/app"
app "github.com/wailsapp/wails/v2/internal/appng"
"github.com/wailsapp/wails/v2/pkg/options"
)

View File

@ -1,28 +0,0 @@
// +build windows
// +build experimental
// Package wails is the main package of the Wails project.
// It is used by client applications.
package wails
import (
app "github.com/wailsapp/wails/v2/internal/appng"
"github.com/wailsapp/wails/v2/pkg/options"
)
// Run creates an application based on the given config and executes it
func Run(options *options.App) error {
// Call an Init method manually
err := Init()
if err != nil {
return err
}
mainapp, err := app.CreateApp(options)
if err != nil {
return err
}
return mainapp.Run()
}