Compare commits

...

7 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
4a68756630 spell-check: add 'redist' to expect.txt allowlist
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/90993590-d870-4d53-afb2-c1f4a152f5f1

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-05-14 08:51:35 +00:00
Muyuan Li (from Dev Box)
50c78e51d8 Address review: fix per-user elevation, platform guard, and registry bitness
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-14 16:11:34 +08:00
copilot-swe-agent[bot]
177a569a86 installer: clarify VC++ registry key versioning in comments and docs
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/ecc60744-7db7-4ff2-a380-991ecd863892

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-04-29 11:29:37 +00:00
copilot-swe-agent[bot]
99920a7da0 installer: fix registry search to use Result=exists for VC++ detection
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/ecc60744-7db7-4ff2-a380-991ecd863892

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-04-29 11:28:25 +00:00
copilot-swe-agent[bot]
7405c97d79 installer: refactor VC++ prerequisite ExePackage to use preprocessor variables
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/ecc60744-7db7-4ff2-a380-991ecd863892

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-04-29 11:26:05 +00:00
copilot-swe-agent[bot]
4bf2f38bb0 installer: add VC++ 2015-2022 Redistributable prerequisite to bootstrapper chain
Agent-Logs-Url: https://github.com/microsoft/PowerToys/sessions/ecc60744-7db7-4ff2-a380-991ecd863892

Co-authored-by: MuyuanMS <116717757+MuyuanMS@users.noreply.github.com>
2026-04-29 11:24:36 +00:00
copilot-swe-agent[bot]
e10b817ef0 Initial plan 2026-04-29 08:50:52 +00:00
3 changed files with 57 additions and 0 deletions

View File

@@ -1531,6 +1531,7 @@ reparenting
reportfileaccesses
requery
requerying
redist
rescap
resgen
resheader

View File

@@ -11,6 +11,34 @@
- GPO checking
- Process termination
### Bootstrapper Prerequisites
The bootstrapper (`PowerToys.wxs`) installs prerequisites before the main MSI runs:
| Prerequisite | Detection | Install source |
|---|---|---|
| Microsoft Edge WebView2 | Registry: `EdgeUpdate\Clients\{F3017226…}` | Bundled stub that downloads the runtime |
| Microsoft Visual C++ 2015-2022 Redistributable | `HKLM\SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\{x64|arm64}` value `Installed` exists | Downloaded from `https://aka.ms/vs/17/release/vc_redist.{x64|arm64}.exe` |
> **Note:** The VC++ Redistributable is marked `Vital="no"` because PowerToys ships its own
> self-contained VC++ runtime DLLs (since v0.66). The system-wide redistributable is installed
> as a safety net for edge cases (e.g., minimal Windows images, corrupted system DLLs) where
> native components such as the custom-action DLL fail to load with error `0x8007007e`
> (ERROR_MOD_NOT_FOUND). If the download or elevation fails, the bundled DLLs still cover
> PowerToys' own binaries.
### Self-contained Runtimes
Since v0.66, PowerToys bundles the following runtimes inside its installation directory
(hard-linked across modules to minimize disk usage):
- Windows App SDK runtime
- .NET Desktop Runtime
- Microsoft Visual C++ Runtime
These are installed as part of the MSI and live under `<InstallDir>\`. See
[disk-usage-footprint.md](../disk-usage-footprint.md) for details.
### Installer Components
- Separate builds for machine-wide and user-scope installation

View File

@@ -20,6 +20,25 @@
<util:RegistrySearch Variable="HasWebView2PerMachine" Root="HKLM" Key="SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
<util:RegistrySearch Variable="HasWebView2PerUser" Root="HKCU" Key="Software\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}" Result="exists" />
<!-- VC++ 2015-2022 Redistributable detection. The Installed value is a DWORD set to 1 when the runtime is
present; checking for its existence with Result="exists" gives a reliable boolean regardless of the
registry value's internal type representation in WiX bundle conditions.
Note: all VC++ 2015-2022 releases (v14.x) share the same "14.0" registry root even though the
binaries ship separately for each VS version; finding the key here means at least one is installed. -->
<?if $(var.Platform) = x64 ?>
<util:RegistrySearch Variable="VCRedist2022Installed" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\x64" Value="Installed" Result="exists" Win64="yes" />
<?define VCRedistDisplayName="Microsoft Visual C++ 2015-2022 Redistributable (x64)"?>
<?define VCRedistFileName="vc_redist.x64.exe"?>
<?define VCRedistDownloadUrl="https://aka.ms/vs/17/release/vc_redist.x64.exe"?>
<?elseif $(var.Platform) = arm64 ?>
<util:RegistrySearch Variable="VCRedist2022Installed" Root="HKLM" Key="SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\arm64" Value="Installed" Result="exists" Win64="yes" />
<?define VCRedistDisplayName="Microsoft Visual C++ 2015-2022 Redistributable (ARM64)"?>
<?define VCRedistFileName="vc_redist.arm64.exe"?>
<?define VCRedistDownloadUrl="https://aka.ms/vs/17/release/vc_redist.arm64.exe"?>
<?else?>
<?error Unsupported Platform value for VC++ redistributable: $(var.Platform). Supported values are x64 and arm64.?>
<?endif?>
<?if $(var.PerUser) = "true" ?>
<Variable Name="InstallFolder" Type="formatted" Value="[LocalAppDataFolder]PowerToys" bal:Overridable="yes" />
<?else?>
@@ -58,6 +77,15 @@
</ExePackage>
<ExePackage DisplayName="Microsoft Edge WebView2" Name="MicrosoftEdgeWebview2Setup.exe" Compressed="yes" Id="WebView2" DetectCondition="HasWebView2PerMachine OR HasWebView2PerUser" SourceFile="WebView2\MicrosoftEdgeWebview2Setup.exe" Permanent="yes" PerMachine="$(var.PerMachineYesNo)" InstallArguments="/silent /install" RepairArguments="/repair /passive" UninstallArguments="/silent /uninstall">
</ExePackage>
<!-- Install the VC++ 2015-2022 Redistributable when absent. The package is downloaded from Microsoft servers
and installed before the PowerToys MSI so that native components (e.g., custom-action DLLs) can
load successfully even on minimal or freshly-deployed Windows images.
Vital="no" because PowerToys ships its own self-contained runtime DLLs (since v0.66), so the
bundled copies will cover most scenarios even if this step fails (e.g., no network or elevation).
Note: the download URL points to Microsoft's CDN over HTTPS; a pinned Hash is intentionally omitted
here (same approach as the WebView2 entry above) because the aka.ms redirect always points to the
latest VS 2022 release and the hash would break on every upstream update. -->
<ExePackage DisplayName="$(var.VCRedistDisplayName)" Id="VCRedist2022" Name="$(var.VCRedistFileName)" Compressed="no" PerMachine="$(var.PerMachineYesNo)" Permanent="yes" Vital="no" DetectCondition="VCRedist2022Installed" DownloadUrl="$(var.VCRedistDownloadUrl)" InstallArguments="/install /quiet /norestart" RepairArguments="/repair /quiet /norestart" UninstallArguments="/uninstall /quiet /norestart" />
<MsiPackage DisplayName="PowerToys MSI" SourceFile="$(var.PowerToysPlatform)\Release\$(var.MSIPath)\$(var.MSIName)" Compressed="yes" bal:DisplayInternalUICondition="false">
<MsiProperty Name="BOOTSTRAPPERINSTALLFOLDER" Value="[InstallFolder]" />
<MsiProperty Name="MSIRESTARTMANAGERCONTROL" Value="Disable" />