Register unpacked VSIX extension through MSI without using devenv / setup

We have the Visual Studio extension currently installed with MSI, since we need to perform certain tasks after installation (ngen, registering specific COM servers, etc.). At the end of the installation, we run devenv.exe /setup(more specifically, devenv.exe /setup /nosetupvstemplatesto make it a little faster) to register the extension in Visual Studio 2012 and higher (in 2010 this step was not required, since VS2010 rebuilt the extension caches each time it was started).

Currently, we want to move on to a partial installation of VSIX, but there are certain problems:

  • We have a specific folder structure (additional related tools). I could not find an option to include arbitrary folders and files in the VSIX package. Is it possible?

  • We try to avoid using it devenv.exe /setup, as in rare cases this can lead to extensions not loading (as described in detail by Remco Mulder on the MSDN Forums ).

  • We still need to perform post-installation operations that are currently not possible with VSIX.

  • In connection with the previous “sins,” we hardcoded some ways to use the format CompanyName\ProductName\Versionto which the VSIX packages should have been applied, but it seems that VSIX randomy is generating the folder name now (as Jason mentions in his answer below).

So, in fact, I need to install the “unpacked” VSIX package - install the MSI installer on the file structure on the disk (in the right place %VSInstallDir%\Common7\IDE\Extensions\Company\Product\Version), and then somehow have VSIX use the file .vsixmanifestto register the extension in Visual Studio.

(The initial digging into the Extension API shows there a method CreateInstalledExtensionin ExtensionManagerServicethat takes the path to vsixmanifest in the assembly Microsoft.VisualStudio.ExtensionManager.Implementation.dll, but unfortunately it is internal).

So, without resorting to API hacking, is there an alternative way to essentially install the extension in Visual Studio (2012 and above) without using it devenv /setup?

+4
source share
4

( ) - , "" () Visual Studio - devenv.exe /setup , , ( , - Visual Studio).

, , , Visual Studio - - , Solution explorer .. , .

VSIX, devenv.exe /setup, , , , , .

, , ! extensions.configurationchanged, %VSInstallDir%\Common7\IDE\Extensions, touched , VSIX , Visual Studio - (!) ! " " , Visual Studio , VSIX .

, extensions.configurationchanged , Visual Studio ( .pkgdef) - no devenv /setup

" " -, , " ", .

.

+13

, , , :
devenv /updateconfiguration

ConfigurationChanged HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\<version>, Visual Studio .pkgdef <version>_Config .

, , MSI.

+6

devenv /setup. devenv /setup. , , .

№2 , , , , " , ". , , .

# 1, , .vsix. " VSIX". , , . , , , - .

+4

, Devenv /UpdateConfiguration , :)

+3

Source: https://habr.com/ru/post/1530970/


All Articles