Visual studio setup project and MSBuild (again)

AdamS 0 Reputation points
2026-07-21T13:01:49.42+00:00

Hi,

We're trying to get rid of VS from Jenkins and use MSBuild exclusively, but we have an installer project. I know MSBuild doesn't support .vdproj, so there's no way to make it work. We have a custom UI and a lot of custom actions, so switching to Wix would be quite a challenge. Instead, I wrote a tool to parse vdproj file and populate the schema.msi. The only problem is that I can't figure out how the "ComponentId" in the "Component" table is calculated. Ideally, I'd like to get the same value on both builds: local (installer) and Jenkins (msbuild). It looks it's a combination of the upgrade code, path, and filename, but I've tried different order/hash implementations but can't get the same value.

Could you provide some details how it's calculated and which hash function i should use?

Developer technologies | Visual Studio | Setup

2 answers

Sort by: Most helpful
  1. kagiyama yutaka 4,835 Reputation points
    2026-07-22T04:12:06.63+00:00

    I think Windows Installer keeps ComponentId as the GUID in the MSI Component table, and Visual Studio’s vdproj already stores that GUID for each component. So matching VS and Jenkins just means reading that ComponentId from the vdproj and using the same GUID when you build ur MSI. Visual Studio does not compute ComponentId during the build; it simply copies the GUID already stored in the vdproj into the MSI Component table.

    Was this answer helpful?

    0 comments No comments

  2. Nancy Vo (WICLOUD CORPORATION) 7,985 Reputation points Microsoft External Staff Moderator
    2026-07-22T03:46:32.3866667+00:00

    Hello @AdamS ,

    Thanks for your question.

    It appears that the specific algorithm and hash function Visual Studio uses to calculate the ComponentId in a .vdproj file is an internal implementation detail. This formula does not seem to be publicly documented.

    I recommend not trying to reverse-engineer these internal IDs, as they may change over time.

    You can refer to these following approaches:

    Although there are efforts to move away from this approach, invoking devenv.exe from the command line on a Jenkins server may still be a practical option for building .vdproj files, since it is designed to handle the associated ID generation processes. For a longer-term approach, while switching to WiX may be challenging due to your custom UI requirements, it is often recommended for teams that want to use MSBuild exclusively.

    I hope this addresses your question. If this response was helpful, please consider following the guidance to provide feedback. Thank you.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.