diff --git a/cmds/portmaster-core/main_windows.go b/cmds/portmaster-core/main_windows.go
index 61d4f840..9b3798c3 100644
--- a/cmds/portmaster-core/main_windows.go
+++ b/cmds/portmaster-core/main_windows.go
@@ -35,20 +35,12 @@ type windowsService struct {
func (ws *windowsService) Execute(args []string, changeRequests <-chan svc.ChangeRequest, changes chan<- svc.Status) (ssec bool, errno uint32) {
const cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown
changes <- svc.Status{State: svc.StartPending}
-
- startupComplete := make(chan struct{})
- go func() {
- for !ws.instance.Ready() {
- time.Sleep(1 * time.Second)
- }
- startupComplete <- struct{}{}
- }()
+ ws.instance.Start()
+ changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}
service:
for {
select {
- case <-startupComplete:
- changes <- svc.Status{State: svc.Running, Accepts: cmdsAccepted}
case <-ws.instance.Stopped():
changes <- svc.Status{State: svc.StopPending}
break service
@@ -59,13 +51,13 @@ service:
case svc.Stop, svc.Shutdown:
ws.instance.Shutdown()
default:
- log.Errorf("unexpected control request: #%d\n", c)
+ log.Errorf("unexpected control request: #%d", c)
}
}
}
// wait until everything else is finished
- finishWg.Wait()
+ // finishWg.Wait()
log.Shutdown()
@@ -88,12 +80,12 @@ func run(instance *service.Instance) error {
// select service run type
svcRun := svc.Run
if !isService {
- log.Warningf("running interactively, switching to debug execution (no real service).\n")
+ log.Warningf("running interactively, switching to debug execution (no real service).")
svcRun = debug.Run
go registerSignalHandler(instance)
}
- runWg.Add(2)
+ runWg.Add(1)
// run service client
go func() {
@@ -105,29 +97,27 @@ func run(instance *service.Instance) error {
} else {
log.Infof("shuting down service")
}
- instance.Shutdown()
runWg.Done()
}()
- finishWg.Add(1)
+ // finishWg.Add(1)
// run service
- go func() {
- // run slightly delayed
- time.Sleep(250 * time.Millisecond)
- instance.Start()
+ // go func() {
+ // // run slightly delayed
+ // time.Sleep(250 * time.Millisecond)
- if err != nil {
- fmt.Printf("instance start failed: %s\n", err)
+ // if err != nil {
+ // fmt.Printf("instance start failed: %s\n", err)
- // Print stack on start failure, if enabled.
- if printStackOnExit {
- printStackTo(os.Stdout, "PRINTING STACK ON START FAILURE")
- }
+ // // Print stack on start failure, if enabled.
+ // if printStackOnExit {
+ // printStackTo(os.Stdout, "PRINTING STACK ON START FAILURE")
+ // }
- }
- runWg.Done()
- finishWg.Done()
- }()
+ // }
+ // runWg.Done()
+ // finishWg.Done()
+ // }()
runWg.Wait()
diff --git a/desktop/tauri/src-tauri/README.md b/desktop/tauri/src-tauri/README.md
index ad238810..a057e285 100644
--- a/desktop/tauri/src-tauri/README.md
+++ b/desktop/tauri/src-tauri/README.md
@@ -33,7 +33,9 @@ Update WIX installer template:
2. Replace the contents of `templates/main_original.wxs` with the repository version.
3. Replace the contents of `templates/main.wsx` and add the fallowing lines at the end of the file, inside the `Product` tag.
```xml
+
+
```
diff --git a/desktop/tauri/src-tauri/tauri.conf.json5 b/desktop/tauri/src-tauri/tauri.conf.json5
index a2d11d8a..2d9de0d7 100644
--- a/desktop/tauri/src-tauri/tauri.conf.json5
+++ b/desktop/tauri/src-tauri/tauri.conf.json5
@@ -109,8 +109,10 @@
},
"wix": {
"fragmentPaths": [
- "templates/service.wxs"
+ "templates/service.wxs",
+ "templates/files.wxs"
],
+ "componentGroupRefs": ["BinaryAndIntelFiles"],
"template": "templates/main.wxs"
}
},
diff --git a/desktop/tauri/src-tauri/templates/files.wxs b/desktop/tauri/src-tauri/templates/files.wxs
new file mode 100644
index 00000000..0eec08f1
--- /dev/null
+++ b/desktop/tauri/src-tauri/templates/files.wxs
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/desktop/tauri/src-tauri/templates/main.wxs b/desktop/tauri/src-tauri/templates/main.wxs
index 249eccf0..f42ba777 100644
--- a/desktop/tauri/src-tauri/templates/main.wxs
+++ b/desktop/tauri/src-tauri/templates/main.wxs
@@ -341,14 +341,16 @@
{{/if}}
-
-
-
-
AUTOLAUNCHAPP AND NOT Installed
+
+
+
+
+
+
\ No newline at end of file
diff --git a/desktop/tauri/src-tauri/templates/service.wxs b/desktop/tauri/src-tauri/templates/service.wxs
index 31ff064c..52f5339e 100644
--- a/desktop/tauri/src-tauri/templates/service.wxs
+++ b/desktop/tauri/src-tauri/templates/service.wxs
@@ -3,7 +3,7 @@