mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-15 19:27:56 +01:00
Closes #37100 This does not migrate the rest of the solutions (why do we have so many?) Not migrated: - TemplateCmdPalExtension.sln - FancyZonesEditor.sln - BugReportTool.sln - CleanUp_tool.sln - FancyZones_DrawLayoutTest.sln - FancyZones_zonable_tester.sln - FancyZone_HitTest.sln - MonitorReportTool.sln - PowerToyTemplate.sln - StylesReportTool.sln --------- Co-authored-by: vanzue <vanzue@outlook.com>
2.5 KiB
2.5 KiB
Build scripts – quick guideline
Use these scripts to build PowerToys locally. They auto-detect your platform (x64/arm64), initialize the Visual Studio developer environment, and write helpful logs on failure.
Quick start (from cmd.exe)
- Fast essentials (runner + settings) and NuGet restore first:
tools\build\build-essentials.cmd
- Build projects in the current folder:
tools\build\build.cmd
Tip: Add D:\PowerToys\tools\build to your PATH to use the wrappers anywhere.
When to use which
-
build-essentials.ps1- Restores NuGet for
PowerToys.slnxand builds essentials (runner, settings). - Auto-detects Platform; initializes VS Dev environment automatically.
- Example (PowerShell):
./tools/build/build-essentials.ps1./tools/build/build-essentials.ps1 -Platform arm64 -Configuration Release
- Restores NuGet for
-
build.ps1(from any folder)- Builds any
.sln/.csproj/.vcxprojin the current directory. - Auto-detects Platform; initializes VS Dev environment automatically.
- Accepts extra MSBuild args (forwarded to msbuild):
./tools/build/build.ps1 '/p:CIBuild=true' '/p:SomeProp=Value'
- Restore only:
./tools/build/build.ps1 -RestoreOnly
- Builds any
-
build-installer.ps1(use with caution)- Full local packaging pipeline (restore, build, sign MSIX, WiX v5 MSI/bootstrapper).
- Auto-inits VS Dev environment. Cleans some output (keeps *.exe) under
installer/. - Key options:
-PerUser true|false,-InstallerSuffix wix5|vnext. - Example:
./tools/build/build-installer.ps1 -Platform x64 -Configuration Release -PerUser true -InstallerSuffix wix5
Logs and troubleshooting
- On failure, see logs next to the solution/project being built:
build.<configuration>.<platform>.all.log— full text logbuild.<configuration>.<platform>.errors.log— errors onlybuild.<configuration>.<platform>.warnings.log— warnings onlybuild.<configuration>.<platform>.trace.binlog— open with MSBuild Structured Log Viewer
- VS environment init:
- Scripts try DevShell first (
Microsoft.VisualStudio.DevShell.dll/Enter-VsDevShell), then fall back toVsDevCmd.bat. - If VS isn’t found, run from “Developer PowerShell for VS 2022”, or ensure
vswhere.exeexists underProgram Files (x86)\Microsoft Visual Studio\Installer.
- Scripts try DevShell first (
Notes
- Override platform explicitly with
-Platform x64|arm64if needed. - CMD wrappers:
build.cmd,build-essentials.cmdforward all arguments to the PowerShell scripts.