Skip to content

Commit

Permalink
Merge pull request #6616 from mook-as/merge-v1.13.0
Browse files Browse the repository at this point in the history
Merge v1.13.0
  • Loading branch information
jandubois authored Mar 14, 2024
2 parents 6a21576 + 92abdb1 commit 3fd1398
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "rancher-desktop",
"productName": "Rancher Desktop",
"license": "Apache-2.0",
"version": "1.12.3",
"version": "1.13.0",
"author": {
"name": "SUSE",
"email": "[email protected]"
Expand Down
9 changes: 5 additions & 4 deletions src/go/wsl-helper/pkg/wsl-utils/version_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (i WSLInfo) String() string {
if len(parts) == 0 {
parts = append(parts, "not-installed")
}
return fmt.Sprintf("Version=%s (%s)", i.Version, strings.Join(parts, ", "))
return fmt.Sprintf("Version=%s kernel=%s (%s)", i.Version, i.KernelVersion, strings.Join(parts, ", "))
}

const (
Expand Down Expand Up @@ -403,7 +403,7 @@ func getInboxWSLInfo(ctx context.Context, log *logrus.Entry) (bool, *PackageVers
)
switch rv {
case uintptr(windows.ERROR_SUCCESS):
kernelVersion, err = getMSIVersion(productCode)
kernelVersion, err = getMSIVersion(productCode, log)
if err != nil {
allErrors = append(allErrors, fmt.Errorf("error getting kernel version: %w", err))
}
Expand All @@ -419,7 +419,7 @@ func getInboxWSLInfo(ctx context.Context, log *logrus.Entry) (bool, *PackageVers
}

// Get the version of an installed MSI package, given its product code.
func getMSIVersion(productCode []uint16) (*PackageVersion, error) {
func getMSIVersion(productCode []uint16, log *logrus.Entry) (*PackageVersion, error) {
version := PackageVersion{}
versionStringWide, err := windows.UTF16PtrFromString(INSTALLPROPERTY_VERSIONSTRING)
if err != nil {
Expand All @@ -436,7 +436,8 @@ func getMSIVersion(productCode []uint16) (*PackageVersion, error) {
)
switch rv {
case uintptr(windows.ERROR_SUCCESS):
return nil, fmt.Errorf("succeeded getting product version with no buffer")
log.WithFields(logrus.Fields{"bufSize": bufSize}).Trace("unexpected success, assuming needs more data")
fallthrough
case uintptr(windows.ERROR_MORE_DATA):
wideBuf = make([]uint16, bufSize+1) // Add space for null terminator
bufSize = len(wideBuf)
Expand Down

0 comments on commit 3fd1398

Please sign in to comment.