diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c3a294..d74e2b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: git clone https://github.com/mysteriumnetwork/myst-launcher pushd myst-launcher git fetch --all --tags - git checkout tags/1.0.36-mac + git checkout tags/1.0.40-mac popd popd diff --git a/gobridge/gobridge.go b/gobridge/gobridge.go index 8d0816d..442ae73 100644 --- a/gobridge/gobridge.go +++ b/gobridge/gobridge.go @@ -15,6 +15,7 @@ import ( "os" "github.com/mysteriumnetwork/myst-launcher/app" + "github.com/mysteriumnetwork/myst-launcher/controller" "github.com/mysteriumnetwork/myst-launcher/model" "github.com/mysteriumnetwork/myst-launcher/myst" "github.com/mysteriumnetwork/myst-launcher/utils" @@ -91,8 +92,8 @@ func GoStart() { ap.SetModel(mod) ap.SetUI(ui) + go controller.CheckLauncherUpdates(mod) ap.StartAppController() - } func sendState() { @@ -193,5 +194,10 @@ func GoUpdateToMainnet() { sendConfig() } +//export GoTriggerLauncherUpdateOk +func GoTriggerLauncherUpdateOk(action C.int) { + mod.UIBus.Publish("launcher-update-ok", int(action)) +} + // required by runtime func main() {} diff --git a/gobridge/gobridge.h b/gobridge/gobridge.h index 4b209c1..e830597 100644 --- a/gobridge/gobridge.h +++ b/gobridge/gobridge.h @@ -1,91 +1,8 @@ -/* Code generated by cmd/cgo; DO NOT EDIT. */ - -/* package command-line-arguments */ - - -#line 1 "cgo-builtin-export-prolog" - -#include /* for ptrdiff_t below */ - -#ifndef GO_CGO_EXPORT_PROLOGUE_H -#define GO_CGO_EXPORT_PROLOGUE_H - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef struct { const char *p; ptrdiff_t n; } _GoString_; -#endif - -#endif - -/* Start of preamble from import "C" comments. */ - - -#line 3 "gobridge.go" - - - - -#include "interface.h" - -#line 1 "cgo-generated-wrapper" - - -/* End of preamble from import "C" comments. */ - - -/* Start of boilerplate cgo prologue. */ -#line 1 "cgo-gcc-export-header-prolog" - -#ifndef GO_CGO_PROLOGUE_H -#define GO_CGO_PROLOGUE_H - -typedef signed char GoInt8; -typedef unsigned char GoUint8; -typedef short GoInt16; -typedef unsigned short GoUint16; -typedef int GoInt32; -typedef unsigned int GoUint32; -typedef long long GoInt64; -typedef unsigned long long GoUint64; -typedef GoInt64 GoInt; -typedef GoUint64 GoUint; -typedef __SIZE_TYPE__ GoUintptr; -typedef float GoFloat32; -typedef double GoFloat64; -typedef float _Complex GoComplex64; -typedef double _Complex GoComplex128; - -/* - static assertion to make sure the file is being used on architecture - at least with matching size of GoInt. -*/ -typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; - -#ifndef GO_CGO_GOSTRING_TYPEDEF -typedef _GoString_ GoString; -#endif -typedef void *GoMap; -typedef void *GoChan; -typedef struct { void *t; void *v; } GoInterface; -typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; +#ifdef __arm64__ +#include "gobridge_arm64.h" #endif -/* End of boilerplate cgo prologue. */ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void GoInit(char* resPath, char* prodVer); -extern void GoStart(); -extern void GoSetModalResult(int rc); -extern void GoDialogueComplete(); -extern void GoOnAppExit(); -extern void GoTriggerUpgrade(); -extern void GoSetState(NSConfig* s); -extern void GoSetNetworkConfig(NSConfig* s); -extern void GoUpdateToMainnet(); - -#ifdef __cplusplus -} +#ifdef __amd64__ +#include "gobridge_amd64.h" #endif diff --git a/launcher.xcodeproj/project.pbxproj b/launcher.xcodeproj/project.pbxproj index ee6f6f4..8c60914 100644 --- a/launcher.xcodeproj/project.pbxproj +++ b/launcher.xcodeproj/project.pbxproj @@ -578,7 +578,7 @@ "$(PROJECT_DIR)/gobridge", "$(PROJECT_DIR)", ); - MARKETING_VERSION = 1.0.36; + MARKETING_VERSION = 1.0.40; PRODUCT_BUNDLE_IDENTIFIER = com.mysterium.launcher; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -606,7 +606,7 @@ "$(PROJECT_DIR)/gobridge", "$(PROJECT_DIR)", ); - MARKETING_VERSION = 1.0.36; + MARKETING_VERSION = 1.0.40; PRODUCT_BUNDLE_IDENTIFIER = com.mysterium.launcher; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/launcher/Model.m b/launcher/Model.m index 96b6499..cb2b504 100644 --- a/launcher/Model.m +++ b/launcher/Model.m @@ -133,8 +133,13 @@ - (void)notificationHandlerDialogue:(NSNotification *) notification NSWindowController *modalWindowDelegate = [[UpdateLauncherModalDelegate alloc] init]; NSWindow *modalWindow = [modalWindowDelegate window]; NSModalResponse response = [NSApp runModalForWindow:modalWindow ]; - - GoDialogueComplete(); + + if (response == NSModalResponseCancel) { + GoTriggerLauncherUpdateOk(0); + } + if (response == NSModalResponseOK) { + GoTriggerLauncherUpdateOk(2); + } } }