|
| 1 | +# Developer guidance |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +* Windows 10 1809 (17763) or later |
| 6 | +* [Developer Mode enabled](https://docs.microsoft.com/windows/uwp/get-started/enable-your-device-for-development) |
| 7 | +* [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) |
| 8 | + * Or use WinGet to install it ;) (although you may need to adjust the workloads via Tools->Get Tools and Features...) |
| 9 | +* The following workloads: |
| 10 | + * .NET Desktop Development |
| 11 | + * Desktop Development with C++ |
| 12 | + * Universal Windows Platform Development |
| 13 | + * Check [.vsconfig file](.vsconfig) for full components list |
| 14 | + |
| 15 | +* [Windows SDK for Windows 11 (10.0.22000.194)](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/) |
| 16 | + |
| 17 | +> [!NOTE] |
| 18 | +> You can also get it through `winget install Microsoft.WindowsSDK --version 10.0.22000.832` (use --force if you have a newer version installed) or via Visual Studio > Get Tools and Features > Individual Components > Windows 10 SDK (10.0.22000.0) |
| 19 | +
|
| 20 | +* The following extensions: |
| 21 | + |
| 22 | + * [Microsoft Visual Studio Installer Projects](https://marketplace.visualstudio.com/items?itemName=VisualStudioClient.MicrosoftVisualStudio2022InstallerProjects) |
| 23 | + |
| 24 | +## Building the client |
| 25 | + |
| 26 | +1. Clone the repository |
| 27 | +2. Configure your system, please use the [configuration file](.configurations/configuration.dsc.yaml). This can be applied by either: |
| 28 | + * [Dev Home](https://github.com/microsoft/devhome)'s machine configuration tool |
| 29 | + * WinGet configuration. Run `winget configure .configurations/configuration.dsc.yaml` from the project root so relative paths resolve correctly. |
| 30 | +3. Run `vcpkg integrate install` from the Developer Command Prompt / Developer PowerShell for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup. |
| 31 | + |
| 32 | +Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We currently only build using the solution; command-line methods of building a VS solution should work as well. |
| 33 | + |
| 34 | +## Running and Debugging |
| 35 | + |
| 36 | +After the build finishes, deploy the solution from Build > Deploy Solution. You can then run the client from the command line using `wingetdev`. |
| 37 | + |
| 38 | +You can also directly run the client from Visual Studio by setting the `AppInstallerCLIPackage` project as the startup project and pressing <kbd>F5</kbd>. To prevent the client from exiting as soon as it finishes its execution, you can add the `--wait` command line argument in the project's debug settings. |
| 39 | + |
| 40 | +To enable step-through debugging, right click on `AppInstallerCLIPackage` in the Solution Explorer, select Properties, and navigate to the Debug tab. In the Debugger type selection, change "Application process" and "Background task process" to "Native Only". This will allow you to add breakpoints and step through the code. The main entry point for the client is in `src/AppInstallerCLI/main.cpp` |
| 41 | + |
| 42 | +## Running Unit Tests |
| 43 | + |
| 44 | +The unit tests are located inside the `AppInstallerCLITests` project. When the solution is built, all tests are compiled under `src/<ARCHITECTURE>/<Debug|Release>/AppInstallerCLITests`. An executable `AppInstallerCLITests.exe` is generated in this directory to run the tests. Run `AppInstallerCLITests.exe` from the command line to execute the tests. To see all available options, run `AppInstallerCLITests.exe --help`. |
| 45 | + |
| 46 | +> [!TIP] |
| 47 | +> If you just want to run a particular test, you can specify the test name as an argument to the executable. For example, `AppInstallerCLITests.exe EnsureSortedErrorList`. |
0 commit comments