chef / chef/mixlib-install

Architecture of localized Windows isn't detected in install.ps1

Open
#343 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Untriaged Type: Bug
Dominant language
Ruby
Stars
13
Forks
55
Avg merge
2d 15h
Merged PRs (30d)
8

Description

Version:

currently deployed: https://omnitruck.chef.io/install.ps1

Environment:

Windows with non-English locale, x64

Scenario:

Run install.ps1, appropriate version should be installed automatically.

Expected Result:

x86_64 architecture is detected

Actual Result:

i386 architecture is detected

Additional info

I've traced the problem to here:
https://github.com/chef/mixlib-install/blob/56a250b97618598c54fd5004ec4ab592aa3baede/lib/mixlib/install/generator/powershell/scripts/helpers.ps1.erb#L23

According to documentation, value of OSArchitecture property is localized.
For me, it is 64-разрядная (in Russian).

However, I'm not sure on the best fix for this.

WMI has Locale parameter, but passing MS_409 doesn't change anything.

The same issue: https://github.com/belowaverage-org/SuperGrate/issues/45. They ended up with simple checking for substring 64.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/mixlib/install/generator/powershell/scripts/helpers.ps1.erb around line 23 and run install.ps1 on a non-English, x64 Windows system. Check how the localized OSArchitecture value is interpreted. Done means the installer detects x86_64 rather than i386 and selects the appropriate version.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, ruby
Domain
devops, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.