golang/go

syscall: exec_windows.go: arguments should not be escaped to work with msiexec

Open

#15,566 建立於 2016年5月6日

在 GitHub 查看
 (34 留言) (5 反應) (0 負責人)Go (19,008 fork)batch import
NeedsFixOS-Windowsearly-in-cyclehelp wanted

倉庫指標

Star
 (133,883 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

Problem: When I try to run a command in Go on Windows using exec.Command() and then exec.Run(), the arguments are escaped using this logic: https://github.com/golang/go/blob/master/src/syscall/exec_windows.go#L26. That logic escapes the quotes around TARGETDIR="%v" which need to be there. I currently am assigning to Cmd.SysProcAttr manually to get around the escaping.

  1. What version of Go are you using (go version)? Go 1.6.2
  2. What operating system and processor architecture are you using (go env)? Windows 10 Pro x64
  3. What did you do?
  4. The code is available here, but needs to be run on Windows: https://play.golang.org/p/aU1PlbNTqM
  5. Download any MSI. I used https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-3.2.6-signed.msi and renamed it to package.msi.
  6. You can run Error() and NoError() to see the difference
  7. What did you expect to see? I expect to see the MSI say: Completed the ... Setup Wizard.
  8. What did you see instead? I see the Windows Installer help Windows and when I click it, I get: exit status 1639 which is: ERROR_INVALID_COMMAND_LINE 1639 Invalid command line argument. Consult the Windows Installer SDK for detailed command line help.

貢獻者指南