Skip to content

Commit

Permalink
wmic is deprecated, use powershell to find out the version of android…
Browse files Browse the repository at this point in the history
… studio (#1515)
  • Loading branch information
asklar authored Nov 22, 2021
1 parent ca23039 commit cddb0c3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export default {
'bin',
'studio.exe',
).replace(/\\/g, '\\\\');
const powershell = `${process.env.SystemRoot}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
const {stdout} = await executeCommand(
`wmic datafile where name="${androidStudioPath}" get Version`,
`${powershell} -Command "& { (Get-ChildItem \\"${androidStudioPath}\\").VersionInfo.FileVersionRaw.ToString() }"`,
);
const version = stdout.replace(/(\r\n|\n|\r)/gm, '').trim();

Expand Down

2 comments on commit cddb0c3

@NickGerleman
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this doesn't work correctly.
image

@thymikee
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asklar mind verifying this? @NickGerleman shall we revert this change until it's resolved? If so, please send a PR

Please sign in to comment.