diff --git a/install.bat b/install.bat index 1cd033a..4773e31 100644 --- a/install.bat +++ b/install.bat @@ -2,26 +2,34 @@ chcp 65001 >nul title Raskidator-3000 — Install context menu +:: Определяем абсолютный путь к папке где лежит install.bat +:: (там же лежат raskidator.bat и organize.py) +set "BAT_DIR=%~dp0" +set "BAT_DIR=%BAT_DIR:~0,-1%" + echo ======================================== echo Install context menu echo Raskidator-3000 echo ======================================== echo. -echo Script path: %~dp0raskidator.bat +echo Repo path: %BAT_DIR% echo. +set "BAT_PATH=%BAT_DIR%\raskidator.bat" +set "ICON=%BAT_DIR%\raskidator.bat,0" + :: Directory\Background\shell - right-click in empty folder space echo [1/3] Adding to folder background context menu... :: Обычный запуск reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000" /ve /t REG_SZ /d "Raskidator-3000" /f -reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000" /v Icon /t REG_SZ /d "%~dp0raskidator.bat,0" /f -reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000\command" /ve /t REG_SZ /d "\"%~dp0raskidator.bat\" \"%%V\"" /f +reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000" /v Icon /t REG_SZ /d "%ICON%" /f +reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000\command" /ve /t REG_SZ /d "\"%BAT_PATH%\" \"%%V\"" /f :: Пробный запуск (dry-run) reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000DryRun" /ve /t REG_SZ /d "Raskidator-3000 (dry-run)" /f -reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000DryRun" /v Icon /t REG_SZ /d "%~dp0raskidator.bat,0" /f -reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000DryRun\command" /ve /t REG_SZ /d "\"%~dp0raskidator.bat\" --dry-run \"%%V\"" /f +reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000DryRun" /v Icon /t REG_SZ /d "%ICON%" /f +reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\Raskidator3000DryRun\command" /ve /t REG_SZ /d "\"%BAT_PATH%\" --dry-run \"%%V\"" /f echo [+] Directory\Background - done (2 entries) echo. @@ -30,12 +38,12 @@ echo. echo [2/3] Adding to folder right-click menu... reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000" /ve /t REG_SZ /d "Raskidator-3000" /f -reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000" /v Icon /t REG_SZ /d "%~dp0raskidator.bat,0" /f -reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000\command" /ve /t REG_SZ /d "\"%~dp0raskidator.bat\" \"%%1\"" /f +reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000" /v Icon /t REG_SZ /d "%ICON%" /f +reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000\command" /ve /t REG_SZ /d "\"%BAT_PATH%\" \"%%1\"" /f reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000DryRun" /ve /t REG_SZ /d "Raskidator-3000 (dry-run)" /f -reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000DryRun" /v Icon /t REG_SZ /d "%~dp0raskidator.bat,0" /f -reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000DryRun\command" /ve /t REG_SZ /d "\"%~dp0raskidator.bat\" --dry-run \"%%1\"" /f +reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000DryRun" /v Icon /t REG_SZ /d "%ICON%" /f +reg add "HKEY_CLASSES_ROOT\Directory\shell\Raskidator3000DryRun\command" /ve /t REG_SZ /d "\"%BAT_PATH%\" --dry-run \"%%1\"" /f echo [+] Directory\shell - done (2 entries) echo. @@ -44,12 +52,12 @@ echo. echo [3/3] Adding to libraries (Pictures, Music, Videos)... reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000" /ve /t REG_SZ /d "Raskidator-3000" /f -reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000" /v Icon /t REG_SZ /d "%~dp0raskidator.bat,0" /f -reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000\command" /ve /t REG_SZ /d "\"%~dp0raskidator.bat\" \"%%V\"" /f +reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000" /v Icon /t REG_SZ /d "%ICON%" /f +reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000\command" /ve /t REG_SZ /d "\"%BAT_PATH%\" \"%%V\"" /f reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000DryRun" /ve /t REG_SZ /d "Raskidator-3000 (dry-run)" /f -reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000DryRun" /v Icon /t REG_SZ /d "%~dp0raskidator.bat,0" /f -reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000DryRun\command" /ve /t REG_SZ /d "\"%~dp0raskidator.bat\" --dry-run \"%%V\"" /f +reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000DryRun" /v Icon /t REG_SZ /d "%ICON%" /f +reg add "HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Raskidator3000DryRun\command" /ve /t REG_SZ /d "\"%BAT_PATH%\" --dry-run \"%%V\"" /f echo [+] LibraryFolder\Background - done (2 entries) echo.