v3/examples/single-instance/README.md
This example demonstrates the single instance functionality in Wails v3. It shows how to:
Build and run the application:
go build
./single-instance
Try launching a second instance of the application. You'll notice:
Check the application logs to see the information received from second instances.
The example consists of:
main.go: The main application code demonstrating single instance setupThe application uses the Wails v3 single instance feature:
app := application.New(&application.Options{
SingleInstance: &application.SingleInstanceOptions{
UniqueID: "com.wails.example.single-instance",
OnSecondInstance: func(data application.SecondInstanceData) {
// Handle second instance launch
},
AdditionalData: map[string]string{
},
},
})
The implementation uses platform-specific mechanisms: