mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
update static manifests
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -362,5 +362,3 @@ src/common/Telemetry/*.etl
|
||||
|
||||
# PowerToysInstaller Build Temp Files
|
||||
installer/*/*.wxs.bk
|
||||
# Generated sparse manifest embedded into ImageResizer UI executable
|
||||
src/modules/imageresizer/ui/ImageResizerUI.exe.manifest
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
<!-- Target to generate sparse MSIX package -->
|
||||
<Target Name="GenerateSparsePackage" BeforeTargets="PrepareForBuild">
|
||||
<!-- Use NoSign for Debug builds or CI builds to avoid certificate issues -->
|
||||
<!-- Use NoSign only for CI builds to avoid certificate issues on hosted agents -->
|
||||
<PropertyGroup>
|
||||
<NoSignParam Condition="'$(Configuration)' == 'Debug' OR '$(NoSignCI)' == 'true'">-NoSign</NoSignParam>
|
||||
<NoSignParam Condition="'$(Configuration)' != 'Debug' AND '$(NoSignCI)' != 'true'"></NoSignParam>
|
||||
<NoSignParam Condition="'$(NoSignCI)' == 'true'">-NoSign</NoSignParam>
|
||||
<NoSignParam Condition="'$(NoSignCI)' != 'true'"></NoSignParam>
|
||||
<CIBuildParam Condition="'$(CIBuild)' == 'true'">-CIBuild</CIBuildParam>
|
||||
<CIBuildParam Condition="'$(CIBuild)' != 'true'"></CIBuildParam>
|
||||
</PropertyGroup>
|
||||
@@ -47,6 +47,7 @@
|
||||
<ProjectGuid>{E2A5A82E-1E5B-4C8D-9A4F-2B1A8F9E5C3D}</ProjectGuid>
|
||||
<RootNamespace>PackageIdentity</RootNamespace>
|
||||
<ProjectName>PackageIdentity</ProjectName>
|
||||
<UseFastUpToDateCheck>false</UseFastUpToDateCheck>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
|
||||
@@ -67,14 +67,14 @@ Get-AppxPackage -Name Microsoft.PowerToys.SparseApp | Remove-AppxPackage
|
||||
## CI-specific guidance
|
||||
|
||||
- Pass `-CIBuild` to `BuildSparsePackage.ps1` (or build with `msbuild PackageIdentity.vcxproj /p:CIBuild=true`). This prevents the script from rewriting the manifest publisher to the local dev certificate subject.
|
||||
- The project automatically adds `-NoSign` when you build Debug or when `$(CIBuild)` is `true`. Provide your own signing step in CI if the package must be signed.
|
||||
- The project automatically adds `-NoSign` only when `$(CIBuild)` is `true`. Local Debug and Release builds are signed with the development certificate.
|
||||
- Make sure the agent trusts whichever certificate signs the package. If the package remains unsigned (`-NoSign`) it cannot be installed on test machines until it is signed.
|
||||
|
||||
## Consuming the identity from other components
|
||||
|
||||
1. Add a new `<Application>` entry inside `src/PackageIdentity/AppxManifest.xml`. Use a unique `Id` (for example `PowerToys.MyModuleUI`) and set `Executable` to the Win32 binary relative to the `-ExternalLocation` root.
|
||||
2. Ensure the binary is copied into the platform/configuration output folder (`x64\Release`, `ARM64\Debug`, etc.) so the sparse package can locate it.
|
||||
3. Embed a sparse identity manifest in the Win32 binary so it binds to the MSIX identity at runtime. The manifest must declare an `<msix>` element with `packageName="Microsoft.PowerToys.SparseApp"`, `applicationId` matching the `<Application Id>`, and a `publisher` that matches the sparse package. Local builds can read the publisher from `src/PackageIdentity/.user/PowerToysSparse.publisher.txt` (emitted by `BuildSparsePackage.ps1`). See `src/modules/imageresizer/ui/ImageResizerUI.csproj` for an example MSBuild target (`GenerateSparseIdentityManifest`) that writes `ImageResizerUI.exe.manifest` and sets `ApplicationManifest` automatically.
|
||||
3. Embed a sparse identity manifest in the Win32 binary so it binds to the MSIX identity at runtime. The manifest must declare an `<msix>` element with `packageName="Microsoft.PowerToys.SparseApp"`, `applicationId` matching the `<Application Id>`, and a `publisher` that matches the sparse package. Keep the manifest’s publisher in sync with `src/PackageIdentity/.user/PowerToysSparse.publisher.txt` (emitted by `BuildSparsePackage.ps1`). See `src/modules/imageresizer/ui/ImageResizerUI.csproj` for an example that points `ApplicationManifest` to `ImageResizerUI.dev.manifest` for local builds and switches to `ImageResizerUI.prod.manifest` when `$(CIBuild)` is `true`.
|
||||
4. Register or re-register the sparse package so Windows learns about the new application Id.
|
||||
5. To launch the Win32 surface with identity, use the `shell:AppsFolder` activation form (for example: `shell:AppsFolder\Microsoft.PowerToys.SparseApp_<PackageFamilyName>!PowerToys.MyModuleUI`) or activate it via `IApplicationActivationManager::ActivateApplication` using the same AppUserModelID.
|
||||
|
||||
|
||||
@@ -25,10 +25,11 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<SparsePackagePublisherDefault>CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US</SparsePackagePublisherDefault>
|
||||
<SparsePackageName>Microsoft.PowerToys.SparseApp</SparsePackageName>
|
||||
<SparseApplicationId>PowerToys.ImageResizerUI</SparseApplicationId>
|
||||
<GeneratedSparseManifest>$(IntermediateOutputPath)ImageResizerUI.exe.manifest</GeneratedSparseManifest>
|
||||
<ApplicationManifest>ImageResizerUI.dev.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(CIBuild)'=='true'">
|
||||
<ApplicationManifest>ImageResizerUI.prod.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -72,27 +73,4 @@
|
||||
<Copy SourceFiles="@(ResourceFiles)" DestinationFolder="$(OutputPath)Resources" SkipUnchangedFiles="true" />
|
||||
</Target>
|
||||
|
||||
<Target Name="GenerateSparseIdentityManifest" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<SparsePackagePublisher>$(SparsePackagePublisherDefault)</SparsePackagePublisher>
|
||||
</PropertyGroup>
|
||||
<ReadLinesFromFile File="$(MSBuildThisFileDirectory)..\..\..\PackageIdentity\.user\PowerToysSparse.publisher.txt" Condition="Exists('$(MSBuildThisFileDirectory)..\..\..\PackageIdentity\.user\PowerToysSparse.publisher.txt')">
|
||||
<Output TaskParameter="Lines" PropertyName="SparsePackagePublisherFromFile" />
|
||||
</ReadLinesFromFile>
|
||||
<PropertyGroup Condition="'$(SparsePackagePublisherFromFile)' != ''">
|
||||
<SparsePackagePublisher>$(SparsePackagePublisherFromFile)</SparsePackagePublisher>
|
||||
</PropertyGroup>
|
||||
<MakeDir Directories="$(IntermediateOutputPath)" />
|
||||
<ItemGroup>
|
||||
<SparseManifestLines Include="<?xml version="1.0" encoding="utf-8"?>" />
|
||||
<SparseManifestLines Include="<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">" />
|
||||
<SparseManifestLines Include=" <assemblyIdentity version="1.0.0.0" name="PowerToys.ImageResizer.app"/>" />
|
||||
<SparseManifestLines Include=" <msix xmlns="urn:schemas-microsoft-com:msix.v1" publisher="$(SparsePackagePublisher)" packageName="$(SparsePackageName)" applicationId="$(SparseApplicationId)"/>" />
|
||||
<SparseManifestLines Include="</assembly>" />
|
||||
</ItemGroup>
|
||||
<WriteLinesToFile File="$(GeneratedSparseManifest)" Lines="@(SparseManifestLines)" Overwrite="true" Encoding="UTF-8" />
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>$(GeneratedSparseManifest)</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
8
src/modules/imageresizer/ui/ImageResizerUI.dev.manifest
Normal file
8
src/modules/imageresizer/ui/ImageResizerUI.dev.manifest
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="PowerToys.ImageResizer.app" />
|
||||
<msix xmlns="urn:schemas-microsoft-com:msix.v1"
|
||||
publisher="CN=PowerToys Dev, O=PowerToys, L=Redmond, S=Washington, C=US"
|
||||
packageName="Microsoft.PowerToys.SparseApp"
|
||||
applicationId="PowerToys.ImageResizerUI" />
|
||||
</assembly>
|
||||
8
src/modules/imageresizer/ui/ImageResizerUI.prod.manifest
Normal file
8
src/modules/imageresizer/ui/ImageResizerUI.prod.manifest
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="PowerToys.ImageResizer.app" />
|
||||
<msix xmlns="urn:schemas-microsoft-com:msix.v1"
|
||||
publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US"
|
||||
packageName="Microsoft.PowerToys.SparseApp"
|
||||
applicationId="PowerToys.ImageResizerUI" />
|
||||
</assembly>
|
||||
Reference in New Issue
Block a user