Partager via


Post-install Commands

Your VSPackage installer must notify Visual Studio 2008 of the introduction and removal of your VSPackage by running devenv.exe /setup after your VSPackage's files have been installed or removed. Your installer must run the devenv.exe for every side-by-side version of Visual Studio 2008 it supports. So, for example, if you have a single installer that supports Visual Studio .NET 2003 and Visual Studio 2008, you must run devenv.exe from each version.

Finding devenv.exe

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.

Signature_

Root

Key

Name

Type

RL_DevenvExe_2002

2

SOFTWARE\Microsoft\VisualStudio\7.0\Setup\VS

EnvironmentPath

2

RL_DevenvExe_2003

2

SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VS

EnvironmentPath

2

RL_DevenvExe_2005

2

SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VS

EnvironmentPath

2

Property

Signature_

DEVENV_EXE_2002

RL_DevenvExe_2002

DEVENV_EXE_2003

RL_DevenvExe_2003

DEVENV_EXE_2005

RL_DevenvExe_2005

For example, the Visual Studio 2008 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.

Notes

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

Running devenv.exe

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 2008. If any of the specified registry values are not present — because that version of Visual Studio 2008 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.

Action

Type

Source

Target

CA_RunDevenv2002

1586

DEVENV_EXE_2002

/setup

CA_RunDevenv2003

1586

DEVENV_EXE_2003

/setup

CA_RunDevenv2005

1586

DEVENV_EXE_2005

/setup

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.

Notes

Null properties evaluate to False when used in conditions. For more information, see Using Properties in Conditional Statements.

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.

Action

Condition

Sequence

CA_RunDevenv2002

DEVENV_EXE_2002

6602

CA_RunDevenv2003

DEVENV_EXE_2003

6603

CA_RunDevenv2005

DEVENV_EXE_2005

6605

See Also

Concepts

CustomAction Table