-
Notifications
You must be signed in to change notification settings - Fork 513
Fix update powershell feature on windows #2325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix update powershell feature on windows #2325
Conversation
src/features/UpdatePowerShell.ts
Outdated
sessionManager.stop(); | ||
|
||
// Invoke the MSI via cmd. | ||
const msi = spawn("cmd", [`/S /C ${msiDownloadPath}`], { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use cmd
, or is there a more direct way of invoking the MSI (or is there a reason not to)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about "msiexec", [ "/i", msiDownloadPath ]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! Changed to msiexec
src/features/UpdatePowerShell.ts
Outdated
|
||
} else if (isMacOS) { | ||
script = "brew cask upgrade powershell"; | ||
let script = "brew cask upgrade powershell"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible case for a ternary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ye
src/features/UpdatePowerShell.ts
Outdated
const msi = spawn("cmd", [`/S /C ${msiDownloadPath}`], { | ||
detached: true, | ||
cwd: os.homedir(), | ||
env: process.env, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does spawn not pass the environment by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed. You're right
src/features/UpdatePowerShell.ts
Outdated
// Invoke the MSI via cmd. | ||
const msi = spawn("cmd", [`/S /C ${msiDownloadPath}`], { | ||
detached: true, | ||
cwd: os.homedir(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does execution of the MSI depend on this setting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
simplified
d0beab0
to
e3bff17
Compare
PR Summary
fixes #2323
This uses the node runtime to fetch the MSI and then uses cmd to execute the MSI. This will also stop the PSIC and then restart it when the MSI is done.
PR Checklist
Note: Tick the boxes below that apply to this pull request by putting an
x
between the square brackets.Please mark anything not applicable to this PR
NA
.WIP:
to the beginning of the title and remove the prefix when the PR is ready