+Section "File Associations"
+
+ ${DisableX64FSRedirection}
+
+ SetOutPath $INSTDIR
+
+ File "../icon/${WIN_APP_EXE}"
+ File "../icon/${WIN_TELEM_EXE}"
+ File "../icon/${WIN_EEPROM_EXE}"
+
+ DeleteRegKey HKCR "${PROG_ID_TELEM}"
+ DeleteRegKey HKCR "${PROG_ID_EEPROM}"
+
+ DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}"
+ DeleteRegKey HKCR ".telem\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_EEPROM}"
+
+ SearchPath $1 "javaw.exe"
+
+ ; .eeprom elements
+
+ WriteRegStr HKCR "${PROG_ID_EEPROM}" "" "Altus Metrum Log File"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}" "FriendlyTypeName" "Altus Metrum Log File"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}\CurVer" "" "${PROG_ID_EEPROM}"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}\DefaultIcon" "" '"$INSTDIR\${WIN_EEPROM_EXE}",-101'
+ WriteRegExpandStr HKCR "${PROG_ID_EEPROM}\shell\open\command" "" '"$1" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+
+ WriteRegStr HKCR ".eeprom" "" "${PROG_ID_EEPROM}"
+ WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File"
+ WriteRegStr HKCR ".eeprom" "Content Type" "application/vnd.altusmetrum.eeprom"
+
+ WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" ""
+ WriteRegStr HKCR ".eeprom\${PROG_ID_EEPROM}" "" "${REG_NAME}"
+
+ ; .telem elements
+
+ WriteRegStr HKCR "${PROG_ID_TELEM}" "" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR "${PROG_ID_TELEM}" "FriendlyTypeName" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR "${PROG_ID_TELEM}\CurVer" "" "${PROG_ID_TELEM}"
+ WriteRegStr HKCR "${PROG_ID_TELEM}\DefaultIcon" "" '"$INSTDIR\${WIN_TELEM_EXE}",-101'
+ WriteRegExpandStr HKCR "${PROG_ID_TELEM}\shell\open\command" "" '"$1" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+
+ WriteRegStr HKCR ".telem" "" "${PROG_ID_TELEM}"
+ WriteRegStr HKCR ".telem" "PerceivedType" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR ".telem" "Content Type" "application/vnd.altusmetrum.telemetry"
+
+ WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" ""
+ WriteRegStr HKCR ".telem\${PROG_ID_TELEM}" "" "${REG_NAME}"
+
+ Call RefreshShellIcons
+SectionEnd
+