Using vcpkg in windows orb

We try to integrate vcpkg into msbuild. This worked until mid of 2022 but now fails.
Current step in config.yml:

      - run:
          name: Integrate vcpkg into msbuild environment!
          command: cd vcpkg && vcpkg.exe integrate install
          shell: cmd.exe

which now gives:
error: failed to install system targets file to C:\Program Files (x86)\MSBuild/Microsoft.Cpp/v4.0/V140/ImportBefore/Default/vcpkg.system.props

What went wrong now?

I can only put forward a guess here - are you sure that cmd.exe has enough rights? A lot of MS tools have a habit of viewing an environment as a ‘desktop’ and so operate on all accounts rather than just the active account. The result is that the command shell may need administrator rights.

If the above is true you will need to post more about the environment as someone may know a way of elevating permissions without all the standard Windows UAC pop-up windows.

solved it using:

      - run:
          name: Integrate vcpkg into msbuild environment with powershell
          command: cd vcpkg; Start-Process -Wait vcpkg.exe -verb runAs -Args "--triplet x86-windows integrate install"
          shell: powershell.exe -ExecutionPolicy Bypass

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.