mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
MSIX: implement initial msix installer
This commit is contained in:
BIN
installer/MSIX/Images/logo.png
Normal file
BIN
installer/MSIX/Images/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
installer/MSIX/Images/logo150.png
Normal file
BIN
installer/MSIX/Images/logo150.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
BIN
installer/MSIX/Images/logo44.png
Normal file
BIN
installer/MSIX/Images/logo44.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
25
installer/MSIX/PackagingLayout.xml
Normal file
25
installer/MSIX/PackagingLayout.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<PackagingLayout xmlns="http://schemas.microsoft.com/appx/makeappx/2017">
|
||||||
|
<PackageFamily ID="PowerToys" FlatBundle="true" ManifestPath="appxmanifest.xml" ResourceManager="false">
|
||||||
|
|
||||||
|
<Package ID="x64" ProcessorArchitecture="x64">
|
||||||
|
<Files>
|
||||||
|
<File DestinationPath="License.rtf" SourcePath="..\..\License.rtf"/>
|
||||||
|
|
||||||
|
<File DestinationPath="PowerToys.exe" SourcePath="..\..\x64\Release\PowerToys.exe"/>
|
||||||
|
<File DestinationPath="PowerToysSettings.exe" SourcePath="..\..\x64\Release\PowerToysSettings.exe"/>
|
||||||
|
|
||||||
|
<File DestinationPath="modules\FancyZonesEditor.exe" SourcePath="..\..\x64\Release\modules\FancyZonesEditor.exe"/>
|
||||||
|
<File DestinationPath="modules\ControlzEx.dll" SourcePath="..\..\x64\Release\modules\ControlzEx.dll"/>
|
||||||
|
<File DestinationPath="modules\fancyzones.dll" SourcePath="..\..\x64\Release\modules\fancyzones.dll"/>
|
||||||
|
<File DestinationPath="modules\MahApps.Metro.dll" SourcePath="..\..\x64\Release\modules\MahApps.Metro.dll"/>
|
||||||
|
<File DestinationPath="modules\Microsoft.Xaml.Behaviors.dll" SourcePath="..\..\x64\Release\modules\Microsoft.Xaml.Behaviors.dll"/>
|
||||||
|
<File DestinationPath="modules\PowerRenameExt.dll" SourcePath="..\..\x64\Release\modules\PowerRenameExt.dll"/>
|
||||||
|
<File DestinationPath="modules\shortcut_guide.dll" SourcePath="..\..\x64\Release\modules\shortcut_guide.dll"/>
|
||||||
|
|
||||||
|
<File DestinationPath="svgs\*" SourcePath="..\..\x64\Release\svgs\*"/>
|
||||||
|
<File DestinationPath="settings-html\**" SourcePath="..\..\x64\Release\settings-html\**"/>
|
||||||
|
<File DestinationPath="Images\*.png" SourcePath="Images\*.png"/>
|
||||||
|
</Files>
|
||||||
|
</Package>
|
||||||
|
</PackageFamily>
|
||||||
|
</PackagingLayout>
|
||||||
35
installer/MSIX/appxmanifest.xml
Normal file
35
installer/MSIX/appxmanifest.xml
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5"
|
||||||
|
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
|
||||||
|
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10">
|
||||||
|
<Identity Name="PowerToys" Version="0.15.0.0" Publisher="CN=Microsoft Corporation" ProcessorArchitecture="x64" />
|
||||||
|
<!-- todo: try porting as a project? https://github.com/microsoft/DesktopBridgeToUWP-Samples/blob/master/Samples/AppServiceBridgeSample_C%2B%2B/cs/UWP/UWP.csproj -->
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>PowerToys</DisplayName>
|
||||||
|
<PublisherDisplayName>Microsoft Corporation</PublisherDisplayName>
|
||||||
|
<Description>Windows system utilities to maximize productivity</Description>
|
||||||
|
<Logo>Images\logo.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="en-us" />
|
||||||
|
</Resources>
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18362.30" />
|
||||||
|
</Dependencies>
|
||||||
|
<Capabilities>
|
||||||
|
<rescap:Capability Name="runFullTrust"/>
|
||||||
|
<rescap:Capability Name="allowElevation"/>
|
||||||
|
</Capabilities>
|
||||||
|
<Applications>
|
||||||
|
<Application Id="PowerToys" Executable="PowerToys.exe" EntryPoint="Windows.FullTrustApplication">
|
||||||
|
<uap:VisualElements DisplayName="PowerToys" Description="Windows system utilities to maximize productivity" Square150x150Logo="Images\logo150.png" Square44x44Logo="Images\logo44.png" BackgroundColor="transparent" />
|
||||||
|
<Extensions>
|
||||||
|
<uap5:Extension Category="windows.startupTask" Executable="PowerToys.exe" EntryPoint="Windows.FullTrustApplication">
|
||||||
|
<uap5:StartupTask TaskId="PowerToysStartupTaskID" Enabled="true" DisplayName="PowerToys" />
|
||||||
|
</uap5:Extension>
|
||||||
|
</Extensions>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
</Package>
|
||||||
5
installer/MSIX/reinstall.ps1
Normal file
5
installer/MSIX/reinstall.ps1
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
$name='PowerToys'
|
||||||
|
Get-AppxPackage -Name $name | select -ExpandProperty "PackageFullName" | Remove-AppxPackage
|
||||||
|
makeappx build /v /overwrite /f PackagingLayout.xml /id "x64" /op bin\
|
||||||
|
signtool sign /debug /a /fd SHA256 /f PowerToysTestKey.pfx /p 12345 bin\x64.msix
|
||||||
|
Add-AppxPackage .\bin\x64.msix
|
||||||
@@ -90,6 +90,10 @@
|
|||||||
<TargetMachine>MachineX64</TargetMachine>
|
<TargetMachine>MachineX64</TargetMachine>
|
||||||
<UACExecutionLevel>HighestAvailable</UACExecutionLevel>
|
<UACExecutionLevel>HighestAvailable</UACExecutionLevel>
|
||||||
</Link>
|
</Link>
|
||||||
|
<CustomBuildStep Label="BuildMSIX">
|
||||||
|
<Command>cd $(SolutionDir)MSIX && makeappx build /overwrite /f PackagingLayout.xml /id x64 /op bin\ && signtool sign /a /fd SHA256 /f PowerToysTestKey.pfx /p 12345 bin\x64.msix</Command>
|
||||||
|
<Outputs>$(SolutionDir)MSIX\bin\x64.msix</Outputs>
|
||||||
|
</CustomBuildStep>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="CustomAction.cpp" />
|
<ClCompile Include="CustomAction.cpp" />
|
||||||
|
|||||||
@@ -5,3 +5,17 @@
|
|||||||
* Install the [WiX Toolset build tools](https://wixtoolset.org/releases/) in the development machine.
|
* Install the [WiX Toolset build tools](https://wixtoolset.org/releases/) in the development machine.
|
||||||
* Open `powertoys.sln`, select the "Release" and "x64" configurations and build the `PowerToysSetup` project.
|
* Open `powertoys.sln`, select the "Release" and "x64" configurations and build the `PowerToysSetup` project.
|
||||||
* The resulting installer will be built to `PowerToysSetup\bin\Release\PowerToysSetup.msi`.
|
* The resulting installer will be built to `PowerToysSetup\bin\Release\PowerToysSetup.msi`.
|
||||||
|
|
||||||
|
## Building and installing self-signed PowerToys MSIX package
|
||||||
|
* Make sure you've built correct `powertoys.sln` configuration
|
||||||
|
* Add `PowerToysTestKey.pfx` to the [TRCA store](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/trusted-root-certification-authorities-certificate-store)
|
||||||
|
* Execute `reinstall.ps1` from the devenv powershell:
|
||||||
|
## Removing all current PowerToys installations
|
||||||
|
```ps
|
||||||
|
$name='PowerToys'
|
||||||
|
Get-AppxPackage -Name $name | select -ExpandProperty "PackageFullName" | Remove-AppxPackage
|
||||||
|
gwmi win32_product -filter "Name = '$name'" -namespace root/cimv2 | foreach {
|
||||||
|
if ($_.uninstall().returnvalue -eq 0) { write-host "Successfully uninstalled $name " }
|
||||||
|
else { write-warning "Failed to uninstall $name." }
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|||||||
@@ -112,6 +112,7 @@
|
|||||||
<ClInclude Include="two_way_pipe_message_ipc.h" />
|
<ClInclude Include="two_way_pipe_message_ipc.h" />
|
||||||
<ClInclude Include="version.h" />
|
<ClInclude Include="version.h" />
|
||||||
<ClInclude Include="windows_colors.h" />
|
<ClInclude Include="windows_colors.h" />
|
||||||
|
<ClInclude Include="winstore.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="animation.cpp" />
|
<ClCompile Include="animation.cpp" />
|
||||||
@@ -133,6 +134,7 @@
|
|||||||
<ClCompile Include="tasklist_positions.cpp" />
|
<ClCompile Include="tasklist_positions.cpp" />
|
||||||
<ClCompile Include="common.cpp" />
|
<ClCompile Include="common.cpp" />
|
||||||
<ClCompile Include="windows_colors.cpp" />
|
<ClCompile Include="windows_colors.cpp" />
|
||||||
|
<ClCompile Include="winstore.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|||||||
@@ -78,6 +78,9 @@
|
|||||||
<ClInclude Include="json.h">
|
<ClInclude Include="json.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="winstore.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="d2d_svg.cpp">
|
<ClCompile Include="d2d_svg.cpp">
|
||||||
@@ -126,5 +129,8 @@
|
|||||||
<ClCompile Include="json.cpp">
|
<ClCompile Include="json.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="winstore.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
11
src/common/winstore.cpp
Normal file
11
src/common/winstore.cpp
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "winstore.h"
|
||||||
|
|
||||||
|
#include <appmodel.h>
|
||||||
|
|
||||||
|
bool running_as_packaged()
|
||||||
|
{
|
||||||
|
UINT32 length = 0;
|
||||||
|
const auto rc = GetPackageFamilyName(GetCurrentProcess(), &length, nullptr);
|
||||||
|
return rc != APPMODEL_ERROR_NO_PACKAGE;
|
||||||
|
}
|
||||||
3
src/common/winstore.h
Normal file
3
src/common/winstore.h
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
bool running_as_packaged();
|
||||||
Reference in New Issue
Block a user