none
Upgrade a VSIX

    Question

  • I have a VSIX package which we deploy for testing several times a day into the non hive instance because its part of a bigger install.

    Changing the version number automatically appears a bit difficult as it would involve automating the build process to lock the file from TFS and edit the XML and with concurrent users this will cause TFS conflicts during builds.

    So I though uninstaling and reinstalling would do the trick.

    So I tried this.

    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: "/u:e2ce86d3-fb0b-43ad-938a-5bcdd087ea2d"; Flags: waituntilterminated
    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: """{app}\Build\VSIP\Cosmos.VS.XSharp.vsix"""; Flags: waituntilterminated

    This works, but results in 3 dialogs.

    If I use the /quiet option it does not work and instead one run will do an uninstall, next run does an install.

    Do I need to call devenv /setup after the first call which uninstalls?

    The other solution seems to be to skip using VSIXinstaller and deploy manually but Id prefer to stick with the vsixinstaller.


    "Programming is an art form that fights back"

    Cosmos - C# Open Source Managed Operating System
    http://Cosmos.CodePlex.com

    Tuesday, June 19, 2012 9:52 PM

Answers

  • For anyone else with this issue there are a few workarounds but most have some pretty undesirabe side effects especially in a multi user environment.

    The one I settled on is to manually delete the package files before calling VSIXInstaller. This will force it to "upgrade", or install if they never existed before. From my installer (used as part of a build/test process) it looks like this:

    [InstallDelete]
    Type: files; Name: "{localappdata}\Microsoft\VisualStudio\10.0\Extensions\Cosmos.VS.XSharp.vsix"
    Type: filesandordirs; Name: "{localappdata}\Microsoft\VisualStudio\10.0\Extensions\Cosmos"

    [Run]
    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: "/quiet ""{app}\Build\VSIP\Cosmos.VS.XSharp.vsix"""; Flags: waituntilterminated


    "Programming is an art form that fights back"

    Cosmos - C# Open Source Managed Operating System
    http://Cosmos.CodePlex.com

    • Marked as answer by Kudzu22MVP Thursday, June 21, 2012 12:45 AM
    Thursday, June 21, 2012 12:45 AM

All replies

  • Something is definitely wrong with VSIXInstaller. If I run the above with /quiet it doesnt work. Run VS after on time the VSIX is there, next time its gone, next time its there, over and over  and easily repeatable.

    Remove the /quiet and it works fine.

    Other option is this:

    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: "/quiet /u:e2ce86d3-fb0b-43ad-938a-5bcdd087ea2d"; Flags: waituntilterminated
    Filename: {code:VSNET2010_PATH}\devenv.exe; Parameters: /setup; Flags: waituntilterminated
    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: "/quiet ""{app}\Build\VSIP\Cosmos.VS.XSharp.vsix"""; Flags: waituntilterminated

    But it has to be /setup without /nosetupvstemplates. The problem is without /nosetupvstemplates it takes about 5 seconds even on my i7 with RAID 0 SSDs.... So on other its 20+ seconds...


    "Programming is an art form that fights back"

    Cosmos - C# Open Source Managed Operating System
    http://Cosmos.CodePlex.com

    Wednesday, June 20, 2012 1:34 AM
  • Using ILSpy I looked at VSIXInstaller. Code for uninstal is identical but for install its different for quiet and verbose.

    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: "/quiet /u:e2ce86d3-fb0b-43ad-938a-5bcdd087ea2d"; Flags: waituntilterminated
    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: """{app}\Build\VSIP\Cosmos.VS.XSharp.vsix"""; Flags: waituntilterminated

    So that works.. so it appears there is a bug in VSIXInstaller and I might have to write my own tool using the extension api, or go back to manual deployment.


    "Programming is an art form that fights back"

    Cosmos - C# Open Source Managed Operating System
    http://Cosmos.CodePlex.com

    Wednesday, June 20, 2012 2:12 AM
  • For anyone else with this issue there are a few workarounds but most have some pretty undesirabe side effects especially in a multi user environment.

    The one I settled on is to manually delete the package files before calling VSIXInstaller. This will force it to "upgrade", or install if they never existed before. From my installer (used as part of a build/test process) it looks like this:

    [InstallDelete]
    Type: files; Name: "{localappdata}\Microsoft\VisualStudio\10.0\Extensions\Cosmos.VS.XSharp.vsix"
    Type: filesandordirs; Name: "{localappdata}\Microsoft\VisualStudio\10.0\Extensions\Cosmos"

    [Run]
    Filename: {code:VSNET2010_PATH}\VSIXInstaller.exe; Parameters: "/quiet ""{app}\Build\VSIP\Cosmos.VS.XSharp.vsix"""; Flags: waituntilterminated


    "Programming is an art form that fights back"

    Cosmos - C# Open Source Managed Operating System
    http://Cosmos.CodePlex.com

    • Marked as answer by Kudzu22MVP Thursday, June 21, 2012 12:45 AM
    Thursday, June 21, 2012 12:45 AM
  • Hi Kudzu22,

    I’m glad to hear that you got it working.

    Thank you for sharing your solutions & experience here. It will be very beneficial for other community members who have similar questions.

    Best regards,

    Ego

    Thursday, June 21, 2012 4:44 AM
    Moderator
  • Hi Kudzu22,

    Another work around is to run the vsixinstaller uninstall step twice.  As you discovered, the first execution marks the extension for deletion, which happens when you run Visual Studio.  If you run it a second time, it clears the extensions marked for deletion before it process any further instructions.

    You'll be glad to know that in the upcoming version of Visual Studio, we have improved this scenario and the uninstall through the vsixinstaller should enable the behavior you are looking for.

    Thanks
    Carl Brochu | Visual Studio team


    Carl Brochu, Visual Studio

    Thursday, June 21, 2012 9:01 PM
    Moderator
  • Thanks I will give it a try....

    Did you note my findings about the difference in behaviour with /quiet and without?


    "Programming is an art form that fights back"

    Cosmos - C# Open Source Managed Operating System
    http://Cosmos.CodePlex.com

    Thursday, June 21, 2012 9:13 PM