Compare commits

..
14 Commits
Author SHA1 Message Date
ge0rdiandGitHub c9e791fc79 Update README with code signing section 2026-07-24 19:42:41 +02:00
ge0rdi fe6b144058 Delete temporary artefacts during official build
They are needed only for signing.
2026-07-19 12:10:03 +02:00
ge0rdi 97bae48048 Use VS2022 toolset (due to Win7 support)
VS2022 is the last VS that does support Windows 7.
It seems we have some Win7 users, so for now we will use this toolset
to make sure binaries are compatible with Win7.
2026-07-19 11:09:29 +02:00
ge0rdi 9a274c1297 Revert "Use VS2026"
This reverts commit 8502d4bd7b.

VS2026 dropped support for Windows 7. Most of binaries produced by
VS2026 don't work on Win7 because the use API that doesn't exist on
Win7.
2026-07-19 10:59:58 +02:00
ge0rdi 462a8709b2 Fix "properties" command
It seems that "Properties" context menu command is handled directly by
shell and it requires to be invoked on the same thread that created
actual context menu object.

So we will distinguish this case and invoke command directly. For the
rest we will use separate thread to not block main UI thread.

Fixes #2502
2026-07-18 21:42:49 +02:00
ge0rdi 95bbb17faf Allow automatic restart sign-on (ARSO) 2026-07-17 19:19:10 +02:00
ge0rdi 37fdea7964 Use C++20 by default 2026-07-17 16:37:56 +02:00
ge0rdi 8502d4bd7b Use VS2026 2026-07-17 16:37:24 +02:00
ge0rdi 8713a69200 Sign with SignPath
Fixes #1732
2026-07-15 14:25:37 +02:00
ge0rdi b264f96525 Split build steps into binaries, installers, archives 2026-07-15 14:25:37 +02:00
ge0rdi 07ead0baf8 Utility: Fix clash with windows API 2026-07-15 14:25:36 +02:00
ge0rdi 566bb81c7e Fix "Explore" getting stuck after Windows 11 update 2026-07-15 14:14:10 +02:00
ge0rdi 4fd5545485 Fix "Open file location" getting stuck after Windows 11 update
We will run InvokeCommand API on separate STA thread and pump messages while waiting for them to finish.

Fixes #2303
Fixes #2321
Fixes #2375
2026-07-15 14:14:10 +02:00
ge0rdiandGitHub 86e8a24b16 [ExplorerPatcher] Improved EP taskbar detection (#2493)
EP changed their `ep_taskbar*.dll` naming scheme.
We will look for module whose name starts with `ep_taskbar` which
should be compatible with both old and new naming.

Fixes #2474
2026-07-15 14:12:25 +02:00
37 changed files with 218 additions and 58 deletions
+73 -18
View File
@@ -60,6 +60,7 @@ jobs:
run: Src\Setup\BuildBinaries.bat
- name: Upload binaries
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
id: upload-binaries
uses: actions/upload-artifact@v7
with:
@@ -69,14 +70,16 @@ jobs:
!Src/Setup/Output/*.skin
!Src/Setup/Output/*.skin7
!Src/Setup/Output/*.zip
retention-days: 1
- name: Sign binaries with SignPath
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'b34b60e3-e5bf-4a6e-a13c-dcf641b4362c'
project-slug: 'Open-Shell-Menu'
signing-policy-slug: 'test-signing'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'Binaries'
github-artifact-id: '${{ steps.upload-binaries.outputs.artifact-id }}'
wait-for-completion: true
@@ -89,59 +92,89 @@ jobs:
run: Src\Setup\_BuildEnglish.bat
- name: Upload installers
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
id: upload-installers
uses: actions/upload-artifact@v7
with:
name: MSI
path: |
Src/Setup/Temp/*.msi
retention-days: 1
- name: Sign installers with SignPath
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'b34b60e3-e5bf-4a6e-a13c-dcf641b4362c'
project-slug: 'Open-Shell-Menu'
signing-policy-slug: 'test-signing'
signing-policy-slug: 'release-signing'
artifact-configuration-slug: 'Installers'
github-artifact-id: '${{ steps.upload-installers.outputs.artifact-id }}'
wait-for-completion: true
output-artifact-directory: 'Src/Setup/Temp/'
- name: Build final
- name: Build setup and symbols
shell: cmd
env:
CS_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }}
run: Src\Setup\BuildArchives.bat
- name: Upload final
id: upload-final
- name: Upload symbols
uses: actions/upload-artifact@v7
with:
name: Final
path: |
Src/Setup/Final/
!Src/Setup/Final/OpenShellLoc.zip
Src/Setup/Final/OpenShellSymbols*.7z
archive: false
- name: Sign final artifacts with SignPath
- name: Upload utility
uses: actions/upload-artifact@v7
with:
path: |
Src/Setup/Final/Utility.exe
archive: false
- name: Upload setup
id: upload-setup
uses: actions/upload-artifact@v7
with:
path: |
Src/Setup/Final/OpenShellSetup*.exe
archive: false
- name: Sign setup with SignPath
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: '${{ secrets.SIGNPATH_API_TOKEN }}'
organization-id: 'b34b60e3-e5bf-4a6e-a13c-dcf641b4362c'
project-slug: 'Open-Shell-Menu'
signing-policy-slug: 'test-signing'
artifact-configuration-slug: 'Final'
github-artifact-id: '${{ steps.upload-final.outputs.artifact-id }}'
signing-policy-slug: 'release-signing'
github-artifact-id: '${{ steps.upload-setup.outputs.artifact-id }}'
wait-for-completion: true
skip-decompress: true
output-artifact-directory: 'Src/Setup/Final/'
- name: Upload final (signed)
# `overwrite: true` doesn't work with `archive: false`, so we have to delete the original first
# https://github.com/actions/upload-artifact/issues/769
# https://github.com/actions/upload-artifact/issues/785
- name: Delete temporary artifacts
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: geekyeggo/delete-artifact@v6
with:
name: |
OpenShellSetup*.exe
Binaries
MSI
- name: Upload setup (signed)
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
uses: actions/upload-artifact@v7
with:
name: Final-signed
path: |
Src/Setup/Final/
!Src/Setup/Final/OpenShellLoc.zip
Src/Setup/Final/OpenShellSetup*.exe
archive: false
overwrite: true
release:
if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/master' # Only manual master builds
@@ -150,7 +183,29 @@ jobs:
permissions:
contents: write # Elevate permissions ONLY for this job
steps:
- name: Download artifacts
- name: Download setup
uses: actions/download-artifact@v8
with:
name: OpenShell
pattern: OpenShellSetup*.exe
- name: Download symbols
uses: actions/download-artifact@v8
with:
pattern: OpenShellSymbols*.7z
- name: Download utility
uses: actions/download-artifact@v8
with:
pattern: Utility.exe
- name: Create GitHub Release
uses: softprops/action-gh-release@v3
with:
tag_name: v${{ needs.build.outputs.new_version }}
name: ${{ needs.build.outputs.new_version }}
generate_release_notes: true
prerelease: true
files: |
OpenShellSetup*.exe
OpenShellSymbols_*.7z
Utility.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+3
View File
@@ -29,6 +29,9 @@ You can find the latest stable version here:
>
> If you install older one on a Windows for ARM installation (ex. using Parallels Desktop on an Apple Silicon Mac), you will no longer be able to log into your account the next time you reboot. Please refrain from installing Open-Shell on Windows for ARM.
### Code signing
Free code signing provided by [SignPath.io](https://about.signpath.io/), certificate by [SignPath Foundation](https://signpath.org/)
### Temporary Translation/Language Solution
1. Download [language DLL](https://coddec.github.io/Classic-Shell/www.classicshell.net/translations/index.html)
2. Place it either in the Open-Shell's __install folder__ or in the `%ALLUSERSPROFILE%\OpenShell\Languages` folder
+1 -1
View File
@@ -59,7 +59,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -23,7 +23,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+1 -1
View File
@@ -47,7 +47,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -59,7 +59,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+1 -1
View File
@@ -34,7 +34,7 @@
<WarningLevel>Level3</WarningLevel>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<ConformanceMode>true</ConformanceMode>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard>stdcpp20</LanguageStandard>
</ClCompile>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
+1 -1
View File
@@ -43,7 +43,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+2 -2
View File
@@ -160,10 +160,10 @@ cd ..
cd Setup
copy /B ..\..\build\bin\Release\Utility.exe .\Final > nul
copy /B Output\Utility.exe .\Final > nul
if defined APPVEYOR (
appveyor PushArtifact ..\..\build\bin\Release\Utility.exe
appveyor PushArtifact Output\Utility.exe
)
exit /b 0
+1
View File
@@ -55,6 +55,7 @@ copy /B ..\..\build\bin\Setup\StartMenuHelper32.dll Output > nul
copy /B ..\..\build\bin\Release\Update.exe Output > nul
copy /B ..\..\build\bin\Release\DesktopToasts.dll Output > nul
copy /B ..\..\build\bin\Release\SetupHelper.exe Output > nul
copy /B ..\..\build\bin\Release\Utility.exe Output > nul
copy /B ..\..\build\bin\SetupARM64\ClassicExplorer64.dll Output\ARM64 > nul
copy /B ..\..\build\bin\SetupARM64\ClassicIEDLL_64.dll Output\ARM64 > nul
+1 -1
View File
@@ -19,7 +19,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
</PropertyGroup>
+1 -1
View File
@@ -19,7 +19,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
</PropertyGroup>
+1 -1
View File
@@ -35,7 +35,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -15,7 +15,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+1 -1
View File
@@ -47,7 +47,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
+77 -3
View File
@@ -24,6 +24,60 @@
#include <propvarutil.h>
#include <algorithm>
#include <propkey.h>
#include <thread>
// Execute function on a separate STA thread while pumping messages on caller thread.
template <typename TFunc>
static auto ExecuteOnSTAThread(TFunc&& func) -> decltype(func())
{
using ReturnType = decltype(func());
ReturnType result{};
std::thread worker([&func, &result]() mutable {
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
result = func();
CoUninitialize();
});
// Pump messages while waiting for the worker (dialog) to finish
while (true)
{
HANDLE hWorker = worker.native_handle();
if (MsgWaitForMultipleObjects(1, &hWorker, FALSE, INFINITE, QS_ALLINPUT) == WAIT_OBJECT_0)
break;
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
{
PostQuitMessage((int)msg.wParam);
break;
}
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
worker.join();
return result;
}
// Wrapper for IContextMenu::InvokeCommand that runs on separate STA thread and pumps messages
static HRESULT InvokeCommandSafe(IContextMenu* pMenu, LPCMINVOKECOMMANDINFO pInfo)
{
return ExecuteOnSTAThread([&]() {
return pMenu->InvokeCommand(pInfo);
});
}
// Wrapper for SHOpenFolderAndSelectItems that runs on separate STA thread and pumps messages
static HRESULT SHOpenFolderAndSelectItemsSafe(PCIDLIST_ABSOLUTE pidlFolder, UINT cidl, PCUITEMID_CHILD_ARRAY apidl, DWORD dwFlags)
{
return ExecuteOnSTAThread([=]() {
return SHOpenFolderAndSelectItems(pidlFolder, cidl, apidl, dwFlags);
});
}
static CString g_RenameText;
static POINT g_RenamePos;
@@ -935,7 +989,7 @@ static bool ExecuteShutdownCommand(TMenuID menuCommand)
if (!ProceedWithShutdown(flags))
return true;
flags |= SHUTDOWN_FORCE_OTHERS;
flags |= SHUTDOWN_FORCE_OTHERS | SHUTDOWN_ARSO;
if (SetShutdownPrivileges())
{
@@ -1379,6 +1433,19 @@ static HRESULT CreatePinLink( PCIDLIST_ABSOLUTE sourcePidl, const wchar_t *name,
return S_OK;
}
static CString GetContextMenuItemVerb(IContextMenu* pContextMenu, UINT_PTR uId)
{
wchar_t verbW[256] = {};
if (SUCCEEDED(pContextMenu->GetCommandString(uId, GCS_VERBW, nullptr, reinterpret_cast<char*>(verbW), sizeof(verbW))))
return CString(verbW);
char verbA[256] = {};
if (SUCCEEDED(pContextMenu->GetCommandString(uId, GCS_VERBA, nullptr, verbA, sizeof(verbA))))
return CString(verbA);
return {};
}
// This function "activates" an item. The item can be activated in multiple ways:
// ACTIVATE_SELECT - select the item, make sure it is visible
// ACTIVATE_OPEN - if the item is a submenu, it is opened. otherwise the item is just selected (but all submenus are closed first)
@@ -2871,7 +2938,7 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
}
else
{
SHOpenFolderAndSelectItems(pItemPidl1,0,NULL,0);
SHOpenFolderAndSelectItemsSafe(pItemPidl1,0,NULL,0);
}
res=0;
}
@@ -3113,7 +3180,14 @@ void CMenuContainer::ActivateItem( int index, TActivateType type, const POINT *p
}
else
{
HRESULT hr=pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
HRESULT hr{};
auto verb = GetContextMenuItemVerb(pInvokeMenu, (UINT_PTR)info.lpVerbW);
// if the verb is "properties", we need to invoke it directly in this UI thread (as it needs to be called on thread that crated context menu object),
// otherwise we will invoke the command on separate STA thread to make sure it won't block UI thread
if (verb.CompareNoCase(L"properties") == 0)
hr = pInvokeMenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info);
else
hr = InvokeCommandSafe(pInvokeMenu, (LPCMINVOKECOMMANDINFO)&info);
LOG_MENU(LOG_EXECUTE,L"Invoke command, ptr=%p, res=%d",this,hr);
executeSuccess=SUCCEEDED(hr);
}
+31 -4
View File
@@ -22,6 +22,7 @@
#include <dbghelp.h>
#include <set>
#include <Thumbcache.h>
#include <tlhelp32.h>
#define HOOK_DROPTARGET // define this to replace the IDropTarget of the start button
#define START_TOUCH // touch support for the start button
@@ -2936,6 +2937,35 @@ static void OpenCortana( void )
ShellExecute(NULL,NULL,L"shell:::{2559a1f8-21d7-11d4-bdaf-00c04f60b9f0}",NULL,NULL,SW_SHOWNORMAL);
}
HMODULE GetModuleHandleByPrefix(const WCHAR* prefix)
{
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
if (snapshot == INVALID_HANDLE_VALUE)
return nullptr;
size_t prefixLength = wcslen(prefix);
MODULEENTRY32 me{};
me.dwSize = sizeof(me);
HMODULE result = nullptr;
if (Module32First(snapshot, &me))
{
do
{
if (_wcsnicmp(me.szModule, prefix, prefixLength) == 0)
{
result = reinterpret_cast<HMODULE>(me.modBaseAddr);
break;
}
} while (Module32Next(snapshot, &me));
}
CloseHandle(snapshot);
return result;
}
static void InitStartMenuDLL( void )
{
static bool initCalled = false;
@@ -2979,10 +3009,7 @@ static void InitStartMenuDLL( void )
auto module=GetModuleHandle(L"taskbar.dll");
if (!module)
{
module = GetModuleHandle(L"ep_taskbar.5.dll");
if (!module)
module = GetModuleHandle(L"ep_taskbar.2.dll");
module = GetModuleHandleByPrefix(L"ep_taskbar");
if (module)
g_epTaskbar = true;
}
@@ -47,7 +47,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -59,7 +59,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
@@ -20,7 +20,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>
</PropertyGroup>
+1 -1
View File
@@ -19,7 +19,7 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<UseOfAtl>Static</UseOfAtl>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization Condition="'$(Configuration)'!='Debug'">true</WholeProgramOptimization>