mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-08-09 17:41:11 +10:00
Compare commits
6
Commits
v4.4.197
...
7baba47baf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7baba47baf | ||
|
|
f5fa8f0ea3 | ||
|
|
dfb307b3b7 | ||
|
|
b2070640ff | ||
|
|
7566280973 | ||
|
|
32ad90f17d |
@@ -0,0 +1,94 @@
|
||||
name: Build
|
||||
|
||||
permissions:
|
||||
contents: read # Default to secure
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- 'Src/**'
|
||||
- 'Localization/**'
|
||||
- '.github/workflows/build.yml'
|
||||
|
||||
workflow_dispatch: # allows manual trigger for main/master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
outputs:
|
||||
new_version: ${{ steps.versioning.outputs.NEW_VERSION }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # Essential to see all tags
|
||||
|
||||
- name: Prepare version
|
||||
id: versioning
|
||||
shell: pwsh
|
||||
run: |
|
||||
# Fetch latest tag
|
||||
$latestTag = git describe --tags --abbrev=0 2>$null
|
||||
|
||||
if ($latestTag -notmatch '^v\d+\.\d+\.\d+$') {
|
||||
Write-Error "Error: Could not find a valid vX.Y.Z tag in history. Found: '$latestTag'"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse and Increment
|
||||
$version = [version]$latestTag.Substring(1)
|
||||
$baseVersion = "$($version.Major).$($version.Minor).$($version.Build + 1)"
|
||||
|
||||
# Handle PR Suffix
|
||||
if ("${{ github.event_name }}" -eq "pull_request") {
|
||||
$shortSha = "${{ github.event.pull_request.head.sha }}".Substring(0, 7)
|
||||
$finalVersion = "$baseVersion-pr-$shortSha"
|
||||
} else {
|
||||
$finalVersion = $baseVersion
|
||||
}
|
||||
|
||||
# Export
|
||||
"NEW_VERSION=$finalVersion" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
|
||||
Write-Host "Building version: $finalVersion"
|
||||
|
||||
- name: Build
|
||||
shell: cmd
|
||||
env:
|
||||
APPVEYOR_BUILD_VERSION: ${{ steps.versioning.outputs.NEW_VERSION }}
|
||||
run: Src\Setup\__MakeFinal.bat
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: OpenShell
|
||||
path: |
|
||||
Src/Setup/Final/
|
||||
!Src/Setup/Final/OpenShellLoc.zip
|
||||
|
||||
release:
|
||||
if: github.event_name == 'workflow_dispatch' # Only manual master builds
|
||||
needs: build
|
||||
runs-on: ubuntu-latest # Cheaper/faster than windows for just uploading
|
||||
permissions:
|
||||
contents: write # Elevate permissions ONLY for this job
|
||||
steps:
|
||||
- name: Download artifacts
|
||||
uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: OpenShell
|
||||
|
||||
- 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 }}
|
||||
@@ -7,7 +7,7 @@ A collection of utilities bringing back classic features to Windows.
|
||||
|
||||
*Originally* **[Classic Shell](http://www.classicshell.net)** *by [Ivo Beltchev](https://sourceforge.net/u/ibeltchev/profile/)*
|
||||
|
||||
[](https://github.com/Open-Shell/Open-Shell-Menu/releases/latest) [](https://github.com/Open-Shell/Open-Shell-Menu/releases) [](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master) [](https://gitq.com/passionate-coder/Classic-Start) [](https://gitter.im/open-shell/Lobby) [](https://discord.gg/7H6arr5)
|
||||
[](https://github.com/Open-Shell/Open-Shell-Menu/releases/latest) [](https://github.com/Open-Shell/Open-Shell-Menu/releases) [](https://github.com/Open-Shell/Open-Shell-Menu/actions/workflows/build.yml) [](https://ci.appveyor.com/project/passionate-coder/open-shell-menu/branch/master) [](https://gitq.com/passionate-coder/Classic-Start) [](https://gitter.im/open-shell/Lobby) [](https://discord.gg/7H6arr5)
|
||||
|
||||
[Open-Shell Homepage](https://open-shell.github.io/Open-Shell-Menu)
|
||||
|
||||
|
||||
@@ -1670,7 +1670,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
|
||||
ofn.lpstrTitle=title;
|
||||
ofn.lpstrDefExt=L".xml";
|
||||
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_PATHMUSTEXIST|OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
||||
if (GetSaveFileName(&ofn))
|
||||
if (GetSaveFileNameSafe(&ofn))
|
||||
{
|
||||
CString err=g_SettingsManager.SaveSettingsXml(path);
|
||||
if (!err.IsEmpty())
|
||||
@@ -1699,7 +1699,7 @@ LRESULT CSettingsDlg::OnBackup( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL&
|
||||
CString title=LoadStringEx(IDS_XML_TITLE_LOAD);
|
||||
ofn.lpstrTitle=title;
|
||||
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
||||
if (GetOpenFileName(&ofn))
|
||||
if (GetOpenFileNameSafe(&ofn))
|
||||
{
|
||||
SetCurTab(m_Index,true); // reload tab once to force-close any active edit boxes
|
||||
CString error=g_SettingsManager.LoadSettingsXml(path);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <uxtheme.h>
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
#include <thread>
|
||||
|
||||
const KNOWNFOLDERID FOLDERID_DesktopRoot={'DESK', 'TO', 'P', {'D', 'E', 'S', 'K', 'T', 'O', 'P', 0x00}};
|
||||
|
||||
@@ -1193,7 +1194,7 @@ bool BrowseCommandHelper( HWND parent, wchar_t *text )
|
||||
ofn.lpstrFile=text;
|
||||
ofn.nMaxFile=_MAX_PATH;
|
||||
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_NODEREFERENCELINKS;
|
||||
if (GetOpenFileName(&ofn))
|
||||
if (GetOpenFileNameSafe(&ofn))
|
||||
{
|
||||
wchar_t buf[_MAX_PATH];
|
||||
UnExpandEnvStrings(text,buf,_countof(buf));
|
||||
@@ -1216,7 +1217,8 @@ bool BrowseCommandHelper( HWND parent, wchar_t *text )
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
|
||||
// Internal implementation that must be run on an STA thread with COM initialized.
|
||||
static bool BrowseLinkHelperImpl( HWND parent, wchar_t *text, bool bFoldersOnly )
|
||||
{
|
||||
DoEnvironmentSubst(text,_MAX_PATH);
|
||||
|
||||
@@ -1276,6 +1278,41 @@ bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
|
||||
return pResult!=NULL;
|
||||
}
|
||||
|
||||
// Run IFileOpenDialog on a separate STA thread and pump messages on the caller while waiting.
|
||||
bool BrowseLinkHelper( HWND parent, wchar_t *text, bool bFoldersOnly )
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
std::thread worker([&parent, &text, &bFoldersOnly, &result]() mutable {
|
||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
result = BrowseLinkHelperImpl(parent, text, bFoldersOnly);
|
||||
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;
|
||||
}
|
||||
|
||||
bool BrowseIconHelper( HWND parent, wchar_t *text )
|
||||
{
|
||||
int id=0;
|
||||
@@ -2011,7 +2048,7 @@ LRESULT CBrowseForIconDlg::OnBrowse( WORD wNotifyCode, WORD wID, HWND hWndCtl, B
|
||||
CString title=LoadStringEx(IDS_ICON_TITLE);
|
||||
ofn.lpstrTitle=title;
|
||||
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
||||
if (GetOpenFileName(&ofn))
|
||||
if (GetOpenFileNameSafe(&ofn))
|
||||
{
|
||||
wchar_t buf[_MAX_PATH];
|
||||
UnExpandEnvStrings(path,buf,_countof(buf));
|
||||
@@ -2210,7 +2247,7 @@ bool BrowseForBitmap( HWND hWndParent, wchar_t *path, bool bAllowJpeg )
|
||||
CString title=LoadStringEx(IDS_BMP_TITLE);
|
||||
ofn.lpstrTitle=title;
|
||||
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
||||
if (GetOpenFileName(&ofn))
|
||||
if (GetOpenFileNameSafe(&ofn))
|
||||
{
|
||||
wchar_t buf[_MAX_PATH];
|
||||
UnExpandEnvStrings(path,buf,_countof(buf));
|
||||
@@ -2242,7 +2279,7 @@ bool BrowseForSound( HWND hWndParent, wchar_t *path )
|
||||
CString title=LoadStringEx(IDS_WAV_TITLE);
|
||||
ofn.lpstrTitle=title;
|
||||
ofn.Flags=OFN_DONTADDTORECENT|OFN_ENABLESIZING|OFN_EXPLORER|OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_NOCHANGEDIR;
|
||||
if (GetOpenFileName(&ofn))
|
||||
if (GetOpenFileNameSafe(&ofn))
|
||||
{
|
||||
wchar_t buf[_MAX_PATH];
|
||||
UnExpandEnvStrings(path,buf,_countof(buf));
|
||||
@@ -3630,3 +3667,49 @@ DWORD ParseColor(const wchar_t* str)
|
||||
wchar_t* end;
|
||||
return wcstoul(str, &end, 16) & 0xFFFFFF;
|
||||
}
|
||||
|
||||
// Run GetOpenFileName/GetSaveFileName on a separate STA thread and pump messages on the caller
|
||||
template <typename auto Fnc>
|
||||
static BOOL GetFileNameSafe(OPENFILENAME* pOfn)
|
||||
{
|
||||
BOOL result = FALSE;
|
||||
|
||||
std::thread worker([&pOfn, &result]() mutable {
|
||||
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
|
||||
result = Fnc(pOfn);
|
||||
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;
|
||||
}
|
||||
|
||||
BOOL GetOpenFileNameSafe(OPENFILENAME* pOfn)
|
||||
{
|
||||
return GetFileNameSafe<GetOpenFileNameW>(pOfn);
|
||||
}
|
||||
|
||||
BOOL GetSaveFileNameSafe(OPENFILENAME* pOfn)
|
||||
{
|
||||
return GetFileNameSafe<GetSaveFileNameW>(pOfn);
|
||||
}
|
||||
|
||||
@@ -395,3 +395,7 @@ DWORD BgrToRgb(DWORD val);
|
||||
|
||||
// parse color from hexadecimal string
|
||||
DWORD ParseColor(const wchar_t* str);
|
||||
|
||||
// safe versions of GetOpenFileName/GetSaveFileName (run API on a separate STA thread and pump messages on the caller)
|
||||
BOOL GetOpenFileNameSafe(OPENFILENAME* pOfn);
|
||||
BOOL GetSaveFileNameSafe(OPENFILENAME* pOfn);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<String Id="Advanced_Font_Bigger_Size" Overridable="yes">12</String>
|
||||
<String Id="Advanced_Font_Title_Size" Overridable="yes">9</String>
|
||||
<String Id="Advanced_Font_Emphasized_Size" Overridable="yes">8</String>
|
||||
<String Id="Advanced_Font_FaceName" Overridable="yes">"MS UI Gothic", "MS PGothic", "MS Pゴシック", "MS Gothic", "MS ゴシック", Osaka, Tahoma</String>
|
||||
<String Id="Advanced_Font_FaceName" Overridable="yes">"MS UI Gothic", "MS PGothic", "MS Pゴシック", "MS Gothic", "MS ゴシック", Yu Gothic UI, Tahoma</String>
|
||||
|
||||
<String Id="BrowseDlg_Title" Overridable="yes">[ProductName] セットアップ</String>
|
||||
<String Id="BrowseDlgComboLabel" Overridable="yes">場所(&L):</String>
|
||||
|
||||
@@ -20,6 +20,8 @@ cd ..
|
||||
|
||||
cd Setup
|
||||
|
||||
copy /B ..\..\build\bin\Release\Utility.exe .\Final > nul
|
||||
|
||||
if defined APPVEYOR (
|
||||
appveyor PushArtifact ..\..\build\bin\Release\Utility.exe
|
||||
)
|
||||
|
||||
@@ -383,7 +383,7 @@ private:
|
||||
static DWORD CALLBACK StaticRefreshInfoThread( void *param );
|
||||
static DWORD CALLBACK SaveCacheFileThread( void *param );
|
||||
|
||||
// all paths are in caps and end with \
|
||||
// all paths are in caps and end with backslash
|
||||
CString m_RootStartMenu1;
|
||||
CString m_RootStartMenu2;
|
||||
CString m_RootStartMenu3;
|
||||
|
||||
@@ -6366,7 +6366,10 @@ LRESULT CMenuContainer::OnRefresh( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
|
||||
}
|
||||
}
|
||||
else if (m_Items[m_OriginalCount].id==MENU_SEARCH_CATEGORY)
|
||||
hotItem=m_OriginalCount+1;
|
||||
{
|
||||
if (!bSearching || !s_SearchResults.programs.empty())
|
||||
hotItem=m_OriginalCount+1;
|
||||
}
|
||||
}
|
||||
else
|
||||
hotItem=-1;
|
||||
|
||||
@@ -55,8 +55,8 @@ END_COM_MAP()
|
||||
STDMETHODIMP InvokeCommand( CMINVOKECOMMANDINFO *pInfo );
|
||||
STDMETHODIMP GetCommandString( UINT_PTR idCmd, UINT uFlags, UINT* pwReserved, LPSTR pszName, UINT cchMax );
|
||||
|
||||
wchar_t m_PinFolder1[_MAX_PATH]; // ending with \
|
||||
wchar_t m_PinFolder2[_MAX_PATH]; // ending with \
|
||||
wchar_t m_PinFolder1[_MAX_PATH]; // ending with backslash
|
||||
wchar_t m_PinFolder2[_MAX_PATH]; // ending with backslash
|
||||
wchar_t m_FileName[_MAX_PATH];
|
||||
LPITEMIDLIST m_FilePidl;
|
||||
bool m_bInPinFolder1, m_bInPinFolder2;
|
||||
|
||||
Reference in New Issue
Block a user