!macro customInstall
  WriteRegStr SHCTX "SOFTWARE\RegisteredApplications" "BluevCaht" "Software\Clients\StartMenuInternet\BluevCaht\Capabilities"

  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht" "" "BluevCaht HTML Document"
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\Application" "AppUserModelId" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\Application" "ApplicationIcon" "$INSTDIR\BluevCaht.exe,0"
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\Application" "ApplicationName" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\Application" "ApplicationCompany" "BluevCaht"      
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\Application" "ApplicationDescription" "A privacy-focused, extensible and beautiful web browser"      
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\DefaultIcon" "DefaultIcon" "$INSTDIR\BluevCaht.exe,0"
  WriteRegStr SHCTX "SOFTWARE\Classes\BluevCaht\shell\open\command" "" '"$INSTDIR\BluevCaht.exe" "%1"'

  WriteRegStr SHCTX "SOFTWARE\Classes\.htm\OpenWithProgIds" "BluevCaht" ""
  WriteRegStr SHCTX "SOFTWARE\Classes\.html\OpenWithProgIds" "BluevCaht" ""

  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht" "" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\DefaultIcon" "" "$INSTDIR\BluevCaht.exe,0"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities" "ApplicationDescription" "A privacy-focused, extensible and beautiful web browser"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities" "ApplicationName" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities" "ApplicationIcon" "$INSTDIR\BluevCaht.exe,0"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities\FileAssociations" ".htm" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities\FileAssociations" ".html" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities\URLAssociations" "http" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities\URLAssociations" "https" "BluevCaht"
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\Capabilities\StartMenu" "StartMenuInternet" "BluevCaht"
  
  WriteRegDWORD SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\InstallInfo" "IconsVisible" 1
  
  WriteRegStr SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht\shell\open\command" "" "$INSTDIR\BluevCaht.exe"
!macroend

!macro preInit
    SetRegView 64
    WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\\Program Files\\bluevchat"
    WriteRegExpandStr HkCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\\Program Files\\bluevchat"
    SetRegView 32
    WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\\Program Files\\bluevchat"
    WriteRegExpandStr HkCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\\Program Files\\bluevchat"
!macroend


!macro customUnInstall
  DeleteRegKey SHCTX "SOFTWARE\Classes\BluevCaht"
  DeleteRegKey SHCTX "SOFTWARE\Clients\StartMenuInternet\BluevCaht"
  DeleteRegValue SHCTX "SOFTWARE\RegisteredApplications" "BluevCaht"
!macroend