0

Actually, as is noted here How to uninstall .vsix Visual Studio Extensions?, I have to call something like this:

vsixinstaller /u:12345678-1234-5678-1234-123456780000

However, I could not figure out how to get the path to VSIXInstaller inside of NSIS script.

Community
  • 1
  • 1
demiurghg
  • 13
  • 3

1 Answers1

0

According to this blog you can find the path in the registry or by using the %vs###comntools% environment variable.

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

If you support more than one version of Visual Studio you have to call GetVSIDEPath+ExecWait multiple times...

Anders
  • 97,548
  • 12
  • 110
  • 164