Skip to content

Commit

Permalink
added script
Browse files Browse the repository at this point in the history
  • Loading branch information
henrypp committed Jan 22, 2016
1 parent d40ae5c commit 3c85e26
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions bin/SetDefaultBrowser.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
@echo off

set "CHRLAUNCHER_PATH=%~dp0chrlauncher.exe"
set "CHRLAUNCHER_ICON=\"%CHRLAUNCHER_PATH%\",0"
set "CHRLAUNCHER_ARGS=\"%CHRLAUNCHER_PATH%\" /url \"%%1\""

if not exist %CHRLAUNCHER_PATH% (

echo ERROR: "chrlauncher.exe" not found.

) else (

reg add hklm /f>nul 2>&1

if ERRORLEVEL 1 (

echo ERROR: you have no privileges.

) else (

reg add "HKCR\chrlauncherHTML\DefaultIcon" /v "" /t REG_SZ /d "%CHRLAUNCHER_ICON%" /f
reg add "HKCR\chrlauncherHTML\shell\open\command" /v "" /t REG_SZ /d "%CHRLAUNCHER_ARGS%" /f

reg add "HKCR\chrlauncherURL\DefaultIcon" /v "" /t REG_SZ /d "%CHRLAUNCHER_ICON%" /f
reg add "HKCR\chrlauncherURL\shell\open\command" /v "" /t REG_SZ /d "%CHRLAUNCHER_ARGS%" /f

reg add "HKCR\ftp\DefaultIcon" /v "" /t REG_SZ /d "%CHRLAUNCHER_ICON%" /f
reg add "HKCR\ftp\shell\open\command" /v "" /t REG_SZ /d "%CHRLAUNCHER_ARGS%" /f

reg add "HKCR\http\DefaultIcon" /v "" /t REG_SZ /d "%CHRLAUNCHER_ICON%" /f
reg add "HKCR\http\shell\open\command" /v "" /t REG_SZ /d "%CHRLAUNCHER_ARGS%" /f

reg add "HKCR\https\DefaultIcon" /v "" /t REG_SZ /d "%CHRLAUNCHER_ICON%" /f
reg add "HKCR\https\shell\open\command" /v "" /t REG_SZ /d "%CHRLAUNCHER_ARGS%" /f

reg add "HKCR\.htm" /v "" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCR\.html" /v "" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCR\.shtml" /v "" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCR\.xht" /v "" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCR\.xhtml" /v "" /t REG_SZ /d "chrlauncherHTML" /f

reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\ftp\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f

reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\MIMEAssociations\text/html\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.shtml\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xht\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.xhtml\UserChoice" /v "ProgId" /t REG_SZ /d "chrlauncherHTML" /f

)
)

pause

Binary file removed bin/bin.rar
Binary file not shown.

0 comments on commit 3c85e26

Please sign in to comment.