实际上,正如How to uninstall .vsix Visual Studio Extensions?所述,我必须这样说:
vsixinstaller /u:12345678-1234-5678-1234-123456780000
但是,我无法弄清楚如何在NSIS脚本中获取VSIXInstaller的路径。
答案 0 :(得分:0)
根据this blog,您可以在注册表中找到路径,也可以使用%vs ### comntools%环境变量。
Function GetVSIDEPath
Exch $0
Push $1
Push $2
ExpandEnvStrings $1 "%VS$0COMNTOOLS%"
IfFileExists "$1\?" "" tryReg
GetFullPathName $1 "$1\..\..\IDE\"
IfFileExists "$1\?" done
tryReg:
IntOp $0 $0 / 10
ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\$0.0" "InstallDir"
done:
StrCpy $0 $1
Pop $2
Pop $1
Exch $0
FunctionEnd
!include LogicLib.nsh
Section
Push 100 ; Visual Studio 2010
Call GetVSIDEPath
Pop $0
${If} $0 != ""
ExecWait '"$0\vsixInstaller.exe" /u:12345678-1234-5678-1234-123456780000'
${EndIf}
SectionEnd
如果您支持多个版本的Visual Studio,则必须多次调用GetVSIDEPath + ExecWait ...