forked from lennartb-/AssemblyInformation
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinstall.cmd
More file actions
38 lines (30 loc) · 1.43 KB
/
install.cmd
File metadata and controls
38 lines (30 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@echo off
:: Install .NET Assembly Information shell extension
:: Must be run as Administrator
net session >nul 2>&1
if %errorlevel% neq 0 (
echo This script must be run as Administrator.
echo Right-click and select "Run as administrator".
pause
exit /b 1
)
set "INSTALL_DIR=%ProgramFiles%\AssemblyInformation"
echo Installing .NET Assembly Information to %INSTALL_DIR% ...
:: Create install directory
if not exist "%INSTALL_DIR%" mkdir "%INSTALL_DIR%"
:: Copy files
copy /y "%~dp0AssemblyInformation.exe" "%INSTALL_DIR%\" >nul
:: Register context menu for .dll files
reg add "HKCR\dllfile\shell\AssemblyInformation" /ve /d "Assembly Information" /f >nul
reg add "HKCR\dllfile\shell\AssemblyInformation" /v "Icon" /d "\"%INSTALL_DIR%\AssemblyInformation.exe\"" /f >nul
reg add "HKCR\dllfile\shell\AssemblyInformation\command" /ve /d "\"%INSTALL_DIR%\AssemblyInformation.exe\" \"%%1\"" /f >nul
:: Register context menu for .exe files
reg add "HKCR\exefile\shell\AssemblyInformation" /ve /d "Assembly Information" /f >nul
reg add "HKCR\exefile\shell\AssemblyInformation" /v "Icon" /d "\"%INSTALL_DIR%\AssemblyInformation.exe\"" /f >nul
reg add "HKCR\exefile\shell\AssemblyInformation\command" /ve /d "\"%INSTALL_DIR%\AssemblyInformation.exe\" \"%%1\"" /f >nul
echo.
echo Installation complete.
echo Right-click any .dll or .exe in Explorer to see "Assembly Information".
echo.
echo To uninstall, run uninstall.cmd as Administrator.
pause