-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(core): Improve argument concatenation in Invoke-ExternalCommand
#5065
feat(core): Improve argument concatenation in Invoke-ExternalCommand
#5065
Conversation
2269a55
to
63f72e7
Compare
Co-authored-by: Hsiao-nan Cheung <niheaven@gmail.com>
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.
LGTM, but may need more tests in develop
related: #9026 related: ScoopInstaller/Scoop#5065
related: ScoopInstaller/Scoop#5065 related: #9026
related: #9026 related: ScoopInstaller/Scoop#5065
related: #9026 related: ScoopInstaller/Scoop#5065
escape char `\" is not needed anymore related: #9026 related: ScoopInstaller/Scoop#5065
And thank @issaclin32 for the fixes of incompatibility. 😭 |
related: #9026 related: ScoopInstaller/Scoop#5065
related: #9026 related: ScoopInstaller/Scoop#5065
* crc changed their file structure, need to modify accordingly * escape char `\" is not needed anymore * related: ScoopInstaller/Extras#9026 * related: ScoopInstaller/Scoop#5065
related: ScoopInstaller/Scoop#5065 related: ScoopInstaller/Extras#9026
fixes #9060 related: ScoopInstaller/Scoop#5065
related: 9060 related: ScoopInstaller/Scoop#5065
* related: ScoopInstaller/Scoop#5065 * related: ScoopInstaller/Extras#9060 * Remove autoupdate because last update was in 2019
* related: ScoopInstaller/Scoop#5065 * related: ScoopInstaller/Extras#9060 * Remove autoupdate because last update was in 2019
Anki's installer does not work with quoted args related: ScoopInstaller/Scoop#5065
The app's installer does not work properly with quoted args related: ScoopInstaller/Scoop#5065
related: #95 related: ScoopInstaller/Scoop#5065
closes #9122 related: ScoopInstaller/Scoop#5065
related: #9122 related: ScoopInstaller/Scoop#5065
fixes #9126 related: ScoopInstaller/Scoop#5065
fixes #9090 related: ScoopInstaller/Scoop#5065
Can we revert this? It's a broken implementation. |
Revert it in |
@niheaven Seems to make sense. But what about those manifests that have already been adjusted for this feature? Or if you already have an idea on how to make a bidirectionally compatible implementation? |
Description
Use
ArgumentList
in PowerShell 6.1 and later (built on .NET Core 2.1+), otherwise escape arguments using the general MSVC Runtime's rules in older versions.In the past, due to the arbitraryness of arguments, we are not able to handle all cases where arguments may contain spaces, quotes or other special characters for every automatic installer script that uses
Invoke-ExternalCommand
. With this change, we don't have to escape arguments manually for most external commands any more. But for the following exceptions who basically don't follow the general MSVC Runtime's rules of parsing command line, just simply concatenate arguments with spaces to build the argument list string, which means we have to escape arguments manually for them: (case insensitive)cmd.exe
,cscript.exe
,wscript.exe
andmsiexec.exe
..bat
,.cmd
,.js
,.vbs
and.wsf
.Ref: MS docs
Checklist:
develop
branch.