mirror of
https://github.com/taigrr/wails.git
synced 2026-04-14 10:50:53 -07:00
[windows] output required DLLs on build
This commit is contained in:
9
v2/internal/ffenestri/windows/x64/x64.go
Normal file
9
v2/internal/ffenestri/windows/x64/x64.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package x64
|
||||
|
||||
import _ "embed"
|
||||
|
||||
//go:embed webview.dll
|
||||
var WebView2 []byte
|
||||
|
||||
//go:embed WebView2Loader.dll
|
||||
var WebView2Loader []byte
|
||||
@@ -3,6 +3,7 @@ package build
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/wailsapp/wails/v2/internal/ffenestri/windows/x64"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -294,6 +295,18 @@ func (b *BaseBuilder) CompileProject(options *Options) error {
|
||||
return fmt.Errorf("%s\n%s", err, string(stde.Bytes()))
|
||||
}
|
||||
|
||||
// If we are targeting windows, dump the DLLs
|
||||
if options.Platform == "windows" {
|
||||
err := os.WriteFile(filepath.Join(appDir, "webview2.dll"), x64.WebView2, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.WriteFile(filepath.Join(appDir, "WebView2Loader.dll"), x64.WebView2Loader, 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if !options.Compress {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user