forked from microsoft/PowerToys
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FileLocksmith]Add Windows11 (tier1) context menu (microsoft#31388)
* Add project * Cleanup project file and add resource file * Move common logic to FileLocksmithLib * Cleanup interop vcxproj * Implement handler, add assets and appx manifest * Revert "Cleanup interop vcxproj" This reverts commit 97bf991. * Remove package on uninstall Install package on enable Fix launching app Cleanup * Revert non-related change * Spellcheck * Update src/modules/FileLocksmith/FileLocksmithContextMenu/Resources.resx * Wire Show in extended context menu setting
- Loading branch information
1 parent
e607b26
commit e573b7a
Showing
44 changed files
with
906 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
src/modules/FileLocksmith/FileLocksmithContextMenu/AppxManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?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:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" | ||
xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" | ||
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" | ||
xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" | ||
xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4" | ||
xmlns:desktop5="http://schemas.microsoft.com/appx/manifest/desktop/windows10/5" | ||
xmlns:uap10="http://schemas.microsoft.com/appx/manifest/uap/windows10/10" | ||
xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10" IgnorableNamespaces="uap uap2 uap3 rescap desktop desktop4 desktop5 uap10 com"> | ||
<Identity Name="Microsoft.PowerToys.FileLocksmithContextMenu" ProcessorArchitecture="neutral" Publisher="CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US" Version="1.0.0.0" /> | ||
<Properties> | ||
<DisplayName>PowerToys FileLocksmith Context Menu</DisplayName> | ||
<PublisherDisplayName>Microsoft</PublisherDisplayName> | ||
<Logo>Assets\FileLocksmith\storelogo.png</Logo> | ||
<uap10:AllowExternalContent>true</uap10:AllowExternalContent> | ||
</Properties> | ||
<Resources> | ||
<Resource Language="en-us" /> | ||
</Resources> | ||
<Dependencies> | ||
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.18950.0" MaxVersionTested="10.0.19000.0" /> | ||
</Dependencies> | ||
<Capabilities> | ||
<rescap:Capability Name="runFullTrust" /> | ||
<rescap:Capability Name="unvirtualizedResources"/> | ||
</Capabilities> | ||
<Applications> | ||
<Application Id="Microsoft.PowerToys.FileLocksmithContextMenu" Executable="FileLocksmithUI.exe" uap10:TrustLevel="mediumIL" uap10:RuntimeBehavior="win32App"> | ||
<uap:VisualElements AppListEntry="none" DisplayName="PowerToys FileLocksmith Context Menu" Description="FileLocksmithContextMenu" BackgroundColor="transparent" Square150x150Logo="Assets\FileLocksmith\Square150x150Logo.png" Square44x44Logo="Assets\FileLocksmith\Square44x44Logo.png"> | ||
<uap:DefaultTile Wide310x150Logo="Assets\FileLocksmith\Wide310x150Logo.png" Square310x310Logo="Assets\FileLocksmith\LargeTile.png" Square71x71Logo="Assets\FileLocksmith\SmallTile.png"></uap:DefaultTile> | ||
<uap:SplashScreen Image="Assets\FileLocksmith\SplashScreen.png" /> | ||
</uap:VisualElements> | ||
<Extensions> | ||
<desktop4:Extension Category="windows.fileExplorerContextMenus"> | ||
<desktop4:FileExplorerContextMenus> | ||
<desktop5:ItemType Type="Directory"> | ||
<desktop5:Verb Id="FileLocksmithCommand" Clsid="AAF1E27D-4976-49C2-8895-AAFA743C0A7E" /> | ||
</desktop5:ItemType> | ||
<desktop5:ItemType Type="*"> | ||
<desktop5:Verb Id="FileLocksmithCommand" Clsid="AAF1E27D-4976-49C2-8895-AAFA743C0A7E" /> | ||
</desktop5:ItemType> | ||
</desktop4:FileExplorerContextMenus> | ||
</desktop4:Extension> | ||
<com:Extension Category="windows.comServer" uap10:RuntimeBehavior="packagedClassicApp"> | ||
<com:ComServer> | ||
<com:SurrogateServer DisplayName="Context menu verb handler"> | ||
<com:Class Id="AAF1E27D-4976-49C2-8895-AAFA743C0A7E" Path="PowerToys.FileLocksmithContextMenu.dll" ThreadingModel="STA"/> | ||
</com:SurrogateServer> | ||
</com:ComServer> | ||
</com:Extension> | ||
</Extensions> | ||
</Application> | ||
</Applications> | ||
</Package> |
Binary file added
BIN
+170 KB
src/modules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/FileLocksmith.ico
Binary file not shown.
Binary file added
BIN
+1.37 KB
...dules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/LargeTile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+433 Bytes
...dules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SmallTile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.28 KB
...es/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/SplashScreen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.37 KB
...leLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square150x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+433 Bytes
...FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Square44x44Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.25 KB
...FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/Wide310x150Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+328 Bytes
...dules/FileLocksmith/FileLocksmithContextMenu/Assets/FileLocksmith/storelogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions
50
src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.base.rc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include <windows.h> | ||
#include "Generated Files/resource.h" | ||
#include "../../../common/version/version.h" | ||
|
||
#define APSTUDIO_READONLY_SYMBOLS | ||
#include "winres.h" | ||
#undef APSTUDIO_READONLY_SYMBOLS | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Icon | ||
// | ||
|
||
///////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Version | ||
// | ||
|
||
VS_VERSION_INFO VERSIONINFO | ||
FILEVERSION FILE_VERSION | ||
PRODUCTVERSION PRODUCT_VERSION | ||
FILEFLAGSMASK 0x3fL | ||
#ifdef _DEBUG | ||
FILEFLAGS 0x1L | ||
#else | ||
FILEFLAGS 0x0L | ||
#endif | ||
FILEOS 0x40004L | ||
FILETYPE 0x2L | ||
FILESUBTYPE 0x0L | ||
BEGIN | ||
BLOCK "StringFileInfo" | ||
BEGIN | ||
BLOCK "040904b0" | ||
BEGIN | ||
VALUE "CompanyName", COMPANY_NAME | ||
VALUE "FileDescription", FILE_DESCRIPTION | ||
VALUE "FileVersion", FILE_VERSION_STRING | ||
VALUE "InternalName", INTERNAL_NAME | ||
VALUE "LegalCopyright", COPYRIGHT_NOTE | ||
VALUE "OriginalFilename", ORIGINAL_FILENAME | ||
VALUE "ProductName", PRODUCT_NAME | ||
VALUE "ProductVersion", PRODUCT_VERSION_STRING | ||
END | ||
END | ||
BLOCK "VarFileInfo" | ||
BEGIN | ||
VALUE "Translation", 0x409, 1200 | ||
END | ||
END |
130 changes: 130 additions & 0 deletions
130
src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild"> | ||
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h FileLocksmithContextMenu.base.rc FileLocksmithContextMenu.rc" /> | ||
</Target> | ||
<PropertyGroup Label="Globals"> | ||
<VCProjectVersion>17.0</VCProjectVersion> | ||
<Keyword>Win32Proj</Keyword> | ||
<ProjectGuid>{799a50d8-de89-4ed1-8ff8-ad5a9ed8c0ca}</ProjectGuid> | ||
<RootNamespace>FileLocksmithContextMenu</RootNamespace> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup> | ||
<TargetName>PowerToys.FileLocksmithContextMenu</TargetName> | ||
<!-- Needs a different int dir to avoid conflicts in msix creation. --> | ||
<IntDir>$(SolutionDir)$(Platform)\$(Configuration)\TemporaryBuild\obj\$(ProjectName)\</IntDir> | ||
<OutDir>..\..\..\..\$(Platform)\$(Configuration)\WinUI3Apps\</OutDir> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>true</UseDebugLibraries> | ||
<PlatformToolset>v143</PlatformToolset> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)'=='Release'" Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<UseDebugLibraries>false</UseDebugLibraries> | ||
<PlatformToolset>v143</PlatformToolset> | ||
<WholeProgramOptimization>true</WholeProgramOptimization> | ||
<CharacterSet>Unicode</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="Shared"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Debug'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>WIN32;_DEBUG;FILELOCKSMITHCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<AdditionalIncludeDirectories>..;../../..;</AdditionalIncludeDirectories> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableUAC>false</EnableUAC> | ||
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ModuleDefinitionFile>Source.def</ModuleDefinitionFile> | ||
</Link> | ||
<PreBuildEvent> | ||
<Command>del $(OutDir)\FileLocksmithContextMenuPackage.msix /q | ||
MakeAppx.exe pack /d . /p $(OutDir)FileLocksmithContextMenuPackage.msix /nv</Command> | ||
</PreBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemDefinitionGroup Condition="'$(Configuration)'=='Release'"> | ||
<ClCompile> | ||
<WarningLevel>Level3</WarningLevel> | ||
<FunctionLevelLinking>true</FunctionLevelLinking> | ||
<IntrinsicFunctions>true</IntrinsicFunctions> | ||
<SDLCheck>true</SDLCheck> | ||
<PreprocessorDefinitions>WIN32;NDEBUG;FILELOCKSMITHCONTEXTMENU_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> | ||
<ConformanceMode>true</ConformanceMode> | ||
<PrecompiledHeader>Use</PrecompiledHeader> | ||
<AdditionalIncludeDirectories>..;../../..;</AdditionalIncludeDirectories> | ||
</ClCompile> | ||
<Link> | ||
<SubSystem>Windows</SubSystem> | ||
<EnableCOMDATFolding>true</EnableCOMDATFolding> | ||
<OptimizeReferences>true</OptimizeReferences> | ||
<GenerateDebugInformation>true</GenerateDebugInformation> | ||
<EnableUAC>false</EnableUAC> | ||
<AdditionalDependencies>runtimeobject.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<ModuleDefinitionFile>Source.def</ModuleDefinitionFile> | ||
</Link> | ||
<PreBuildEvent> | ||
<Command>del $(OutDir)\FileLocksmithContextMenuPackage.msix /q | ||
MakeAppx.exe pack /d . /p $(OutDir)FileLocksmithContextMenuPackage.msix /nv</Command> | ||
</PreBuildEvent> | ||
</ItemDefinitionGroup> | ||
<ItemGroup> | ||
<ClInclude Include="framework.h" /> | ||
<ClInclude Include="pch.h" /> | ||
<ClInclude Include="resource.base.h" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="dllmain.cpp" /> | ||
<ClCompile Include="pch.cpp"> | ||
<PrecompiledHeader>Create</PrecompiledHeader> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
<None Include="Resources.resx" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Assets\FileLocksmith\**" CopyToOutputDirectory="PreserveNewest" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj"> | ||
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\..\common\version\version.vcxproj"> | ||
<Project>{cc6e41ac-8174-4e8a-8d22-85dd7f4851df}</Project> | ||
</ProjectReference> | ||
<ProjectReference Include="..\FileLocksmithLib\FileLocksmithLib.vcxproj"> | ||
<Project>{9d52fd25-ef90-4f9a-a015-91efc5daf54f}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="FileLocksmithContextMenu.base.rc" /> | ||
</ItemGroup> | ||
<Import Project="..\..\..\..\deps\spdlog.props" /> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
<Import Project="..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" /> | ||
</ImportGroup> | ||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||
<PropertyGroup> | ||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | ||
</PropertyGroup> | ||
<Error Condition="!Exists('..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\Microsoft.Windows.ImplementationLibrary.1.0.231216.1\build\native\Microsoft.Windows.ImplementationLibrary.targets'))" /> | ||
</Target> | ||
</Project> |
46 changes: 46 additions & 0 deletions
46
src/modules/FileLocksmith/FileLocksmithContextMenu/FileLocksmithContextMenu.vcxproj.filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> | ||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions> | ||
</Filter> | ||
<Filter Include="Header Files"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> | ||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="framework.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="pch.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
<ClInclude Include="resource.base.h"> | ||
<Filter>Header Files</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="dllmain.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
<ClCompile Include="pch.cpp"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="Resources.resx"> | ||
<Filter>Resource Files</Filter> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="FileLocksmithContextMenu.base.rc"> | ||
<Filter>Resource Files</Filter> | ||
</ResourceCompile> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.