@echo off
if not exist "%~dp0FirefoxPortable.exe" goto END

reg add "HKCU\Software\Classes\.htm" /ve /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Classes\.html" /ve /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Classes\.shtml" /ve /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Classes\.xht" /ve /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Classes\.xhtml" /ve /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Classes\Applications\firefox.exe\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Classes\Applications\firefox.exe\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
reg add "HKCU\SOFTWARE\Classes\ffpbrowser" /v "URL Protocol" /t REG_SZ /d "" /f
reg add "HKCU\SOFTWARE\Classes\ffpbrowser\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\SOFTWARE\Classes\ffpbrowser\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -- \"%%1\"" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML" /v "FriendlyTypeName" /t REG_SZ /d "FirefoxPortableHTML Document" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML" /ve /t REG_SZ /d "FirefoxPortableHTML Document" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML\shell\open\command" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe %%1" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
reg add "HKCU\Software\Classes\FirefoxPortableHTML\shell\open\ddeexec" /f
reg add "HKCU\Software\Classes\FirefoxPortableURL" /f
reg add "HKCU\Software\Classes\FirefoxPortableURL" /v "FriendlyTypeName" /t REG_SZ /d "FirefoxPortableURL" /f
reg add "HKCU\Software\Classes\FirefoxPortableURL" /ve /t REG_SZ /d "FirefoxPortableURL" /f
reg add "HKCU\Software\Classes\FirefoxPortableURL\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Classes\FirefoxPortableURL\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
reg add "HKCU\Software\Classes\FirefoxPortableURL\shell\open\ddeexec" /f
reg add "HKCU\Software\Classes\FirefoxPortable\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Classes\FirefoxPortable\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
reg add "HKCU\Software\Classes\https\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Classes\https\shell" /ve /t REG_SZ /d "open" /f
reg add "HKCU\Software\Classes\https\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
reg add "HKCU\Software\Classes\http\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Classes\http\shell" /ve /t REG_SZ /d "open" /f
reg add "HKCU\Software\Classes\http\shell\open\command" /ve /t REG_SZ /d "\"%~dp0FirefoxPortable.exe\" -url \"%%1\"" /f
reg add "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" /v "%~dp0FirefoxPortable.exe.ApplicationCompany" /t REG_SZ /d "PowerUser" /f
reg add "HKCU\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache" /v "%~dp0FirefoxPortable.exe.FriendlyAppName" /t REG_SZ /d "FirefoxPortable" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable" /ve /t REG_SZ /d "FirefoxPortable" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "ApplicationDescription" /t REG_SZ /d "FirefoxPortable - портативная версия браузера Firefox" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "ApplicationIcon" /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /v "ApplicationName" /t REG_SZ /d "FirefoxPortable" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".htm" /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".html" /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".shtml" /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".xht" /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\FileAssociations" /v ".xhtml" /t REG_SZ /d "FirefoxPortableHTML" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\Startmenu" /v "StartMenuInternet" /t REG_SZ /d "FirefoxPortable" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "http" /t REG_SZ /d "FirefoxPortableURL" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities\URLAssociations" /v "https" /t REG_SZ /d "FirefoxPortableURL" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\DefaultIcon" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe,0" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\InstallInfo" /v "IconsVisible" /t REG_DWORD /d "1" /f
reg add "HKCU\Software\Clients\StartMenuInternet\FirefoxPortable\shell\open\command" /ve /t REG_SZ /d "%~dp0FirefoxPortable.exe %%1" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" /v "FirefoxPortableHTML_.htm" /t REG_DWORD /d "0" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" /v "FirefoxPortableHTML_.html" /t REG_DWORD /d "0" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" /v "FirefoxPortableURL_http" /t REG_DWORD /d "0" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\ApplicationAssociationToasts" /v "FirefoxPortableURL_https" /t REG_DWORD /d "0" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.html\OpenWithProgids" /v "FirefoxPortableHTML" /t REG_NONE /d "" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.htm\OpenWithProgids" /v "FirefoxPortableHTML" /t REG_NONE /d "" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\https\UserChoice" /v "ProgId" /t REG_SZ /d "FirefoxPortableURL" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" /f
reg add "HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice" /v "ProgId" /t REG_SZ /d "FirefoxPortableURL" /f
reg add "HKCU\Software\RegisteredApplications" /v "FirefoxPortable" /t REG_SZ /d "Software\Clients\StartMenuInternet\FirefoxPortable\Capabilities" /f
"%~dp0SetDefaultBrowser.exe" HKCU "FirefoxPortable"

:END