Commands That Must Be Run After Installation


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Commands That Must Be Run After Installation.

If you deploy your extension through an .msi file, you must run devenv /setup as part of your installation in order for Visual Studio to discover your extensions.

System_CAPS_ICON_note.jpg Note

The information in this topic applies to finding DevEnv with Visual Studio 2008 and earlier. For information about how to discover DevEnv with later versions of Visual Studio, see Detecting System Requirements.

You can locate each version's devenv.exe from registry values that Visual Studio installers write, using the RegLocator Table and AppSearch Table to store the registry values as properties. For more information, see Detecting System Requirements.

RegLocator table rows to locate devenv.exe from different versions of Visual Studio


AppSearch table rows for corresponding RegLocator table rows


For example, the Visual Studio installer writes the registry value of HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\Setup\VS\EnvironmentPath as C:\VS2008\Common7\IDE\devenv.exe, a complete path to the executable the installer must run.

Note Because the RegLocator Type column is 2, it is not necessary to specify additional version information in the Signature Table.

After the AppSearch standard action runs in the installer, each property in the AppSearch table has a value pointing to the devenv.exe file for the corresponding version of Visual Studio. If any of the specified registry values are not present — because that version of Visual Studio is not installed — the specified property is set to null.

Windows Installer supports running an executable to which a property points through custom action type 50. The custom action should include the in-script execution options, msidbCustomActionTypeInScript (1024) and msidbCustomActionTypeCommit (512), to ensure that the VSPackage has been successfully installed before integrating it into Visual Studio. For more information, see CustomAction Table and Custom Action In-Script Execution Options.

Custom actions of type 50 specify the property containing the executable as the value of the Source column and command-line arguments in the Target column.

CustomAction table rows to run devenv.exe


Custom actions must be authored into the InstallExecuteSequence table to schedule them for execution during the installation. Use the corresponding property in each row of the Condition column to prevent the custom action from being run if that version of Visual Studio is not installed on the system.

System_CAPS_ICON_note.jpg Note

Null properties evaluate to False when used in conditions.

The value of the Sequence column for each custom action depends on other sequence values in your Windows Installer package. Sequence values should be such that the devenv.exe custom actions run as close as possible to immediately prior to the InstallFinalize standard action.

InstallExecuteSequence table to schedule the devenv.exe custom actions


Installing VSPackages With Windows Installer