116 lines
4.4 KiB
Batchfile
116 lines
4.4 KiB
Batchfile
|
|
@echo off
|
||
|
|
setlocal
|
||
|
|
|
||
|
|
title Quick XMake �Ҽ��˵���װ
|
||
|
|
echo =========================================
|
||
|
|
echo Quick XMake - �Ҽ��˵���װ����
|
||
|
|
echo =========================================
|
||
|
|
echo.
|
||
|
|
|
||
|
|
REM ��ȡ��ǰĿ¼
|
||
|
|
for %%I in ("%~dp0.") do set "TOOLDIR=%%~fI"
|
||
|
|
set "DLLPATH=%TOOLDIR%\quick-xmake.dll"
|
||
|
|
|
||
|
|
REM ���� DLL �ļ��Ƿ�����
|
||
|
|
if not exist "%DLLPATH%" (
|
||
|
|
echo ����: quick-xmake.dll δ�ҵ�
|
||
|
|
echo �뽫���������ļ��� quick-xmake.dll ����ͬһĿ¼
|
||
|
|
echo.
|
||
|
|
pause
|
||
|
|
exit /b 1
|
||
|
|
)
|
||
|
|
|
||
|
|
echo ���ڰ�װ�Ҽ��˵�...
|
||
|
|
echo.
|
||
|
|
|
||
|
|
REM �����ɵ�ע������
|
||
|
|
echo �����ɵ�ע������...
|
||
|
|
reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake" /f 2>nul
|
||
|
|
|
||
|
|
REM ����һ���˵�
|
||
|
|
echo ����һ���˵�...
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake" /ve /d "" /f
|
||
|
|
if %errorlevel% neq 0 (
|
||
|
|
echo ����: ����һ���˵�ʧ��
|
||
|
|
goto :error
|
||
|
|
)
|
||
|
|
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake" /v "MUIVerb" /d "quick-xmake" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake" /v "Icon" /d "%%SystemRoot%%\System32\shell32.dll,50" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake" /v "SubCommands" /d "" /f
|
||
|
|
|
||
|
|
REM ���������˵���
|
||
|
|
echo ���������˵���...
|
||
|
|
|
||
|
|
REM �����˵���Create
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\create" /ve /d "" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\create" /v "MUIVerb" /d "Create" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\create\command" /ve /d "rundll32.exe \"%DLLPATH%\",ContextMenuHandler \"%%V\" 0" /f
|
||
|
|
|
||
|
|
REM �����˵���Build
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\build" /ve /d "" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\build" /v "MUIVerb" /d "Build" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\build\command" /ve /d "rundll32.exe \"%DLLPATH%\",ContextMenuHandler \"%%V\" 1" /f
|
||
|
|
|
||
|
|
REM �����˵���Set debug mode
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\set-debug" /ve /d "" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\set-debug" /v "MUIVerb" /d "Set debug mode" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\set-debug\command" /ve /d "rundll32.exe \"%DLLPATH%\",ContextMenuHandler \"%%V\" 2" /f
|
||
|
|
|
||
|
|
REM �����˵���Set release mode
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\set-release" /ve /d "" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\set-release" /v "MUIVerb" /d "Set release mode" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\set-release\command" /ve /d "rundll32.exe \"%DLLPATH%\",ContextMenuHandler \"%%V\" 3" /f
|
||
|
|
|
||
|
|
REM �����˵���Run
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\run" /ve /d "" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\run" /v "MUIVerb" /d "Run" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\run\command" /ve /d "rundll32.exe \"%DLLPATH%\",ContextMenuHandler \"%%V\" 4" /f
|
||
|
|
|
||
|
|
REM �����˵���Template
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\template" /ve /d "" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\template" /v "MUIVerb" /d "Template" /f
|
||
|
|
reg add "HKEY_CLASSES_ROOT\Directory\Background\shell\quick-xmake\shell\template\command" /ve /d "rundll32.exe \"%DLLPATH%\",ContextMenuHandler \"%%V\" 5" /f
|
||
|
|
|
||
|
|
echo.
|
||
|
|
echo =========================================
|
||
|
|
echo ��װ�ɹ���
|
||
|
|
echo =========================================
|
||
|
|
echo.
|
||
|
|
echo �˵��ṹ��
|
||
|
|
echo ���ļ��пհ״��Ҽ� =�� quick-xmake =��
|
||
|
|
echo ������ Create
|
||
|
|
echo ������ Build
|
||
|
|
echo ������ Set debug mode
|
||
|
|
echo ������ Set release mode
|
||
|
|
echo ������ Run
|
||
|
|
echo.
|
||
|
|
echo ע�����
|
||
|
|
echo 1. ���ű����Զ��Թ���ԱȨ������
|
||
|
|
echo 2. �²˵���Ҫ���´�����Դ������������ʾ
|
||
|
|
echo 3. ��Ҫ������Դ����������
|
||
|
|
echo.
|
||
|
|
choice /c YN /n /m "������Դ������ (Y/N): "
|
||
|
|
if %errorlevel% equ 1 (
|
||
|
|
echo ����������Դ������...
|
||
|
|
taskkill /f /im explorer.exe >nul 2>&1
|
||
|
|
start explorer.exe
|
||
|
|
echo ��Դ������������
|
||
|
|
) else (
|
||
|
|
echo ������ѡ���Ժ��ֶ�������Դ������
|
||
|
|
echo �����´����ļ��в鿴�²˵�
|
||
|
|
)
|
||
|
|
echo.
|
||
|
|
pause
|
||
|
|
exit /b 0
|
||
|
|
|
||
|
|
:error
|
||
|
|
echo.
|
||
|
|
echo ��װ�����г��ִ����������飺
|
||
|
|
echo 1. �Ƿ��Թ���Ա��������
|
||
|
|
echo 2. ע����Ȩ���Ƿ�����
|
||
|
|
echo 3. �ļ�·���Ƿ����������ַ�
|
||
|
|
echo 4. DLL�ļ��Ƿ�����������ռ��
|
||
|
|
echo.
|
||
|
|
pause
|
||
|
|
exit /b 1
|