Skip to content

Commit

Permalink
Merge pull request #180 from end2endzone/feature-issue171 (fixes #171)
Browse files Browse the repository at this point in the history
  • Loading branch information
end2endzone authored Oct 12, 2024
2 parents 2489b88 + 3cd41f7 commit 01afcf7
Show file tree
Hide file tree
Showing 56 changed files with 2,509 additions and 8 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ jobs:
shell: cmd
run: call ci\github\install_libmagic.bat

- name: Install ImageMagick
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\install_imagemagick.bat

- name: Build flat-color-icons ico files
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
run: call ci\github\build_flat-color-icons.bat

- name: Build Shellanything
working-directory: ${{env.GITHUB_WORKSPACE}}
shell: cmd
Expand Down
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/build
/install
/third_parties
/out
.vscode
.vs
Expand All @@ -16,3 +15,10 @@
/src/plugins/sa_plugin_process/build
/scripts/refresh.tmp.bat
/installer
/third_parties/RapidAssist
/third_parties/glog
/third_parties/glog_static_old
/third_parties/googletest
/third_parties/libmagic
/third_parties/tinyxml2
/third_parties/zlib
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "third_parties/flat-color-icons"]
path = third_parties/flat-color-icons
url = https://github.com/icons8/flat-color-icons.git
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Changes for 0.10.0

* ShellAnything has a new high-resolution logo icon!
* Shellanything now features verbose logging mode and command line arguments debugging tools.
* ShellAnything now packages icons from [icons8/flat-color-icons](https://github.com/icons8/flat-color-icons)

* Fixed issue #6 : (twice) Right-click on a directory with Windows Explorer in the left panel shows the menus twice.
* Fixed issue #31 : (twice) Error in logs for CContextMenu::GetCommandString()
* Fixed issue #109: Implement default and verbose logging.
Expand All @@ -13,6 +16,7 @@ Changes for 0.10.0
* Fixed issue #161: Create tools to help quickly find a system icon when creating a menu.
* Fixed issue #164: Fails to identify icon for HTML files.
* Fixed issue #167: Improve the quality and accuracy of icon's fileextension attribute resolution (Icon::ResolveFileExtensionIcon()).
* Fixed issue #171: New logo icon.
* Fixed issue #177: Execute a console program without showing a window.
* Fixed issue #178: Exec action should expose the created process id.

Expand Down
3 changes: 2 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This manual includes a description of the steps that are required in order to bu

### Compiled binary packages ###

You can find the latest pre-compiled binaries on the [github project release page](https://github.com/end2endzone/ShellAnything/releases/latest).
You can find the latest pre-compiled binaries on the [github project release page](https://github.com/end2endzone/ShellAnything/releases/latest).
The binary installer of previous versions are also available [here](https://github.com/end2endzone/ShellAnything/releases).

You can also checkout the [latest builds / nightly builds](https://ci.appveyor.com/project/end2endzone/shellanything) available on AppVeyor which offers CI/CD services for Windows. Successful builds are identified by a vertical green line. Select the *current build* or one [from the history](https://ci.appveyor.com/project/end2endzone/shellanything/history). Click on the `Platform: x64` , then look in the `Artifacts` tab. In the *Actifacts* section, you will find two installers, one is a traditional "setup.exe" and the other is a more modern MSI. A portable version is also available.
Expand Down Expand Up @@ -116,6 +116,7 @@ The following software must be installed on the system for compiling source code
* [zlib v1.2.11](https://github.com/madler/zlib/releases/tag/v1.2.11)
* [CMake v3.4.3](http://www.cmake.org/) (tested up to 3.29.7)
* [imneme/pcg-cpp](https://github.com/imneme/pcg-cpp/tree/428802d1a5634f96bcd0705fab379ff0113bcf13) (or newer)
* [icons8/flat-color-icons 8eccbbb](https://github.com/icons8/flat-color-icons/tree/8eccbbbd8b2af1d2c9593e7cfba5ecb0d68ee378) (available as a submodule)
* (optional) [Grip (GitHub Readme Instant Preview)](https://github.com/joeyespo/grip) v4.5.2 (or newer)


Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ before_build:
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_grip.bat
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_zlib.bat
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_libmagic.bat
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_imagemagick.bat

build_script:
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\build_flat-color-icons.bat
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_shellanything.bat
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_sa_plugin_process.bat
- cmd: call %APPVEYOR_BUILD_FOLDER%\ci\appveyor\install_sa_plugin_services.bat
Expand Down
11 changes: 11 additions & 0 deletions ci/appveyor/build_flat-color-icons.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

:: Validate appveyor's environment
if "%APPVEYOR_BUILD_FOLDER%"=="" (
echo Please define 'APPVEYOR_BUILD_FOLDER' environment variable.
exit /B 1
)

:: Call matching script for windows
call "%APPVEYOR_BUILD_FOLDER%\ci\windows\%~n0.bat"
if %errorlevel% neq 0 exit /b %errorlevel%
11 changes: 11 additions & 0 deletions ci/appveyor/install_imagemagick.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

:: Validate appveyor's environment
if "%APPVEYOR_BUILD_FOLDER%"=="" (
echo Please define 'APPVEYOR_BUILD_FOLDER' environment variable.
exit /B 1
)

:: Call matching script for windows
call "%APPVEYOR_BUILD_FOLDER%\ci\windows\%~n0.bat"
if %errorlevel% neq 0 exit /b %errorlevel%
11 changes: 11 additions & 0 deletions ci/github/build_flat-color-icons.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

:: Validate GitHub CI's environment
if "%GITHUB_WORKSPACE%"=="" (
echo Please define 'GITHUB_WORKSPACE' environment variable.
exit /B 1
)

:: Call matching script for windows
call "%GITHUB_WORKSPACE%\ci\windows\%~n0.bat"
if %errorlevel% neq 0 exit /b %errorlevel%
11 changes: 11 additions & 0 deletions ci/github/install_imagemagick.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@echo off

:: Validate GitHub CI's environment
if "%GITHUB_WORKSPACE%"=="" (
echo Please define 'GITHUB_WORKSPACE' environment variable.
exit /B 1
)

:: Call matching script for windows
call "%GITHUB_WORKSPACE%\ci\windows\%~n0.bat"
if %errorlevel% neq 0 exit /b %errorlevel%
4 changes: 4 additions & 0 deletions ci/windows/build_all_debug.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ call %PRODUCT_SOURCE_DIR%\ci\windows\install_zlib.bat
if %errorlevel% neq 0 exit /b %errorlevel%
call %PRODUCT_SOURCE_DIR%\ci\windows\install_libmagic.bat
if %errorlevel% neq 0 exit /b %errorlevel%
call %PRODUCT_SOURCE_DIR%\ci\windows\install_imagemagick.bat
if %errorlevel% neq 0 exit /b %errorlevel%

call %PRODUCT_SOURCE_DIR%\ci\windows\build_flat-color-icons.bat
if %errorlevel% neq 0 exit /b %errorlevel%
call %PRODUCT_SOURCE_DIR%\ci\windows\install_shellanything.bat
if %errorlevel% neq 0 exit /b %errorlevel%

Expand Down
4 changes: 4 additions & 0 deletions ci/windows/build_all_release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ call %PRODUCT_SOURCE_DIR%\ci\windows\install_zlib.bat
if %errorlevel% neq 0 exit /b %errorlevel%
call %PRODUCT_SOURCE_DIR%\ci\windows\install_libmagic.bat
if %errorlevel% neq 0 exit /b %errorlevel%
call %PRODUCT_SOURCE_DIR%\ci\windows\install_imagemagick.bat
if %errorlevel% neq 0 exit /b %errorlevel%

call %PRODUCT_SOURCE_DIR%\ci\windows\build_flat-color-icons.bat
if %errorlevel% neq 0 exit /b %errorlevel%
call %PRODUCT_SOURCE_DIR%\ci\windows\install_shellanything.bat
if %errorlevel% neq 0 exit /b %errorlevel%

Expand Down
73 changes: 73 additions & 0 deletions ci/windows/build_flat-color-icons.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@echo off

:: Assume that ImageMagick already installed by installation script.
set PATH=%TEMP%\imagemagick;%PATH%

echo Searching for imagemagick executables in PATH...
where magick.exe
if errorlevel 1 (
echo File 'magick.exe' not found. Please install imagemagick on system and add the directory to PATH.
exit /B %errorlevel%
)
echo Found imagemagick directory.
echo.

set TEMP_DIR=%TEMP%\flat-color-icons
set IMAGE_INPUT_DIR=%~dp0..\..\third_parties\flat-color-icons\svg
set IMAGE_OUTPUT_DIR=%~dp0..\..\build\third_parties\flat-color-icons

:: Create output directory
mkdir "%IMAGE_OUTPUT_DIR%" 1>NUL 2>NUL
mkdir "%TEMP_DIR%" 1>NUL 2>NUL

:: For each svg icons
echo Converting flat-color-icons svg files to ico format.
echo Searching directory: "%IMAGE_INPUT_DIR%".
setlocal EnableDelayedExpansion
for /f %%f in ('dir /b "%IMAGE_INPUT_DIR%"') do (
REM echo %%f
call :process_file "%%f"
if !errorlevel! neq 0 echo Failed to process file "%%f". ERRORLEVEL=!errorlevel! && exit /b !errorlevel!
)
endlocal
echo done.
echo.

echo All flat-color-icons icons converted to ico format.
echo Output directory: "%IMAGE_OUTPUT_DIR%".
echo.
goto :eof




:process_file
@echo off

:: echo FILENAME IS %~1
:: echo INPUT_FILE_PATH IS %IMAGE_INPUT_DIR%\%~1
:: echo OUTPUT_FILE_PATH IS %IMAGE_OUTPUT_DIR%\%~n1-32.png

echo Processing file: %~1
magick -size 16x16 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-16.png"
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
magick -size 32x32 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-32.png"
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
magick -size 48x48 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-48.png"
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%
magick -size 64x64 -background none "%IMAGE_INPUT_DIR%\%~1" "%TEMP_DIR%\%~n1-64.png"
if %errorlevel% neq 0 echo Failure to convert svg file to png. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%

set png_files=
set png_files=%png_files% "%TEMP_DIR%\%~n1-16.png"
set png_files=%png_files% "%TEMP_DIR%\%~n1-32.png"
set png_files=%png_files% "%TEMP_DIR%\%~n1-48.png"
set png_files=%png_files% "%TEMP_DIR%\%~n1-64.png"

magick %png_files% "%IMAGE_OUTPUT_DIR%\%~n1.ico"
if %errorlevel% neq 0 echo Failure to convert png files to ico. ERRORLEVEL=%errorlevel% && exit /b %errorlevel%

goto :eof


:EOF
73 changes: 73 additions & 0 deletions ci/windows/install_imagemagick.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
@echo off

:: Install ImageMagik.
:: https://github.com/ImageMagick/ImageMagick
:: https://imagemagick.org/script/download.php#windows

echo Installing ImageMagick...
set IMAGEMAGICK_URL=https://imagemagick.org/script/download.php
set IMAGEMAGICK_FILE=%TEMP%\imagemagick.zip
set IMAGEMAGICK_INSTALL_DIR=%TEMP%\imagemagick
set IMAGEMAGICK_TEMP_FILE=%TEMP%\imagemagick.temp.txt

echo Searching for a ImageMagick download link from %IMAGEMAGICK_URL%.
powershell -command "(Invoke-WebRequest -Uri $Env:IMAGEMAGICK_URL).links.href | where {$_ -match '-portable-Q16-x64.zip'}">"%IMAGEMAGICK_TEMP_FILE%"
if errorlevel 1 (
echo Command failed. Unable to check for ImageMagick latest portable version binaries.
exit /B %errorlevel%
)
set /p IMAGEMAGICK_URL=<"%IMAGEMAGICK_TEMP_FILE%"
echo Found download url: %IMAGEMAGICK_URL%
if [%IMAGEMAGICK_URL%] == [] exit /B 1
echo.

:: Check that 7zip is installed
echo Searching for 7zip executable...
set PATH=C:\Program Files\7-Zip;%PATH%
where 7z.exe 1>NUL 2>NUL
if errorlevel 1 (
echo Error: 7zip not installed on system.
exit /B %errorlevel%
)
echo 7zip found.
echo.

:: Download installer
echo Downloading %IMAGEMAGICK_URL%...
python -c "import urllib.request; import os; urllib.request.urlretrieve(os.getenv('IMAGEMAGICK_URL'),os.getenv('IMAGEMAGICK_FILE'));"
if errorlevel 1 (
echo Command failed. Unable to download ImageMagick binaries.
exit /B %errorlevel%
)
if NOT EXIST "%IMAGEMAGICK_FILE%" (
echo Download failed. The file '%IMAGEMAGICK_FILE%' is not found.
exit /B %errorlevel%
)
echo done.
echo.

:: Extracting
mkdir %TEMP%\imagemagick 1>NUL 2>NUL
echo Extracting content to installation directory...
REM WARNING. THE FOLLOWING COMMAND EXACT ALL FILES IN THE ARCHIVE TO THE SAME LOCATION DISREGARDING INTERNAL DIRECTORY STRUCTURE!!
7z e %IMAGEMAGICK_FILE% -o%IMAGEMAGICK_INSTALL_DIR% -aoa
if errorlevel 1 (
echo Failed to decompress ImageMagick binary installer.
exit /B %errorlevel%
)
echo done.
echo.

:: Searching for imagemagick executable
echo Searching for imagemagick executable...
set PATH=%IMAGEMAGICK_INSTALL_DIR%;%PATH%
where magick.exe 1>NUL 2>NUL
if errorlevel 1 (
echo Error: ImageMagick not installed on system.
exit /B %errorlevel%
)
echo ImageMagick found.
echo.

echo ImageMagick was installed on the system without error.
echo.
16 changes: 16 additions & 0 deletions licenses/Flat Color Icons LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Good Boy License

To be used with whatever your mom would approve of :

Permitted Use:
- Download
- Change
- Fork on GitHub

Prohibited Use:
- No tattoos
- No touching food with unwashed hands
- No exchanging for drugs

License: https://icons8.com/good-boy-license
Sources: https://github.com/icons8/flat-color-icons
Binary file added resources/icons/0.2.0-16x16-legacy.ico
Binary file not shown.
File renamed without changes.
46 changes: 46 additions & 0 deletions resources/icons/0.2.0.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
@echo off

:: Assume that ImageMagick already installed by installation script.
set PATH=%TEMP%\imagemagick;%PATH%

echo Searching for imagemagik executables in PATH...
where magick.exe
if errorlevel 1 (
echo File 'magick.exe' not found. Please install imagemagik on system and add the directory to PATH.
exit /B %errorlevel%
)
echo Found imagemagik directory.
echo.

call :process_file "0.2.0.svg"
pause
goto :eof


:process_file
echo Generate pngs...
magick -background none -size 16x16 "%~1" "%~dpn1-16.png"
magick -background none -size 32x32 "%~1" "%~dpn1-32.png"
magick -background none -size 48x48 "%~1" "%~dpn1-48.png"
magick -background none -size 64x64 "%~1" "%~dpn1-64.png"

echo Override generated 16x16 icon with the legacy 16x16 icon.
magick -background none "0.2.0-16x16-legacy.ico" "%~dpn1-16.png"

echo Generate ico...
set png_files=
set png_files=%png_files% "%~dpn1-16.png"
set png_files=%png_files% "%~dpn1-32.png"
set png_files=%png_files% "%~dpn1-48.png"
set png_files=%png_files% "%~dpn1-64.png"
magick %png_files% "%~dpn1.ico"

echo Generated "%~dpn1.ico".
echo.

echo Deleting png (intermediate files).
del %png_files%

goto :eof

:eof
Binary file modified resources/icons/0.2.0.ico
Binary file not shown.
Loading

0 comments on commit 01afcf7

Please sign in to comment.