diff --git a/mkdocs-website/docs/en/changelog.md b/mkdocs-website/docs/en/changelog.md index 73fa0bfbf09..44ad3cf6cbe 100644 --- a/mkdocs-website/docs/en/changelog.md +++ b/mkdocs-website/docs/en/changelog.md @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed cross volume project install for windows by [atterpac](https://github.com/atterac) in [#3512](https://github.com/wailsapp/wails/pull/3512) - Fixed react template css to show footer by [atterpac](https://github.com/atterpac) in [#3477](https://github.com/wailsapp/wails/pull/3477) - Fixed zombie processes when working in devmode by updating to latest refresh by [Atterpac](https://github.com/atterpac) in [#3320](https://github.com/wailsapp/wails/pull/3320). - Fixed appimage webkit file sourcing by [Atterpac](https://github.com/atterpac) in [#3306](https://github.com/wailsapp/wails/pull/3306). diff --git a/v3/internal/templates/templates.go b/v3/internal/templates/templates.go index 84cba9e8c27..70b46ca5215 100644 --- a/v3/internal/templates/templates.go +++ b/v3/internal/templates/templates.go @@ -201,20 +201,27 @@ func getRemoteTemplate(uri string) (template *Template, err error) { } func Install(options *flags.Init) error { - + var wd string = lo.Must(os.Getwd()) var projectDir string if options.ProjectDir == "." || options.ProjectDir == "" { - projectDir = lo.Must(os.Getwd()) + projectDir = wd + } else { + projectDir = options.ProjectDir } var err error - projectDir, err = filepath.Abs(filepath.Join(options.ProjectDir, options.ProjectName)) + projectDir, err = filepath.Abs(filepath.Join(projectDir, options.ProjectName)) if err != nil { return err } // Calculate relative path from project directory to LocalModulePath var relativePath string - relativePath, err = filepath.Rel(projectDir, debug.LocalModulePath) + // Check if the project directory and LocalModulePath are in the same drive + if filepath.VolumeName(wd) != filepath.VolumeName(debug.LocalModulePath) { + relativePath = debug.LocalModulePath + } else { + relativePath, err = filepath.Rel(projectDir, debug.LocalModulePath) + } if err != nil { return err }