Description
After trying many many many times to get multirust working on Windows without success (with msiexec returning 1639 over and over again with that confusing popup 😭), I finally figured out why multirust was not working for me. std::process::Command will quote arguments as needed, except that the way it quote the arguments doesn't work for msiexec. When this:
TARGETDIR=path with space
is given to std::process::Command, It turns it into:
"TARGETDIR=path with space"
but msiexec needs it as:
TARGETDIR="path with space"
Note the position of the double quotes. One workaround is to use MULTIRUST_HOME= to get multirust to use a path without spaces (and any other character that might get std::process::Command into quoting the TARGETDIR= argument). The other is to create a new user account with a folder that does not have any spaces (or characters that might get std::process::Command to quote TARGETDIR=).
PS: Having figured that out, I decided to use msys2 to try create an isolated environment to temporarily test multirust by setting MULTIRUST_HOME=/c/path/to/multirust/home , but that didn't work either ( since msys2 converts path in what they call "mixed mode", it ends up being c:/path/to/multirust/home instead of c:\path\to\multirust\home ). Of course, msiexec (like many Windows commands) barfed on this 😭. Maybe multirust could change '/' to '' in paths before passing them to msiexec (or maybe warn the user about it).I won't be surprised if there are other combinations that can make msiexec fail, but these are the only ones I've encountered so far. Sorry for the rant 😛.