micropeak: Fix file association registry install on Windows
authorKeith Packard <keithp@keithp.com>
Fri, 6 Feb 2015 11:31:07 +0000 (03:31 -0800)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Feb 2015 11:31:07 +0000 (03:31 -0800)
Need to invoke DisableX64FSRedirection before setting file association
registry entries or Windows won't find our application.

Signed-off-by: Keith Packard <keithp@keithp.com>
altosui/altos-windows.nsi.in
micropeak/micropeak-windows.nsi.in
telegps/telegps-windows.nsi.in

index 11c1dc0..491fe51 100644 (file)
@@ -108,7 +108,7 @@ Section "${REG_NAME} Application"
 
        File "../icon/${WIN_APP_ICON}"
 
-       CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}"
+       CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}"
 SectionEnd
 
 Section "${REG_NAME} Desktop Shortcut"
@@ -164,13 +164,15 @@ Section "File Associations"
        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" ""                     '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+  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"
@@ -185,7 +187,7 @@ Section "File Associations"
        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" ""                      '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+  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"
index 848523b..baa153e 100644 (file)
@@ -86,7 +86,7 @@ Section "${REG_NAME} Application"
 
        File "../icon/${WIN_APP_ICON}"
 
-       CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}"
+       CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}"
 SectionEnd
 
 Section "${REG_NAME} Desktop Shortcut"
@@ -102,11 +102,15 @@ SectionEnd
 
 Section "File Associations"
 
+       ${DisableX64FSRedirection}
+
        SetOutPath $INSTDIR
 
        File "../icon/${WIN_APP_EXE}"
        File "../icon/${WIN_MPD_EXE}"
 
+       SearchPath $1 "javaw.exe"
+
        ; application elements
        
        DeleteRegKey HKCR "${PROG_ID}"
@@ -116,7 +120,7 @@ Section "File Associations"
        WriteRegStr HKCR "${PROG_ID_MPD}"               "FriendlyTypeName"              "MicroPeak Data File"
        WriteRegStr HKCR "${PROG_ID_MPD}\CurVer"        ""                              "${PROG_ID_MPD}"
        WriteRegStr HKCR "${PROG_ID_MPD}\DefaultIcon"   ""                              '"$INSTDIR\${WIN_MPD_EXE}",-101'
-  WriteRegExpandStr HKCR "${PROG_ID_MPD}\shell\play\command" ""                                '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+  WriteRegExpandStr HKCR "${PROG_ID_MPD}\shell\play\command" ""                                '"$1" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
 
        ; .mpd elements
 
index 603d497..3c3aeb8 100644 (file)
@@ -108,7 +108,7 @@ Section "${REG_NAME} Application"
 
        File "../icon/${WIN_APP_ICON}"
 
-       CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}"
+       CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}"
 SectionEnd
 
 Section "${REG_NAME} Desktop Shortcut"
@@ -152,13 +152,15 @@ Section "File Associations"
        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" ""                     '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+  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"
@@ -173,7 +175,7 @@ Section "File Associations"
        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" ""                      '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+  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"