From c8078d352a7f54a4a97d25af080155d3f875536a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Jun 2014 22:49:34 -0700 Subject: java: Bump java library versions for next release Prepare for future release by bumping java versions now Signed-off-by: Keith Packard --- micropeak/MicroData.java | 4 ++-- micropeak/MicroDataPoint.java | 2 +- micropeak/MicroDeviceDialog.java | 2 +- micropeak/MicroDownload.java | 4 ++-- micropeak/MicroExport.java | 4 ++-- micropeak/MicroFile.java | 4 ++-- micropeak/MicroFileChooser.java | 4 ++-- micropeak/MicroFrame.java | 2 +- micropeak/MicroGraph.java | 4 ++-- micropeak/MicroPeak.java | 4 ++-- micropeak/MicroRaw.java | 4 ++-- micropeak/MicroSave.java | 4 ++-- micropeak/MicroSerial.java | 2 +- micropeak/MicroSerialLog.java | 2 +- micropeak/MicroStats.java | 4 ++-- micropeak/MicroStatsTable.java | 4 ++-- micropeak/MicroUSB.java | 2 +- 17 files changed, 28 insertions(+), 28 deletions(-) (limited to 'micropeak') diff --git a/micropeak/MicroData.java b/micropeak/MicroData.java index ca211f16..6c9447aa 100644 --- a/micropeak/MicroData.java +++ b/micropeak/MicroData.java @@ -20,8 +20,8 @@ package org.altusmetrum.micropeak; import java.lang.*; import java.io.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; class MicroIterator implements Iterator { int i; diff --git a/micropeak/MicroDataPoint.java b/micropeak/MicroDataPoint.java index 5a5e8c37..849ae536 100644 --- a/micropeak/MicroDataPoint.java +++ b/micropeak/MicroDataPoint.java @@ -17,7 +17,7 @@ package org.altusmetrum.micropeak; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public class MicroDataPoint implements AltosUIDataPoint { public double time; diff --git a/micropeak/MicroDeviceDialog.java b/micropeak/MicroDeviceDialog.java index 305421a7..304eac7d 100644 --- a/micropeak/MicroDeviceDialog.java +++ b/micropeak/MicroDeviceDialog.java @@ -21,7 +21,7 @@ import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public class MicroDeviceDialog extends AltosDeviceDialog { diff --git a/micropeak/MicroDownload.java b/micropeak/MicroDownload.java index 1c70e1d1..32dd0450 100644 --- a/micropeak/MicroDownload.java +++ b/micropeak/MicroDownload.java @@ -23,8 +23,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroDownload extends AltosUIDialog implements Runnable, ActionListener, MicroSerialLog, WindowListener { MicroPeak owner; diff --git a/micropeak/MicroExport.java b/micropeak/MicroExport.java index 87d5499b..8d62ace6 100644 --- a/micropeak/MicroExport.java +++ b/micropeak/MicroExport.java @@ -23,8 +23,8 @@ import java.util.ArrayList; import java.awt.*; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroExport extends JFileChooser { diff --git a/micropeak/MicroFile.java b/micropeak/MicroFile.java index 019346ae..d6abfcb7 100644 --- a/micropeak/MicroFile.java +++ b/micropeak/MicroFile.java @@ -19,8 +19,8 @@ package org.altusmetrum.micropeak; import java.io.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroFile { diff --git a/micropeak/MicroFileChooser.java b/micropeak/MicroFileChooser.java index 00b6690a..371c22d0 100644 --- a/micropeak/MicroFileChooser.java +++ b/micropeak/MicroFileChooser.java @@ -20,8 +20,8 @@ package org.altusmetrum.micropeak; import javax.swing.*; import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroFileChooser extends JFileChooser { JFrame frame; diff --git a/micropeak/MicroFrame.java b/micropeak/MicroFrame.java index 5bfe5bf7..f82d1c5e 100644 --- a/micropeak/MicroFrame.java +++ b/micropeak/MicroFrame.java @@ -21,7 +21,7 @@ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public class MicroFrame extends AltosUIFrame { static String[] micro_icon_names = { diff --git a/micropeak/MicroGraph.java b/micropeak/MicroGraph.java index f9968919..811b1e7c 100644 --- a/micropeak/MicroGraph.java +++ b/micropeak/MicroGraph.java @@ -22,8 +22,8 @@ import java.util.ArrayList; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; import org.jfree.ui.*; import org.jfree.chart.*; diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java index 19e91660..d7d393ba 100644 --- a/micropeak/MicroPeak.java +++ b/micropeak/MicroPeak.java @@ -23,8 +23,8 @@ import javax.swing.*; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroPeak extends MicroFrame implements ActionListener, ItemListener { diff --git a/micropeak/MicroRaw.java b/micropeak/MicroRaw.java index 26d62012..7a225dcb 100644 --- a/micropeak/MicroRaw.java +++ b/micropeak/MicroRaw.java @@ -20,8 +20,8 @@ package org.altusmetrum.micropeak; import java.awt.*; import java.io.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroRaw extends JTextArea { diff --git a/micropeak/MicroSave.java b/micropeak/MicroSave.java index 7c5d6abe..9497fb33 100644 --- a/micropeak/MicroSave.java +++ b/micropeak/MicroSave.java @@ -24,8 +24,8 @@ import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; import java.util.concurrent.*; import java.util.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroSave extends JFileChooser { diff --git a/micropeak/MicroSerial.java b/micropeak/MicroSerial.java index 37b68636..f5108c22 100644 --- a/micropeak/MicroSerial.java +++ b/micropeak/MicroSerial.java @@ -20,7 +20,7 @@ package org.altusmetrum.micropeak; import java.util.*; import java.io.*; import libaltosJNI.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public class MicroSerial extends InputStream { SWIGTYPE_p_altos_file file; diff --git a/micropeak/MicroSerialLog.java b/micropeak/MicroSerialLog.java index 7300f06d..c49b69ab 100644 --- a/micropeak/MicroSerialLog.java +++ b/micropeak/MicroSerialLog.java @@ -20,7 +20,7 @@ package org.altusmetrum.micropeak; import java.util.*; import java.io.*; import libaltosJNI.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public interface MicroSerialLog { diff --git a/micropeak/MicroStats.java b/micropeak/MicroStats.java index 45c9f225..3fc05bd6 100644 --- a/micropeak/MicroStats.java +++ b/micropeak/MicroStats.java @@ -18,8 +18,8 @@ package org.altusmetrum.micropeak; import java.io.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroStats { double coast_height; diff --git a/micropeak/MicroStatsTable.java b/micropeak/MicroStatsTable.java index 3b17e731..d6265fe8 100644 --- a/micropeak/MicroStatsTable.java +++ b/micropeak/MicroStatsTable.java @@ -19,8 +19,8 @@ package org.altusmetrum.micropeak; import java.awt.*; import javax.swing.*; -import org.altusmetrum.altoslib_4.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altoslib_5.*; +import org.altusmetrum.altosuilib_3.*; public class MicroStatsTable extends JComponent implements AltosFontListener { GridBagLayout layout; diff --git a/micropeak/MicroUSB.java b/micropeak/MicroUSB.java index 437fa0bc..24f6722b 100644 --- a/micropeak/MicroUSB.java +++ b/micropeak/MicroUSB.java @@ -19,7 +19,7 @@ package org.altusmetrum.micropeak; import java.util.*; import libaltosJNI.*; -import org.altusmetrum.altosuilib_2.*; +import org.altusmetrum.altosuilib_3.*; public class MicroUSB extends altos_device implements AltosDevice { -- cgit v1.2.3 From 3f4e765c05ddbae83ca0c0176572cd698f285d08 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 17 Jun 2014 20:46:33 -0700 Subject: Fix java version detection and downloading Move java stuff to a common include file, java.nsh Let any version no older than 1.6 serve by using ${VersionCompare} Use version 6 downloads as those don't require a click-through agreement. Signed-off-by: Keith Packard --- altosui/Instdrv/NSIS/Includes/java.nsh | 50 ++++++++++++++++++++++++++++++++++ altosui/altos-windows.nsi.in | 47 ++------------------------------ micropeak/Makefile.am | 2 +- micropeak/micropeak-windows.nsi.in | 46 ++----------------------------- telegps/telegps-windows.nsi.in | 47 ++------------------------------ 5 files changed, 58 insertions(+), 134 deletions(-) create mode 100644 altosui/Instdrv/NSIS/Includes/java.nsh (limited to 'micropeak') diff --git a/altosui/Instdrv/NSIS/Includes/java.nsh b/altosui/Instdrv/NSIS/Includes/java.nsh new file mode 100644 index 00000000..ebf1c5b9 --- /dev/null +++ b/altosui/Instdrv/NSIS/Includes/java.nsh @@ -0,0 +1,50 @@ +!include WordFunc.nsh + +; Definitions for Java Detection + +!define JRE_VERSION "1.6" +!define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52247&/jre-6u27-windows-i586.exe" +!define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52249&/jre-6u27-windows-x64.exe" + +Var JavaDownload +Var JavaBits + +Function GetJRE + ${If} ${RunningX64} + StrCpy $JavaDownload ${JRE64_URL} + StrCpy $JavaBits "64" + ${Else} + StrCpy $JavaDownload ${JRE32_URL} + StrCpy $JavaBits "32" + ${EndIf} + + MessageBox MB_OK "This product uses Java ${JRE_VERSION}, \ + $JavaBits bits, it will now \ + be downloaded and installed" + + StrCpy $2 "$TEMP\Java Runtime Environment.exe" + nsisdl::download /TIMEOUT=30000 $JavaDownload $2 + Pop $R0 ;Get the return value + StrCmp $R0 "success" +3 + MessageBox MB_OK "Download failed: $R0" + Quit + ExecWait $2 + Delete $2 +FunctionEnd + +Function DetectJRE + ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ + "CurrentVersion" + + DetailPrint "Desired Java version ${JRE_VERSION}" + DetailPrint "Actual Java version $2" + + ${VersionCompare} $2 ${JRE_VERSION} $3 + + IntCmp $3 1 done done + + Call GetJRE + +done: + +FunctionEnd diff --git a/altosui/altos-windows.nsi.in b/altosui/altos-windows.nsi.in index b72772e2..ab5ac453 100644 --- a/altosui/altos-windows.nsi.in +++ b/altosui/altos-windows.nsi.in @@ -1,10 +1,8 @@ !addplugindir Instdrv/NSIS/Plugins +!addincludedir Instdrv/NSIS/Includes !include x64.nsh -; Definitions for Java 1.7 Detection -!define JRE_VERSION "1.7" -!define JRE_ALTERNATE "1.6" -!define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383&/jre-7u51-windows-i586.exe" -!define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385&/jre-7u51-windows-x64.exe" +!include java.nsh + !define PRODUCT_NAME "Altus Metrum Windows Software" Name "Altus Metrum Installer" @@ -35,45 +33,6 @@ Function .onInit ${EndIf} FunctionEnd -Var JavaDownload -Var JavaBits - -Function GetJRE - ${If} ${RunningX64} - StrCpy $JavaDownload ${JRE64_URL} - StrCpy $JavaBits "64" - ${Else} - StrCpy $JavaDownload ${JRE32_URL} - StrCpy $JavaBits "32" - ${EndIf} - - MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, \ - $JavaBits bits, it will now \ - be downloaded and installed" - - StrCpy $2 "$TEMP\Java Runtime Environment.exe" - nsisdl::download /TIMEOUT=30000 $JavaDownload $2 - Pop $R0 ;Get the return value - StrCmp $R0 "success" +3 - MessageBox MB_OK "Download failed: $R0" - Quit - ExecWait $2 - Delete $2 -FunctionEnd - -Function DetectJRE - ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ - "CurrentVersion" - - StrCmp $2 ${JRE_VERSION} done - - StrCmp $2 ${JRE_ALTERNATE} done - - Call GetJRE - - done: -FunctionEnd - ; Pages to present Page license diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am index 216874df..39ebc43a 100644 --- a/micropeak/Makefile.am +++ b/micropeak/Makefile.am @@ -272,7 +272,7 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(WINDOWS_DIST): $(WINDOWS_FILES) micropeak-windows.nsi -rm -f $@ - makensis -Omicropeak-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" micropeak-windows.nsi + makensis -Omicropeak-windows.log "-XOutFile $@" "-DVERSION=$(VERSION)" micropeak-windows.nsi || (cat micropeak-windows.log && exit 1) Manifest.txt: Makefile echo 'Main-Class: org.altusmetrum.micropeak.MicroPeak' > $@ diff --git a/micropeak/micropeak-windows.nsi.in b/micropeak/micropeak-windows.nsi.in index 6dc9d8c1..bb5da1bb 100644 --- a/micropeak/micropeak-windows.nsi.in +++ b/micropeak/micropeak-windows.nsi.in @@ -1,11 +1,7 @@ !addplugindir Instdrv/NSIS/Plugins +!addincludedir ../altosui/Instdrv/NSIS/Includes !include x64.nsh -; Definitions for Java 1.7 Detection -!define JRE_VERSION "1.7" -!define JRE_ALTERNATE "1.6" -!define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383&/jre-7u51-windows-i586.exe" -!define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385&/jre-7u51-windows-x64.exe" -!define PRODUCT_NAME "Altus Metrum Windows Software" +!include java.nsh Name "Altus Metrum MicroPeak Installer" @@ -35,44 +31,6 @@ Function .onInit ${EndIf} FunctionEnd -Var JavaDownload -Var JavaBits - -Function GetJRE - ${If} ${RunningX64} - StrCpy $JavaDownload ${JRE64_URL} - StrCpy $JavaBits "64" - ${Else} - StrCpy $JavaDownload ${JRE32_URL} - StrCpy $JavaBits "32" - ${EndIf} - - MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, \ - $JavaBits bits, it will now \ - be downloaded and installed" - - StrCpy $2 "$TEMP\Java Runtime Environment.exe" - nsisdl::download /TIMEOUT=30000 $JavaDownload $2 - Pop $R0 ;Get the return value - StrCmp $R0 "success" +3 - MessageBox MB_OK "Download failed: $R0" - Quit - ExecWait $2 - Delete $2 -FunctionEnd - -Function DetectJRE - ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ - "CurrentVersion" - StrCmp $2 ${JRE_VERSION} done - - StrCmp $2 ${JRE_ALTERNATE} done - - Call GetJRE - - done: -FunctionEnd - ; Pages to present Page license diff --git a/telegps/telegps-windows.nsi.in b/telegps/telegps-windows.nsi.in index e6798c46..b4145520 100644 --- a/telegps/telegps-windows.nsi.in +++ b/telegps/telegps-windows.nsi.in @@ -1,11 +1,7 @@ !addplugindir ../altosui/Instdrv/NSIS/Plugins +!addincludedir ../altosui/Instdrv/NSIS/Includes !include x64.nsh -; Definitions for Java 1.7 Detection -!define JRE_VERSION "1.7" -!define JRE_ALTERNATE "1.6" -!define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383&/jre-7u51-windows-i586.exe" -!define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385&/jre-7u51-windows-x64.exe" -!define PRODUCT_NAME "TeleGPS Windows Software" +!include java.nsh Name "TeleGPS Installer" @@ -35,45 +31,6 @@ Function .onInit ${EndIf} FunctionEnd -Var JavaDownload -Var JavaBits - -Function GetJRE - ${If} ${RunningX64} - StrCpy $JavaDownload ${JRE64_URL} - StrCpy $JavaBits "64" - ${Else} - StrCpy $JavaDownload ${JRE32_URL} - StrCpy $JavaBits "32" - ${EndIf} - - MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, \ - $JavaBits bits, it will now \ - be downloaded and installed" - - StrCpy $2 "$TEMP\Java Runtime Environment.exe" - nsisdl::download /TIMEOUT=30000 $JavaDownload $2 - Pop $R0 ;Get the return value - StrCmp $R0 "success" +3 - MessageBox MB_OK "Download failed: $R0" - Quit - ExecWait $2 - Delete $2 -FunctionEnd - -Function DetectJRE - ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \ - "CurrentVersion" - - StrCmp $2 ${JRE_VERSION} done - - StrCmp $2 ${JRE_ALTERNATE} done - - Call GetJRE - - done: -FunctionEnd - ; Pages to present Page license -- cgit v1.2.3 From 5871225a0c442cf5afa41a444ff8bfb8f4002721 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Jun 2014 02:16:51 -0700 Subject: windows installer: Create file associations for Windows. This makes icons appear for the files in the file manager, and lets you double-click on the files to open the appropriate application. Signed-off-by: Keith Packard --- altosui/Makefile.am | 2 +- altosui/altos-windows.nsi.in | 118 ++++++++++++++++++++++++++++-------- micropeak/Makefile.am | 2 +- micropeak/micropeak-windows.nsi.in | 120 +++++++++++++++++++++++++++---------- telegps/Makefile.am | 2 +- telegps/telegps-windows.nsi.in | 118 ++++++++++++++++++++++++++++-------- 6 files changed, 277 insertions(+), 85 deletions(-) (limited to 'micropeak') diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 98a5e193..45f4467a 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -90,7 +90,7 @@ ICONJAR= -C $(ICONDIR) altus-metrum-16.png \ -C $(ICONDIR) altus-metrum-128.png \ -C $(ICONDIR) altus-metrum-256.png -WINDOWS_ICON=$(ICONDIR)/altus-metrum.ico +WINDOWS_ICON=$(ICONDIR)/altus-metrum.ico $(ICONDIR)/altus-metrum.exe MACOSX_ICON=$(ICONDIR)/AltosUIIcon.icns # Firmware diff --git a/altosui/altos-windows.nsi.in b/altosui/altos-windows.nsi.in index ab5ac453..da36ad90 100644 --- a/altosui/altos-windows.nsi.in +++ b/altosui/altos-windows.nsi.in @@ -2,16 +2,22 @@ !addincludedir Instdrv/NSIS/Includes !include x64.nsh !include java.nsh +!include refresh-sh.nsh -!define PRODUCT_NAME "Altus Metrum Windows Software" +!define REG_NAME "Altus Metrum" +!define PROG_ID "org.altusmetrum.altosui.1" +!define PROG_ALTOSUI "org.altusmetrum.altosui.1" +!define FAT_NAME "altosui-fat.jar" +!define ICO_ICO "altus-metrum.ico" +!define ICO_EXE "altus-metrum.exe" -Name "Altus Metrum Installer" +Name "${REG_NAME} Installer" ; Default install directory InstallDir "$PROGRAMFILES\AltusMetrum" ; Tell the installer where to re-install a new version -InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir" +InstallDirRegKey HKLM "Software\${REG_NAME}" "Install_Dir" LicenseText "GNU General Public License Version 2" LicenseData "../COPYING" @@ -21,7 +27,7 @@ RequestExecutionLevel admin ShowInstDetails Show -ComponentText "Altus Metrum Software and Driver Installer" +ComponentText "${REG_NAME} Software and Driver Installer" Function .onInit DetailPrint "Checking host operating system" @@ -33,6 +39,16 @@ Function .onInit ${EndIf} FunctionEnd +Function un.onInit + DetailPrint "Checking host operating system" + ${If} ${RunningX64} + DetailPrint "Installer running on 64-bit host" + SetRegView 64 + StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum" + ${DisableX64FSRedirection} + ${EndIf} +FunctionEnd + ; Pages to present Page license @@ -68,12 +84,12 @@ done: SectionEnd -Section "AltosUI Application" +Section "${REG_NAME} Application" Call DetectJRE SetOutPath $INSTDIR - File "altosui-fat.jar" + File "${FAT_NAME}" File "altoslib_@ALTOSLIB_VERSION@.jar" File "altosuilib_@ALTOSUILIB_VERSION@.jar" File "cmudict04.jar" @@ -88,13 +104,13 @@ Section "AltosUI Application" File "*.dll" - File "../icon/*.ico" + File "../icon/${ICO_ICO}" - CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$SYSDIR\javaw.exe" "-jar altosui-fat.jar" "$INSTDIR\altus-metrum.ico" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${ICO_ICO}" SectionEnd -Section "AltosUI Desktop Shortcut" - CreateShortCut "$DESKTOP\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar" "" "$INSTDIR\altus-metrum.ico" +Section "${REG_NAME} Desktop Shortcut" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${ICO_ICO}" SectionEnd Section "TeleMetrum, TeleDongle and TeleBT Firmware" @@ -126,38 +142,88 @@ Section "Documentation" File "../doc/telemini.pdf" SectionEnd +Section "File Associations" + + SetOutPath $INSTDIR + + File "../icon/${ICO_EXE}" + + ; application elements + + WriteRegStr HKCR "${PROG_ID}" "" "Altus Metrum Data File" + WriteRegStr HKCR "${PROG_ID}" "FriendlyTypeName" "Altus Metrum Data File" + WriteRegStr HKCR "${PROG_ID}\CurVer" "" "${PROG_ID}" + WriteRegStr HKCR "${PROG_ID}\DefaultIcon" "" '"$INSTDIR\${ICO_EXE}",-101' + WriteRegExpandStr HKCR "${PROG_ID}\shell\play\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + + ; .eeprom elements + + WriteRegStr HKCR ".eeprom" "" "${PROG_ALTOSUI}" + WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File" + WriteRegStr HKCR ".eeprom" "Content Type" "application/altosui" + + WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" "" + WriteRegStr HKCR ".eeprom\${PROG_ID}" "" "${REG_NAME}" + + ; .telem elements + + WriteRegStr HKCR ".telem" "" "${PROG_ALTOSUI}" + WriteRegStr HKCR ".telem" "PerceivedType" "Altus Metrum Telemetry File" + WriteRegStr HKCR ".telem" "Content Type" "application/altosui" + + WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID}" "" + WriteRegStr HKCR ".telem\${PROG_ID}" "" "${REG_NAME}" + + Call RefreshShellIcons +SectionEnd + Section "Uninstaller" ; Deal with the uninstaller + ${DisableX64FSRedirection} SetOutPath $INSTDIR ; Write the install path to the registry - WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "SOFTWARE\${REG_NAME}" "Install_Dir" "$INSTDIR" ; Write the uninstall keys for windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "DisplayName" "${REG_NAME}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "UninstallString" '"$INSTDIR\uninstall-${REG_NAME}.exe"' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoModify" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoRepair" "1" - WriteUninstaller "uninstall.exe" + WriteUninstaller "uninstall-${REG_NAME}.exe" SectionEnd Section "Uninstall" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" - DeleteRegKey HKLM "Software\AltusMetrum" - Delete "$INSTDIR\*.*" - RMDir "$INSTDIR" + ${DisableX64FSRedirection} - ; Remove devices - InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial - InstDrv::DeleteOemInfFiles /NOUNLOAD - InstDrv::RemoveAllDevices + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" + DeleteRegKey HKLM "SOFTWARE\${REG_NAME}" + + DetailPrint "Delete uninstall reg entries" + + DeleteRegKey HKCR "${PROG_ID}" + + DeleteRegKey HKCR ".eeprom\${PROG_ID}" + DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" + + DeleteRegKey HKCR ".telem\${PROG_ID}" + DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID}" + + DetailPrint "Delete file association reg entries" + + Delete "$INSTDIR\${FAT_NAME}" + Delete "$INSTDIR\uninstall-${REG_NAME}.exe" + + Delete "$INSTDIR\${ICO_ICO}" + Delete "$INSTDIR\${ICO_EXE}" ; Remove shortcuts, if any - Delete "$SMPROGRAMS\AltusMetrum.lnk" - Delete "$DESKTOP\AltusMetrum.lnk" + Delete "$SMPROGRAMS\${REG_NAME}.lnk" + Delete "$DESKTOP\${REG_NAME}.lnk" + Call un.RefreshShellIcons SectionEnd diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am index 39ebc43a..1e09e523 100644 --- a/micropeak/Makefile.am +++ b/micropeak/Makefile.am @@ -71,7 +71,7 @@ ICONJAR= -C $(ICONDIR) micropeak-16.png \ -C $(ICONDIR) micropeak-128.png \ -C $(ICONDIR) micropeak-256.png -WINDOWS_ICON=$(ICONDIR)/micro-peak.ico +WINDOWS_ICON=$(ICONDIR)/micro-peak.ico $(ICONDIR)/micro-peak.exe MACOSX_ICON=$(ICONDIR)/MicroPeak.icns desktopdir = $(datadir)/applications diff --git a/micropeak/micropeak-windows.nsi.in b/micropeak/micropeak-windows.nsi.in index bb5da1bb..d8e47505 100644 --- a/micropeak/micropeak-windows.nsi.in +++ b/micropeak/micropeak-windows.nsi.in @@ -1,15 +1,22 @@ -!addplugindir Instdrv/NSIS/Plugins +!addplugindir ../altosui/Instdrv/NSIS/Plugins !addincludedir ../altosui/Instdrv/NSIS/Includes !include x64.nsh !include java.nsh +!include refresh-sh.nsh -Name "Altus Metrum MicroPeak Installer" +!define REG_NAME "MicroPeak" +!define PROG_ID "org.altusmetrum.micropeak.1" +!define FAT_NAME "micropeak-fat.jar" +!define ICO_ICO "micro-peak.ico" +!define ICO_EXE "micro-peak.exe" + +Name "${REG_NAME} Installer" ; Default install directory InstallDir "$PROGRAMFILES\AltusMetrum" ; Tell the installer where to re-install a new version -InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir" +InstallDirRegKey HKLM "Software\${REG_NAME}" "Install_Dir" LicenseText "GNU General Public License Version 2" LicenseData "../COPYING" @@ -19,7 +26,7 @@ RequestExecutionLevel admin ShowInstDetails Show -ComponentText "Altus Metrum MicroPeak Software Installer" +ComponentText "${REG_NAME} Software and Driver Installer" Function .onInit DetailPrint "Checking host operating system" @@ -31,6 +38,16 @@ Function .onInit ${EndIf} FunctionEnd +Function un.onInit + DetailPrint "Checking host operating system" + ${If} ${RunningX64} + DetailPrint "Installer running on 64-bit host" + SetRegView 64 + StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum" + ${DisableX64FSRedirection} + ${EndIf} +FunctionEnd + ; Pages to present Page license @@ -43,12 +60,21 @@ UninstPage instfiles ; And the stuff to install -Section "MicroPeak Application" +Section "FTDI USB Driver" + SetOutPath $INSTDIR + + File "CDM20824_Setup.exe" + + StrCpy $2 "$INSTDIR\CDM20824_Setup.exe" + ExecWait $2 +SectionEnd + +Section "${REG_NAME} Application" Call DetectJRE SetOutPath $INSTDIR - File "micropeak-fat.jar" + File "${FAT_NAME}" File "altoslib_@ALTOSLIB_VERSION@.jar" File "altosuilib_@ALTOSUILIB_VERSION@.jar" File "jfreechart.jar" @@ -56,22 +82,13 @@ Section "MicroPeak Application" File "*.dll" - File "../icon/*.ico" + File "../icon/${ICO_ICO}" - CreateShortCut "$SMPROGRAMS\MicroPeak.lnk" "$SYSDIR\javaw.exe" "-jar micropeak-fat.jar" "$INSTDIR\micro-peak.ico" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${ICO_ICO}" SectionEnd -Section "FTDI USB Driver" - SetOutPath $INSTDIR - - File "CDM20824_Setup.exe" - - StrCpy $2 "$INSTDIR\CDM20824_Setup.exe" - ExecWait $2 -SectionEnd - -Section "MicroPeak Desktop Shortcut" - CreateShortCut "$DESKTOP\MicroPeak.lnk" "$INSTDIR\micropeak-fat.jar" "" "$INSTDIR\micro-peak.ico" +Section "${REG_NAME} Desktop Shortcut" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${ICO_ICO}" SectionEnd Section "Documentation" @@ -81,33 +98,74 @@ Section "Documentation" File "../doc/micropeak.pdf" SectionEnd +Section "File Associations" + + SetOutPath $INSTDIR + + File "../icon/${ICO_EXE}" + + ; application elements + + WriteRegStr HKCR "${PROG_ID}" "" "MicroPeak Data File" + WriteRegStr HKCR "${PROG_ID}" "FriendlyTypeName" "MicroPeak Data File" + WriteRegStr HKCR "${PROG_ID}\CurVer" "" "${PROG_ID}" + WriteRegStr HKCR "${PROG_ID}\DefaultIcon" "" '"$INSTDIR\${ICO_EXE}",-101' + WriteRegExpandStr HKCR "${PROG_ID}\shell\play\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + + ; .mpd elements + + WriteRegStr HKCR ".mpd" "" "${PROG_ID}" + WriteRegStr HKCR ".mpd" "PerceivedType" "MicroPeak Data File" + WriteRegStr HKCR ".mpd" "Content Type" "application/micropeak" + + WriteRegStr HKCR ".mpd\OpenWithProgids" "${PROG_ID}" "" + WriteRegStr HKCR ".mpd\${PROG_ID}" "" "${REG_NAME}" + + Call RefreshShellIcons +SectionEnd + Section "Uninstaller" ; Deal with the uninstaller + ${DisableX64FSRedirection} SetOutPath $INSTDIR ; Write the install path to the registry - WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "SOFTWARE\${REG_NAME}" "Install_Dir" "$INSTDIR" ; Write the uninstall keys for windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "DisplayName" "${REG_NAME}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "UninstallString" '"$INSTDIR\uninstall-${REG_NAME}.exe"' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoModify" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoRepair" "1" - WriteUninstaller "uninstall.exe" + WriteUninstaller "uninstall-${REG_NAME}.exe" SectionEnd Section "Uninstall" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" - DeleteRegKey HKLM "Software\AltusMetrum" - Delete "$INSTDIR\*.*" - RMDir "$INSTDIR" + ${DisableX64FSRedirection} + + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" + DeleteRegKey HKLM "SOFTWARE\${REG_NAME}" + + DetailPrint "Delete uninstall reg entries" + + DeleteRegKey HKCR "${PROG_ID}" + + DeleteRegKey HKCR ".mpd\${PROG_ID}" + DeleteRegValue HKCR ".mpd\OpenWithProgids" "${PROG_ID}" + + Delete "$INSTDIR\${FAT_NAME}" + Delete "$INSTDIR\uninstall-${REG_NAME}.exe" + + Delete "$INSTDIR\${ICO_ICO}" + Delete "$INSTDIR\${ICO_EXE}" ; Remove shortcuts, if any - Delete "$SMPROGRAMS\MicroPeak.lnk" - Delete "$DESKTOP\MicroPeak.lnk" + Delete "$SMPROGRAMS\${REG_NAME}.lnk" + Delete "$DESKTOP\${REG_NAME}.lnk" + Call un.RefreshShellIcons SectionEnd diff --git a/telegps/Makefile.am b/telegps/Makefile.am index 7b550e9e..8868c723 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -73,7 +73,7 @@ ICONJAR= -C $(ICONDIR) telegps-16.png \ -C $(ICONDIR) telegps-128.png \ -C $(ICONDIR) telegps-256.png -WINDOWS_ICON=$(ICONDIR)/telegps.ico +WINDOWS_ICON=$(ICONDIR)/telegps.ico $(ICONDIR)/telegps.exe MACOSX_ICON=$(ICONDIR)/TeleGPS.icns # Firmware diff --git a/telegps/telegps-windows.nsi.in b/telegps/telegps-windows.nsi.in index b4145520..3f9648f9 100644 --- a/telegps/telegps-windows.nsi.in +++ b/telegps/telegps-windows.nsi.in @@ -2,14 +2,22 @@ !addincludedir ../altosui/Instdrv/NSIS/Includes !include x64.nsh !include java.nsh +!include refresh-sh.nsh -Name "TeleGPS Installer" +!define REG_NAME "TeleGPS" +!define PROG_ID "org.altusmetrum.telegps.1" +!define PROG_ALTOSUI "org.altusmetrum.altosui.1" +!define FAT_NAME "telegps-fat.jar" +!define ICO_ICO "telegps.ico" +!define ICO_EXE "telegps.exe" + +Name "${REG_NAME} Installer" ; Default install directory InstallDir "$PROGRAMFILES\AltusMetrum" ; Tell the installer where to re-install a new version -InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir" +InstallDirRegKey HKLM "Software\${REG_NAME}" "Install_Dir" LicenseText "GNU General Public License Version 2" LicenseData "../COPYING" @@ -19,7 +27,7 @@ RequestExecutionLevel admin ShowInstDetails Show -ComponentText "TeleGPS Software Installer" +ComponentText "${REG_NAME} Software and Driver Installer" Function .onInit DetailPrint "Checking host operating system" @@ -31,6 +39,16 @@ Function .onInit ${EndIf} FunctionEnd +Function un.onInit + DetailPrint "Checking host operating system" + ${If} ${RunningX64} + DetailPrint "Installer running on 64-bit host" + SetRegView 64 + StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum" + ${DisableX64FSRedirection} + ${EndIf} +FunctionEnd + ; Pages to present Page license @@ -66,12 +84,12 @@ done: SectionEnd -Section "TeleGPS Application" +Section "${REG_NAME} Application" Call DetectJRE SetOutPath $INSTDIR - File "telegps-fat.jar" + File "${FAT_NAME}" File "altoslib_@ALTOSLIB_VERSION@.jar" File "altosuilib_@ALTOSUILIB_VERSION@.jar" File "cmudict04.jar" @@ -86,13 +104,13 @@ Section "TeleGPS Application" File "*.dll" - File "../icon/*.ico" + File "../icon/${ICO_ICO}" - CreateShortCut "$SMPROGRAMS\TeleGPS.lnk" "$SYSDIR\javaw.exe" "-jar telegps-fat.jar" "$INSTDIR\telegps.ico" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${ICO_ICO}" SectionEnd -Section "TeleGPS Desktop Shortcut" - CreateShortCut "$DESKTOP\TeleGPS.lnk" "$INSTDIR\telegps-fat.jar" "" "$INSTDIR\telegps.ico" +Section "${REG_NAME} Desktop Shortcut" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${ICO_ICO}" SectionEnd Section "TeleGPS, TeleDongle and TeleBT Firmware" @@ -114,38 +132,88 @@ Section "Documentation" File "../doc/telemetry.pdf" SectionEnd +Section "File Associations" + + SetOutPath $INSTDIR + + File "../icon/${ICO_EXE}" + + ; application elements + + WriteRegStr HKCR "${PROG_ID}" "" "Altus Metrum Data File" + WriteRegStr HKCR "${PROG_ID}" "FriendlyTypeName" "Altus Metrum Data File" + WriteRegStr HKCR "${PROG_ID}\CurVer" "" "${PROG_ID}" + WriteRegStr HKCR "${PROG_ID}\DefaultIcon" "" '"$INSTDIR\${ICO_EXE}",-101' + WriteRegExpandStr HKCR "${PROG_ID}\shell\play\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + + ; .eeprom elements + + WriteRegStr HKCR ".eeprom" "" "${PROG_ALTOSUI}" + WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File" + WriteRegStr HKCR ".eeprom" "Content Type" "application/altosui" + + WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" "" + WriteRegStr HKCR ".eeprom\${PROG_ID}" "" "${REG_NAME}" + + ; .telem elements + + WriteRegStr HKCR ".telem" "" "${PROG_ALTOSUI}" + WriteRegStr HKCR ".telem" "PerceivedType" "Altus Metrum Telemetry File" + WriteRegStr HKCR ".telem" "Content Type" "application/altosui" + + WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID}" "" + WriteRegStr HKCR ".telem\${PROG_ID}" "" "${REG_NAME}" + + Call RefreshShellIcons +SectionEnd + Section "Uninstaller" ; Deal with the uninstaller + ${DisableX64FSRedirection} SetOutPath $INSTDIR ; Write the install path to the registry - WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR" + WriteRegStr HKLM "SOFTWARE\${REG_NAME}" "Install_Dir" "$INSTDIR" ; Write the uninstall keys for windows - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"' - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "DisplayName" "${REG_NAME}" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "UninstallString" '"$INSTDIR\uninstall-${REG_NAME}.exe"' + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoModify" "1" + WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" "NoRepair" "1" - WriteUninstaller "uninstall.exe" + WriteUninstaller "uninstall-${REG_NAME}.exe" SectionEnd Section "Uninstall" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" - DeleteRegKey HKLM "Software\AltusMetrum" - Delete "$INSTDIR\*.*" - RMDir "$INSTDIR" + ${DisableX64FSRedirection} - ; Remove devices - InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial - InstDrv::DeleteOemInfFiles /NOUNLOAD - InstDrv::RemoveAllDevices + DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\${REG_NAME}" + DeleteRegKey HKLM "SOFTWARE\${REG_NAME}" + + DetailPrint "Delete uninstall reg entries" + + DeleteRegKey HKCR "${PROG_ID}" + + DeleteRegKey HKCR ".eeprom\${PROG_ID}" + DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" + + DeleteRegKey HKCR ".telem\${PROG_ID}" + DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID}" + + DetailPrint "Delete file association reg entries" + + Delete "$INSTDIR\${FAT_NAME}" + Delete "$INSTDIR\uninstall-${REG_NAME}.exe" + + Delete "$INSTDIR\${ICO_ICO}" + Delete "$INSTDIR\${ICO_EXE}" ; Remove shortcuts, if any - Delete "$SMPROGRAMS\TeleGPS.lnk" - Delete "$DESKTOP\TeleGPS.lnk" + Delete "$SMPROGRAMS\${REG_NAME}.lnk" + Delete "$DESKTOP\${REG_NAME}.lnk" + Call un.RefreshShellIcons SectionEnd -- cgit v1.2.3 From fac94c593285eacda57de257fa2be0548341b567 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Jun 2014 14:15:27 -0700 Subject: macosx: Define icons for our file types on OS X Adds definitions to the Info.plist files shipped to specify which icons to show for .telem, .eeprom and .mpd files. Note that the applications don't respond to open apple events, so double clicking on a file only starts the application. Signed-off-by: Keith Packard --- altosui/Info.plist.in | 27 +++++++++++++++++++++++++++ micropeak/Info.plist.in | 15 +++++++++++++++ telegps/Info.plist.in | 27 +++++++++++++++++++++++++++ 3 files changed, 69 insertions(+) (limited to 'micropeak') diff --git a/altosui/Info.plist.in b/altosui/Info.plist.in index 46dea171..bae6d52c 100644 --- a/altosui/Info.plist.in +++ b/altosui/Info.plist.in @@ -24,6 +24,33 @@ 6.0 CFBundleIconFile AltosUIIcon.icns + CFBundleDocumentTypes + + + CFBundleTypeName + Telemetry + CFBundleTypeIconFile + AltosUIIcon.icns + CFBundleTypeExtensions + + telem + + CFBundleTypeRole + Editor + + + CFBundleTypeName + Eeprom + CFBundleTypeIconFile + AltosUIIcon.icns + CFBundleTypeExtensions + + eeprom + + CFBundleTypeRole + Editor + + Java MainClass diff --git a/micropeak/Info.plist.in b/micropeak/Info.plist.in index 40984c5a..8f751079 100644 --- a/micropeak/Info.plist.in +++ b/micropeak/Info.plist.in @@ -24,6 +24,21 @@ 6.0 CFBundleIconFile MicroPeak.icns + CFBundleDocumentTypes + + + CFBundleTypeName + MicroPeak data file + CFBundleTypeIconFile + MicroPeak.icns + CFBundleTypeExtensions + + mpd + + CFBundleTypeRole + Editor + + Java MainClass diff --git a/telegps/Info.plist.in b/telegps/Info.plist.in index df05bb6e..7dbb77d1 100644 --- a/telegps/Info.plist.in +++ b/telegps/Info.plist.in @@ -24,6 +24,33 @@ 6.0 CFBundleIconFile TeleGPS.icns + CFBundleDocumentTypes + + + CFBundleTypeName + Telemetry + CFBundleTypeIconFile + TeleGPS.icns + CFBundleTypeExtensions + + telem + + CFBundleTypeRole + Editor + + + CFBundleTypeName + Eeprom + CFBundleTypeIconFile + TeleGPS.icns + CFBundleTypeExtensions + + eeprom + + CFBundleTypeRole + Editor + + Java MainClass -- cgit v1.2.3 From 7767a045d446ea2bc5fe1ec98d89274155f956c4 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 18 Jun 2014 16:18:05 -0700 Subject: macosx: Respond to apple messages in all apps This connects the callbacks in AltosUIFrame to actually do something useful with them. Signed-off-by: Keith Packard --- altosui/AltosUI.java | 15 +++++++++++++++ micropeak/MicroPeak.java | 15 +++++++++++++++ telegps/TeleGPS.java | 24 +++++++++++++++++++++++- 3 files changed, 53 insertions(+), 1 deletion(-) (limited to 'micropeak') diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 1eb03805..0aa5d03c 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -99,10 +99,25 @@ public class AltosUI extends AltosUIFrame { return b; } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + process_graph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + ConfigureAltosUI(); + } + public AltosUI() { load_library(null); + register_for_macosx_events(); + AltosUIPreferences.set_component(this); pane = getContentPane(); diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java index d7d393ba..8bdf4b77 100644 --- a/micropeak/MicroPeak.java +++ b/micropeak/MicroPeak.java @@ -190,10 +190,25 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene public void itemStateChanged(ItemEvent e) { } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + CommandGraph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + Preferences(); + } + public MicroPeak() { ++number_of_windows; + register_for_macosx_events(); + AltosUIPreferences.set_component(this); container = getContentPane(); diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index f765ee23..e78c2124 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -410,16 +410,38 @@ public class TeleGPS private JMenu make_menu(String label, String[][] items) { JMenu menu = new JMenu(label); - for (int i = 0; i < items.length; i++) + for (int i = 0; i < items.length; i++) { + if (MAC_OS_X) { + if (items[i][1].equals("exit")) + continue; + if (items[i][1].equals("preferences")) + continue; + } add_menu(menu, items[i][0], items[i][1]); + } menu_bar.add(menu); return menu; } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + process_graph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + preferences(); + } + public TeleGPS() { AltosUIPreferences.set_component(this); + register_for_macosx_events(); + reader = null; bag = getContentPane(); -- cgit v1.2.3 From 37856672c57f2fd91184c2391a201bbbdc48545e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 19 Jun 2014 10:25:07 -0700 Subject: linux: .desktop files must begin with organization name The spec requires that .desktop files start with the organization name, so I've renamed all of them to altusmetrum-.desktop Signed-off-by: Keith Packard --- altosui/Makefile.am | 6 +++--- altosui/altos.desktop.in | 10 ---------- altosui/altusmetrum-altosui.desktop.in | 11 +++++++++++ micropeak/Makefile.am | 4 ++-- micropeak/altusmetrum-micropeak.desktop.in | 10 ++++++++++ micropeak/micropeak.desktop.in | 10 ---------- telegps/Makefile.am | 8 ++++---- telegps/altusmetrum-telegps.desktop.in | 10 ++++++++++ telegps/telegps.desktop.in | 10 ---------- 9 files changed, 40 insertions(+), 39 deletions(-) delete mode 100644 altosui/altos.desktop.in create mode 100644 altosui/altusmetrum-altosui.desktop.in create mode 100644 micropeak/altusmetrum-micropeak.desktop.in delete mode 100644 micropeak/micropeak.desktop.in create mode 100644 telegps/altusmetrum-telegps.desktop.in delete mode 100644 telegps/telegps.desktop.in (limited to 'micropeak') diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 352fb430..bc074a95 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -64,7 +64,7 @@ LIBALTOS= \ altos.dll desktopdir = $(datadir)/applications -desktop_file = altos.desktop +desktop_file = altusmetrum-altosui.desktop desktop_SCRIPTS = $(desktop_file) JAR=altosui.jar @@ -141,7 +141,7 @@ FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFR LINUX_LIBS=libaltos32.so libaltos64.so -LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) altos.desktop.in ../icon/altusmetrum.svg +LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/altusmetrum.svg LINUX_EXTRA=altosui-fat MACOSX_INFO_PLIST=Info.plist @@ -161,7 +161,7 @@ clean-local: EXTRA_DIST = $(desktop_file).in $(desktop_file): $(desktop_file).in - sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/altos.desktop.in > $@ + sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@ chmod +x $@ if FATINSTALL diff --git a/altosui/altos.desktop.in b/altosui/altos.desktop.in deleted file mode 100644 index 66114348..00000000 --- a/altosui/altos.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Name=AltOS UI -GenericName=Altus Metrum Ground Station -Comment=View and log downlink data from Altus Metrum products -Icon=%icondir%/altusmetrum.svg -Exec=%bindir%/altosui %f -Terminal=false -MimeType=text/plain; -Categories=Education;Electronics;Science; diff --git a/altosui/altusmetrum-altosui.desktop.in b/altosui/altusmetrum-altosui.desktop.in new file mode 100644 index 00000000..716571ce --- /dev/null +++ b/altosui/altusmetrum-altosui.desktop.in @@ -0,0 +1,11 @@ +[Desktop Entry] +Type=Application +Version=1.0 +Name=AltOS UI +GenericName=Altus Metrum Ground Station +Comment=View and log downlink data from Altus Metrum products +Icon=%icondir%/altusmetrum.svg +Exec=%bindir%/altosui %f +Terminal=false +MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom +Categories=Education;Electronics;Science; diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am index 1e09e523..37d5ca63 100644 --- a/micropeak/Makefile.am +++ b/micropeak/Makefile.am @@ -75,7 +75,7 @@ WINDOWS_ICON=$(ICONDIR)/micro-peak.ico $(ICONDIR)/micro-peak.exe MACOSX_ICON=$(ICONDIR)/MicroPeak.icns desktopdir = $(datadir)/applications -desktop_file = micropeak.desktop +desktop_file = altusmetrum-micropeak.desktop desktop_SCRIPTS = $(desktop_file) all-local: micropeak-test micropeak-jdb $(JAR) @@ -92,7 +92,7 @@ clean-local: EXTRA_DIST = $(desktop_file).in $(desktop_file): $(desktop_file).in - sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/micropeak.desktop.in > $@ + sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@ chmod +x $@ LINUX_DIST=MicroPeak-Linux-$(VERSION).tar.bz2 diff --git a/micropeak/altusmetrum-micropeak.desktop.in b/micropeak/altusmetrum-micropeak.desktop.in new file mode 100644 index 00000000..f7d258ec --- /dev/null +++ b/micropeak/altusmetrum-micropeak.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=MicroPeak +GenericName=MicroPeak Download and Analysis +Comment=View and log data from MicroPeak altimeters +Icon=%icondir%/micropeak.svg +Exec=%bindir%/micropeak %f +Terminal=false +MimeType=application/vnd.altusmetrum.micropeak +Categories=Education;Electronics;Science; diff --git a/micropeak/micropeak.desktop.in b/micropeak/micropeak.desktop.in deleted file mode 100644 index abdf286f..00000000 --- a/micropeak/micropeak.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Name=MicroPeak -GenericName=MicroPeak download and analysis -Comment=View and log data from MicroPeak altimeters -Icon=%icondir%/micropeak.svg -Exec=%bindir%/micropeak %f -Terminal=false -MimeType=text/plain; -Categories=Education;Electronics;Science; diff --git a/telegps/Makefile.am b/telegps/Makefile.am index 8868c723..c4f6a58b 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -89,7 +89,7 @@ FIRMWARE_TG=$(FIRMWARE_TG_1_0) FIRMWARE=$(FIRMWARE_TG) $(FIRMWARE_TD) $(FIRMWARE_TBT) desktopdir = $(datadir)/applications -desktop_file = telegps.desktop +desktop_file = altusmetrum-telegps.desktop desktop_SCRIPTS = $(desktop_file) all-local: telegps-test telegps-jdb $(JAR) @@ -106,7 +106,7 @@ clean-local: EXTRA_DIST = $(desktop_file).in $(desktop_file): $(desktop_file).in - sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/telegps.desktop.in > $@ + sed -e 's#%bindir%#@bindir@#' -e 's#%icondir%#$(datadir)/icons/hicolor/scalable/apps#' ${srcdir}/$(desktop_file).in > $@ chmod +x $@ LINUX_DIST=TeleGPS-Linux-$(VERSION).tar.bz2 @@ -120,8 +120,8 @@ DOC=$(TELEGPS_DOC) FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) -LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) telegps.desktop.in ../icon/telegps.svg -LINUX_EXTRA=telegps-fat telegps.desktop.in +LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/telegps.svg +LINUX_EXTRA=telegps-fat $(desktop_file).in MACOSX_INFO_PLIST=Info.plist MACOSX_README=ReadMe-Mac.rtf diff --git a/telegps/altusmetrum-telegps.desktop.in b/telegps/altusmetrum-telegps.desktop.in new file mode 100644 index 00000000..76c1eb42 --- /dev/null +++ b/telegps/altusmetrum-telegps.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=TeleGPS +GenericName=TeleGPS monitor, download and analysis +Comment=View and log data from TeleGPS tracking devices +Icon=%icondir%/telegps.svg +Exec=%bindir%/telegps %f +Terminal=false +MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom +Categories=Education;Electronics;Science; diff --git a/telegps/telegps.desktop.in b/telegps/telegps.desktop.in deleted file mode 100644 index 3d249d8a..00000000 --- a/telegps/telegps.desktop.in +++ /dev/null @@ -1,10 +0,0 @@ -[Desktop Entry] -Type=Application -Name=TeleGPS -GenericName=TeleGPS monitor, download and analysis -Comment=View and log data from TeleGPS tracking devices -Icon=%icondir%/telegps.svg -Exec=%bindir%/telegps %f -Terminal=false -MimeType=text/plain; -Categories=Education;Electronics;Science; -- cgit v1.2.3 From 1b0f56ddb2b85b68232c22a7a8b8744cb9ad76f9 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 19 Jun 2014 14:33:27 -0700 Subject: Rename icon files to fit XDG specifications. Add file icons. Add mime types Our SVG icons now follow XDG standards by including a vendor prefix. The new file type icons include application-vnd.altusmetrum as a prefix so that they match the mime types declared. Signed-off-by: Keith Packard --- altosui/.gitignore | 2 +- altosui/Info.plist.in | 6 +- altosui/Makefile.am | 52 +-- altosui/altos-windows.nsi.in | 83 +++-- altosui/altusmetrum-altosui.desktop.in | 2 +- icon/.gitignore | 6 +- icon/Makefile.am | 156 +++++--- icon/altus-metrum.rc | 1 - icon/altusmetrum-altosui.svg | 250 +++++++++++++ icon/altusmetrum-micropeak.svg | 219 ++++++++++++ icon/altusmetrum-telegps.svg | 324 +++++++++++++++++ icon/altusmetrum.svg | 250 ------------- icon/application-vnd.altusmetrum.eeprom.svg | 397 +++++++++++++++++++++ icon/application-vnd.altusmetrum.micropeak.svg | 1 + icon/application-vnd.altusmetrum.telemetry.svg | 397 +++++++++++++++++++++ icon/creating-linux-icons | 29 ++ icon/micro-peak.rc | 1 - icon/micropeak.svg | 219 ------------ icon/org-altusmetrum-mimetypes.xml | 16 + icon/telegps.rc | 1 - icon/telegps.svg | 324 ----------------- micropeak/.gitignore | 2 +- micropeak/Info.plist.in | 4 +- micropeak/Makefile.am | 48 +-- .../Contents/Resources/MicroPeak.icns | Bin 133711 -> 0 bytes micropeak/altusmetrum-micropeak.desktop.in | 2 +- micropeak/micropeak-windows.nsi.in | 51 +-- telegps/.gitignore | 2 +- telegps/Info.plist.in | 6 +- telegps/Makefile.am | 51 +-- telegps/altusmetrum-telegps.desktop.in | 2 +- telegps/telegps-windows.nsi.in | 83 +++-- 32 files changed, 1975 insertions(+), 1012 deletions(-) delete mode 100644 icon/altus-metrum.rc create mode 100644 icon/altusmetrum-altosui.svg create mode 100644 icon/altusmetrum-micropeak.svg create mode 100644 icon/altusmetrum-telegps.svg delete mode 100644 icon/altusmetrum.svg create mode 100644 icon/application-vnd.altusmetrum.eeprom.svg create mode 120000 icon/application-vnd.altusmetrum.micropeak.svg create mode 100644 icon/application-vnd.altusmetrum.telemetry.svg create mode 100644 icon/creating-linux-icons delete mode 100644 icon/micro-peak.rc delete mode 100644 icon/micropeak.svg create mode 100644 icon/org-altusmetrum-mimetypes.xml delete mode 100644 icon/telegps.rc delete mode 100644 icon/telegps.svg delete mode 100644 micropeak/MicroPeak.app/Contents/Resources/MicroPeak.icns (limited to 'micropeak') diff --git a/altosui/.gitignore b/altosui/.gitignore index 10b600e4..b0c8264b 100644 --- a/altosui/.gitignore +++ b/altosui/.gitignore @@ -17,7 +17,7 @@ Altos-Linux-*.tar.bz2 Altos-Linux-*.sh Altos-Mac-*.zip Altos-Windows-*.exe -altos.desktop +altusmetrum-altosui.desktop *.dll *.dylib *.so diff --git a/altosui/Info.plist.in b/altosui/Info.plist.in index bae6d52c..8dc797d6 100644 --- a/altosui/Info.plist.in +++ b/altosui/Info.plist.in @@ -23,14 +23,14 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleIconFile - AltosUIIcon.icns + altusmetrum-altosui.icns CFBundleDocumentTypes CFBundleTypeName Telemetry CFBundleTypeIconFile - AltosUIIcon.icns + application-vnd.altusmetrum.telemetry.icns CFBundleTypeExtensions telem @@ -42,7 +42,7 @@ CFBundleTypeName Eeprom CFBundleTypeIconFile - AltosUIIcon.icns + application-vnd.altusmetrum.eeprom.icns CFBundleTypeExtensions eeprom diff --git a/altosui/Makefile.am b/altosui/Makefile.am index bc074a95..45d75699 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -72,26 +72,37 @@ JAR=altosui.jar FATJAR=altosui-fat.jar # Icons -ICONDIR=$(top_srcdir)/icon +ICONDIR=../icon JAVA_ICONS=\ - $(ICONDIR)/altus-metrum-16.png \ - $(ICONDIR)/altus-metrum-32.png \ - $(ICONDIR)/altus-metrum-48.png \ - $(ICONDIR)/altus-metrum-64.png \ - $(ICONDIR)/altus-metrum-128.png \ - $(ICONDIR)/altus-metrum-256.png + $(ICONDIR)/altusmetrum-altosui-16.png \ + $(ICONDIR)/altusmetrum-altosui-32.png \ + $(ICONDIR)/altusmetrum-altosui-48.png \ + $(ICONDIR)/altusmetrum-altosui-64.png \ + $(ICONDIR)/altusmetrum-altosui-128.png\ + $(ICONDIR)/altusmetrum-altosui-256.png # icon base names for jar -ICONJAR= -C $(ICONDIR) altus-metrum-16.png \ - -C $(ICONDIR) altus-metrum-32.png \ - -C $(ICONDIR) altus-metrum-48.png \ - -C $(ICONDIR) altus-metrum-64.png \ - -C $(ICONDIR) altus-metrum-128.png \ - -C $(ICONDIR) altus-metrum-256.png - -WINDOWS_ICON=$(ICONDIR)/altus-metrum.ico $(ICONDIR)/altus-metrum.exe -MACOSX_ICON=$(ICONDIR)/AltosUIIcon.icns +ICONJAR= \ + -C $(ICONDIR) altusmetrum-altosui-16.png \ + -C $(ICONDIR) altusmetrum-altosui-32.png \ + -C $(ICONDIR) altusmetrum-altosui-48.png \ + -C $(ICONDIR) altusmetrum-altosui-64.png \ + -C $(ICONDIR) altusmetrum-altosui-128.png\ + -C $(ICONDIR) altusmetrum-altosui-256.png + +WINDOWS_ICONS =\ + $(ICONDIR)/altusmetrum-altosui.ico \ + $(ICONDIR)/altusmetrum-altosui.exe + $(ICONDIR)/application-vnd.altusmetrum.eeprom.ico \ + $(ICONDIR)/application-vnd.altusmetrum.eeprom.exe \ + $(ICONDIR)/application-vnd.altusmetrum.telemetry.ico \ + $(ICONDIR)/application-vnd.altusmetrum.telemetry.exe + +MACOSX_ICONS =\ + $(ICONDIR)/altusmetrum-altosui.icns \ + $(ICONDIR)/application-vnd.altusmetrum.eeprom.icns \ + $(ICONDIR)/application-vnd.altusmetrum.telemetry.icns # Firmware FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx @@ -141,14 +152,14 @@ FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFR LINUX_LIBS=libaltos32.so libaltos64.so -LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/altusmetrum.svg +LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(ICONDIR)/altusmetrum-altosui.svg LINUX_EXTRA=altosui-fat MACOSX_INFO_PLIST=Info.plist -MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICON) +MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(DOC) ReadMe-Mac.rtf $(MACOSX_ICONS) MACOSX_EXTRA=$(FIRMWARE) -WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICON) +WINDOWS_FILES=$(FAT_FILES) $(FIRMWARE) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(WINDOWS_ICONS) all-local: classes/altosui $(JAR) altosui altosui-test altosui-jdb @@ -195,7 +206,6 @@ else fat: $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) $(WINDOWS_DIST) endif - altosuidir=$(datadir)/java install-altosuiJAVA: altosui.jar @@ -325,7 +335,7 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile cp -a $(DOC) macosx/Doc cp -p Info.plist macosx/AltosUI.app/Contents mkdir -p macosx/AltOS-$(VERSION) macosx/AltosUI.app/Contents/Resources/Java - cp -p $(MACOSX_ICON) macosx/AltosUI.app/Contents/Resources + cp -p $(MACOSX_ICONS) macosx/AltosUI.app/Contents/Resources cp -p $(FATJAR) macosx/AltosUI.app/Contents/Resources/Java/altosui.jar cp -p libaltos.dylib macosx/AltosUI.app/Contents/Resources/Java cp -p $(ALTOSLIB_CLASS) macosx/AltosUI.app/Contents/Resources/Java diff --git a/altosui/altos-windows.nsi.in b/altosui/altos-windows.nsi.in index c6da097e..07de5b13 100644 --- a/altosui/altos-windows.nsi.in +++ b/altosui/altos-windows.nsi.in @@ -4,12 +4,14 @@ !include java.nsh !include refresh-sh.nsh -!define REG_NAME "Altus Metrum" -!define PROG_ID "org.altusmetrum.altosui.1" -!define PROG_ALTOSUI "org.altusmetrum.altosui.1" -!define FAT_NAME "altosui-fat.jar" -!define ICO_ICO "altus-metrum.ico" -!define ICO_EXE "altus-metrum.exe" +!define REG_NAME "Altus Metrum" +!define PROG_ID_TELEM "altusmetrum.altosui.telem.1" +!define PROG_ID_EEPROM "altusmetrum.altosui.eeprom.1" +!define FAT_NAME "altosui-fat.jar" +!define WIN_APP_ICON "altusmetrum-altosui.ico" +!define WIN_APP_EXE "altusmetrum-altosui.exe" +!define WIN_TELEM_EXE "application-vnd.altusmetrum.telemetry.exe" +!define WIN_EEPROM_EXE "application-vnd.altusmetrum.eeprom.exe" Name "${REG_NAME} Installer" @@ -104,13 +106,13 @@ Section "${REG_NAME} Application" File "*.dll" - File "../icon/${ICO_ICO}" + File "../icon/${WIN_APP_ICON}" - CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${ICO_ICO}" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "${REG_NAME} Desktop Shortcut" - CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${ICO_ICO}" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "TeleMetrum, TeleDongle and TeleBT Firmware" @@ -145,35 +147,51 @@ SectionEnd Section "File Associations" + ${DisableX64FSRedirection} + SetOutPath $INSTDIR - File "../icon/${ICO_EXE}" + File "../icon/${WIN_APP_EXE}" + File "../icon/${WIN_TELEM_EXE}" + File "../icon/${WIN_EEPROM_EXE}" - ; application elements - - WriteRegStr HKCR "${PROG_ID}" "" "Altus Metrum Data File" - WriteRegStr HKCR "${PROG_ID}" "FriendlyTypeName" "Altus Metrum Data File" - WriteRegStr HKCR "${PROG_ID}\CurVer" "" "${PROG_ID}" - WriteRegStr HKCR "${PROG_ID}\DefaultIcon" "" '"$INSTDIR\${ICO_EXE}",-101' - WriteRegExpandStr HKCR "${PROG_ID}\shell\play\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + 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}" ; .eeprom elements - WriteRegStr HKCR ".eeprom" "" "${PROG_ALTOSUI}" + 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"' + + WriteRegStr HKCR ".eeprom" "" "${PROG_ID_EEPROM}" WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File" - WriteRegStr HKCR ".eeprom" "Content Type" "application/altosui" + WriteRegStr HKCR ".eeprom" "Content Type" "application/vnd.altusmetrum.eeprom" - WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" "" - WriteRegStr HKCR ".eeprom\${PROG_ID}" "" "${REG_NAME}" + WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" "" + WriteRegStr HKCR ".eeprom\${PROG_ID_EEPROM}" "" "${REG_NAME}" ; .telem elements - WriteRegStr HKCR ".telem" "" "${PROG_ALTOSUI}" + 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" "" '"%SYSTEMROOT%\System32\javaw.exe" -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/altosui" + WriteRegStr HKCR ".telem" "Content Type" "application/vnd.altusmetrum.telemetry" - WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID}" "" - WriteRegStr HKCR ".telem\${PROG_ID}" "" "${REG_NAME}" + WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" "" + WriteRegStr HKCR ".telem\${PROG_ID_TELEM}" "" "${REG_NAME}" Call RefreshShellIcons SectionEnd @@ -206,21 +224,22 @@ Section "Uninstall" DetailPrint "Delete uninstall reg entries" - DeleteRegKey HKCR "${PROG_ID}" + DeleteRegKey HKCR "${PROG_ID_EEPROM}" + DeleteRegKey HKCR "${PROG_ID_TELEM}" - DeleteRegKey HKCR ".eeprom\${PROG_ID}" - DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" + DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}" + DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" - DeleteRegKey HKCR ".telem\${PROG_ID}" - DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID}" + DeleteRegKey HKCR ".telem\${PROG_ID_TELEM}" + DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" DetailPrint "Delete file association reg entries" Delete "$INSTDIR\${FAT_NAME}" Delete "$INSTDIR\uninstall-${REG_NAME}.exe" - Delete "$INSTDIR\${ICO_ICO}" - Delete "$INSTDIR\${ICO_EXE}" + Delete "$INSTDIR\${WIN_APP_ICON}" + Delete "$INSTDIR\${WIN_APP_EXE}" ; Remove shortcuts, if any Delete "$SMPROGRAMS\${REG_NAME}.lnk" diff --git a/altosui/altusmetrum-altosui.desktop.in b/altosui/altusmetrum-altosui.desktop.in index 716571ce..10fd9e9d 100644 --- a/altosui/altusmetrum-altosui.desktop.in +++ b/altosui/altusmetrum-altosui.desktop.in @@ -4,7 +4,7 @@ Version=1.0 Name=AltOS UI GenericName=Altus Metrum Ground Station Comment=View and log downlink data from Altus Metrum products -Icon=%icondir%/altusmetrum.svg +Icon=%icondir%/altusmetrum-altosui.svg Exec=%bindir%/altosui %f Terminal=false MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom diff --git a/icon/.gitignore b/icon/.gitignore index 40cf2f3e..94c7c70c 100644 --- a/icon/.gitignore +++ b/icon/.gitignore @@ -1,6 +1,6 @@ -altus-metrum-*.png -micropeak-*.png -telegps-*.png +application-*.png +altusmetrum-*.png +*.rc *.ico *.icns *.build diff --git a/icon/Makefile.am b/icon/Makefile.am index 61a16914..516c547c 100644 --- a/icon/Makefile.am +++ b/icon/Makefile.am @@ -3,85 +3,137 @@ MAC_RES=16 32 128 256 512 WIN_RES=16 24 32 48 64 72 96 128 180 256 RES=$(shell echo $(JAVA_RES) $(MAC_RES) $(WIN_RES) | awk '{ for (i = 1; i <= NF; i++) printf("%s\n", $$i); }' | sort -n -u) -AM_FILES=$(shell for i in $(RES); do echo altus-metrum-$$i.png; done) -MP_FILES=$(shell for i in $(RES); do echo micropeak-$$i.png; done) -TG_FILES=$(shell for i in $(RES); do echo telegps-$$i.png; done) +# Application icon base names -MAC_TG_FILES=$(shell for i in $(MAC_RES); do echo telegps-$$i.png; done) -MAC_MP_FILES=$(shell for i in $(MAC_RES); do echo micropeak-$$i.png; done) -MAC_AM_FILES=$(shell for i in $(MAC_RES); do echo altus-metrum-$$i.png; done) +AM_NAME = altusmetrum-altosui +MP_NAME = altusmetrum-micropeak +TG_NAME = altusmetrum-telegps -WIN_TG_FILES=$(shell for i in $(WIN_RES); do echo telegps-$$i.png; done) -WIN_MP_FILES=$(shell for i in $(WIN_RES); do echo micropeak-$$i.png; done) -WIN_AM_FILES=$(shell for i in $(WIN_RES); do echo altus-metrum-$$i.png; done) +# File icon base names -ICO_FILES=altus-metrum.ico micro-peak.ico telegps.ico -ICNS_FILES=AltosUIIcon.icns TeleGPS.icns MicroPeak.icns +EEPROM_NAME = application-vnd.altusmetrum.eeprom +TELEM_NAME = application-vnd.altusmetrum.telemetry +MPD_NAME = application-vnd.altusmetrum.micropeak -icondir = $(datadir)/icons/hicolor/scalable/apps +# Application icons -AM_ICON = altusmetrum.svg -MP_ICON = micropeak.svg -TG_ICON = telegps.svg +AM_ICON = $(AM_NAME).svg +MP_ICON = $(MP_NAME).svg +TG_ICON = $(TG_NAME).svg -icon_DATA = $(AM_ICON) $(MP_ICON) $(TG_ICON) +# File icons (note that MicroPeak uses the application icon for files) -EXTRA_DIST = $(icon_DATA) $(AM_FILES) $(MP_FILES) $(TG_FILES) +EEPROM_ICON = $(EEPROM_NAME).svg +TELEM_ICON = $(TELEM_NAME).svg +MPD_ICON = $(MPD_NAME).svg -res: - echo $(RES) +# Files needed for Mac OSX icons -all-local: $(ICO_FILES) $(ICNS_FILES) +MAC_AM_FILES = $(shell for i in $(MAC_RES); do echo $(AM_NAME)-$$i.png; done) +MAC_MP_FILES = $(shell for i in $(MAC_RES); do echo $(MP_NAME)-$$i.png; done) +MAC_TG_FILES = $(shell for i in $(MAC_RES); do echo $(TG_NAME)-$$i.png; done) +MAC_EEPROM_FILES= $(shell for i in $(MAC_RES); do echo $(EEPROM_NAME)-$$i.png; done) +MAC_TELEM_FILES = $(shell for i in $(MAC_RES); do echo $(TELEM_NAME)-$$i.png; done) +MAC_MPD_FILES = $(shell for i in $(MAC_RES); do echo $(MPD_NAME)-$$i.png; done) -clean-local: - $(RM) altus-metrum-*.png telegps-*.png micropeak-*.png *.build *.ico *.icns *.o *.exe +ICNS_FILES = $(AM_NAME).icns $(MP_NAME).icns $(TG_NAME).icns \ + $(EEPROM_NAME).icns $(TELEM_NAME).icns $(MPD_NAME).icns -$(AM_FILES): altusmetrum.build +# Files needed for Windows icons -altusmetrum.build: altusmetrum.svg - for i in $(RES); do rsvg-convert -w $$i -h $$i -o altus-metrum-$$i.png altusmetrum.svg; done && touch $@ +WIN_AM_FILES = $(shell for i in $(WIN_RES); do echo $(AM_NAME)-$$i.png; done) +WIN_MP_FILES = $(shell for i in $(WIN_RES); do echo $(MP_NAME)-$$i.png; done) +WIN_TG_FILES = $(shell for i in $(WIN_RES); do echo $(TG_NAME)-$$i.png; done) +WIN_EEPROM_FILES= $(shell for i in $(WIN_RES); do echo $(EEPROM_NAME)-$$i.png; done) +WIN_TELEM_FILES = $(shell for i in $(WIN_RES); do echo $(TELEM_NAME)-$$i.png; done) +WIN_MPD_FILES = $(shell for i in $(WIN_RES); do echo $(MPD_NAME)-$$i.png; done) -$(TG_FILES): telegps.build +ICO_FILES = $(AM_NAME).ico $(MP_NAME).ico $(TG_NAME).ico \ + $(EEPROM_NAME).ico $(TELEM_NAME).ico $(MPD_NAME).ico -telegps.build: telegps.svg - for i in $(RES); do rsvg-convert -w $$i -h $$i -o telegps-$$i.png telegps.svg; done && touch $@ +EXE_FILES = $(AM_NAME).exe $(MP_NAME).exe $(TG_NAME).exe \ + $(EEPROM_NAME).exe $(TELEM_NAME).exe $(MPD_NAME).exe -$(MP_FILES): micropeak.build +# Files needed for Java internal icons -micropeak.build: micropeak.svg - for i in $(RES); do rsvg-convert -w $$i -h $$i -o micropeak-$$i.png micropeak.svg; done && touch $@ +JAVA_AM_FILES = $(shell for i in $(JAVA_RES); do echo $(AM_NAME)-$$i.png; done) +JAVA_MP_FILES = $(shell for i in $(JAVA_RES); do echo $(MP_NAME)-$$i.png; done) +JAVA_TG_FILES = $(shell for i in $(JAVA_RES); do echo $(TG_NAME)-$$i.png; done) -#clean-local: -# $(RM) -f $(ICO_FILES) +JAVA_FILES = $(JAVA_AM_FILES) $(JAVA_MP_FILES) $(JAVA_TG_FILES) -altus-metrum.ico: $(WIN_AM_FILES) - icotool -c -o $@ $(WIN_AM_FILES) +# PNG files needed by anyone -micro-peak.ico: $(WIN_MP_FILES) - icotool -c -o $@ $(WIN_MP_FILES) +AM_FILES = $(shell for i in $(RES); do echo $(AM_NAME)-$$i.png; done) +MP_FILES = $(shell for i in $(RES); do echo $(MP_NAME)-$$i.png; done) +TG_FILES = $(shell for i in $(RES); do echo $(TG_NAME)-$$i.png; done) +EEPROM_FILES = $(shell for i in $(RES); do echo $(EEPROM_NAME)-$$i.png; done) +TELEM_FILES = $(shell for i in $(RES); do echo $(TELEM_NAME)-$$i.png; done) +IN_MPD_FILES = $(shell for i in $(RES); do echo $(MPD_NAME)-$$i.png; done) -telegps.ico: $(WIN_TG_FILES) - icotool -c -o $@ $(WIN_TG_FILES) +ICON_THEME=$(datadir)/icons/hicolor -AltosUIIcon.icns: $(MAC_AM_FILES) - png2icns $@ $(MAC_AM_FILES) +appicondir = $(ICON_THEME)/scalable/apps +appicon_DATA = $(AM_ICON) $(MP_ICON) $(TG_ICON) -TeleGPS.icns: $(MAC_TG_FILES) - png2icns $@ $(MAC_TG_FILES) +MIME_ICONS = $(EEPROM_ICON) $(TELEM_ICON) $(MPD_ICON) -MicroPeak.icns: $(MAC_MP_FILES) - png2icns $@ $(MAC_MP_FILES) +mimeicondir = $(ICON_THEME)/scalable/mimetypes +mimeicon_DATA = $(MIME_ICONS) -MINGCC32=i686-w64-mingw32-gcc -MINGWINDRES=i686-w64-mingw32-windres +mimedir = $(datadir)/mime/packages +mime_DATA = org-altusmetrum-mimetypes.xml + +EXTRA_DIST = $(appicon_DATA) $(mimeicon_DATA) $(mime_DATA) windows-stub.c + +res: + echo $(RES) + +java-altosui: + @echo $(JAVA_AM_FILES) + +java-micropeak: + @echo $(JAVA_MP_FILES) + +java-telegps: + @echo $(JAVA_TG_FILES) -SUFFIXES=.rc .exe +fat: all $(ICO_FILES) $(ICNS_FILES) $(EXE_FILES) -fat: all micro-peak.exe altus-metrum.exe telegps.exe +all-local: $(JAVA_FILES) -altus-metrum.o: altus-metrum.ico -micro-peak.o: micro-peak.ico -telegps.o: telegps.ico +clean-local: + $(RM) $(AM_NAME)-*.png $(TG_NAME)-*.png $(MP_NAME)-*.png + $(RM) $(EEPROM_NAME)-*.png $(TELEM_NAME)-*.png $(MPD_NAME)-*.png + $(RM) *.build *.ico *.rc *.icns *.o *.exe $(MPD_ICON) + +install-data-hook: + update-mime-database $(datadir)/mime + update-icon-caches $(ICON_THEME) + +$(MPD_ICON): $(MP_ICON) + $(LN_S) $(MP_ICON) $@ + +$(AM_FILES): $(AM_NAME).build +$(MP_FILES): $(MP_NAME).build +$(TG_FILES): $(TG_NAME).build + +SUFFIXES=.svg .build .icns .ico .rc .o .exe + +.svg.build: + for i in $(RES); do rsvg-convert -w $$i -h $$i -o $*-$$i.png $*.svg; done && touch $@ + +.build.icns: + png2icns $@ $(shell for i in $(MAC_RES); do echo $*-$$i.png; done) + +.build.ico: + icotool -c -o $@ $(shell for i in $(WIN_RES); do echo $*-$$i.png; done) + +.ico.rc: + echo '101 ICON "$*.ico"' > $@ + +MINGCC32=i686-w64-mingw32-gcc +MINGWINDRES=i686-w64-mingw32-windres .rc.o: $(MINGWINDRES) $*.rc $@ diff --git a/icon/altus-metrum.rc b/icon/altus-metrum.rc deleted file mode 100644 index bbd03604..00000000 --- a/icon/altus-metrum.rc +++ /dev/null @@ -1 +0,0 @@ -101 ICON "altus-metrum.ico" diff --git a/icon/altusmetrum-altosui.svg b/icon/altusmetrum-altosui.svg new file mode 100644 index 00000000..e8935a65 --- /dev/null +++ b/icon/altusmetrum-altosui.svg @@ -0,0 +1,250 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icon/altusmetrum-micropeak.svg b/icon/altusmetrum-micropeak.svg new file mode 100644 index 00000000..d37130f5 --- /dev/null +++ b/icon/altusmetrum-micropeak.svg @@ -0,0 +1,219 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/icon/altusmetrum-telegps.svg b/icon/altusmetrum-telegps.svg new file mode 100644 index 00000000..1e390f3b --- /dev/null +++ b/icon/altusmetrum-telegps.svg @@ -0,0 +1,324 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/icon/altusmetrum.svg b/icon/altusmetrum.svg deleted file mode 100644 index e8935a65..00000000 --- a/icon/altusmetrum.svg +++ /dev/null @@ -1,250 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/icon/application-vnd.altusmetrum.eeprom.svg b/icon/application-vnd.altusmetrum.eeprom.svg new file mode 100644 index 00000000..7b481cdc --- /dev/null +++ b/icon/application-vnd.altusmetrum.eeprom.svg @@ -0,0 +1,397 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icon/application-vnd.altusmetrum.micropeak.svg b/icon/application-vnd.altusmetrum.micropeak.svg new file mode 120000 index 00000000..6efd3200 --- /dev/null +++ b/icon/application-vnd.altusmetrum.micropeak.svg @@ -0,0 +1 @@ +altusmetrum-micropeak.svg \ No newline at end of file diff --git a/icon/application-vnd.altusmetrum.telemetry.svg b/icon/application-vnd.altusmetrum.telemetry.svg new file mode 100644 index 00000000..4bcc0850 --- /dev/null +++ b/icon/application-vnd.altusmetrum.telemetry.svg @@ -0,0 +1,397 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/icon/creating-linux-icons b/icon/creating-linux-icons new file mode 100644 index 00000000..5b034c09 --- /dev/null +++ b/icon/creating-linux-icons @@ -0,0 +1,29 @@ +# To create linux icons and file associations + +1) Create mime type and install + + http://www.freedesktop.org/wiki/Specifications/AddingMIMETutor/ + + # xdg-mime install --mode system org-altusmetrum-mimetypes.xml + # update-mime-database /usr/local/share/mime + + On debian, + +2) Create icons and install + + For mime type application/vnd.altusmetrum.telemetry + icon name application-vnd.altusmetrum.telemetry.svg + + All mime icons go in + + /usr/share/icons/hicolor/scalable/mimetypes + + Update the icon database + + # update-icon-caches /usr/share/icons/hicolor + +3) Create .desktop file and install + + # xdg-desktop-menu install --mode system altusmetrum-altosui.desktop + + # update-desktop-database diff --git a/icon/micro-peak.rc b/icon/micro-peak.rc deleted file mode 100644 index 4efe777d..00000000 --- a/icon/micro-peak.rc +++ /dev/null @@ -1 +0,0 @@ -101 ICON "micro-peak.ico" diff --git a/icon/micropeak.svg b/icon/micropeak.svg deleted file mode 100644 index d37130f5..00000000 --- a/icon/micropeak.svg +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - diff --git a/icon/org-altusmetrum-mimetypes.xml b/icon/org-altusmetrum-mimetypes.xml new file mode 100644 index 00000000..e8103c03 --- /dev/null +++ b/icon/org-altusmetrum-mimetypes.xml @@ -0,0 +1,16 @@ + + + + Altus Metrum Telemetry File + + + + Altus Metrum Eeprom Log File + + + + Altus Metrum MicroPeak Log File + + + diff --git a/icon/telegps.rc b/icon/telegps.rc deleted file mode 100644 index 7f5957f9..00000000 --- a/icon/telegps.rc +++ /dev/null @@ -1 +0,0 @@ -101 ICON "telegps.ico" diff --git a/icon/telegps.svg b/icon/telegps.svg deleted file mode 100644 index 1e390f3b..00000000 --- a/icon/telegps.svg +++ /dev/null @@ -1,324 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/micropeak/.gitignore b/micropeak/.gitignore index f9a61359..81dd0749 100644 --- a/micropeak/.gitignore +++ b/micropeak/.gitignore @@ -11,7 +11,7 @@ micropeak-windows.nsi MicroPeak-Linux-* MicroPeak-Mac-* MicroPeak-Windows-* -micropeak.desktop +altusmetrum-micropeak.desktop *.dll *.dylib *.so diff --git a/micropeak/Info.plist.in b/micropeak/Info.plist.in index 8f751079..b1dc6cea 100644 --- a/micropeak/Info.plist.in +++ b/micropeak/Info.plist.in @@ -23,14 +23,14 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleIconFile - MicroPeak.icns + altusmetrum-micropeak.icns CFBundleDocumentTypes CFBundleTypeName MicroPeak data file CFBundleTypeIconFile - MicroPeak.icns + application-vnd.altusmetrum.micropeak.icns CFBundleTypeExtensions mpd diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am index 37d5ca63..6270fd74 100644 --- a/micropeak/Makefile.am +++ b/micropeak/Makefile.am @@ -56,23 +56,31 @@ ALTOSUILIB_CLASS=\ ICONDIR=$(top_srcdir)/icon JAVA_ICONS=\ - $(ICONDIR)/micropeak-16.png \ - $(ICONDIR)/micropeak-32.png \ - $(ICONDIR)/micropeak-48.png \ - $(ICONDIR)/micropeak-64.png \ - $(ICONDIR)/micropeak-128.png \ - $(ICONDIR)/micropeak-256.png + $(ICONDIR)/altusmetrum-micropeak-16.png \ + $(ICONDIR)/altusmetrum-micropeak-32.png \ + $(ICONDIR)/altusmetrum-micropeak-48.png \ + $(ICONDIR)/altusmetrum-micropeak-64.png \ + $(ICONDIR)/altusmetrum-micropeak-128.png\ + $(ICONDIR)/altusmetrum-micropeak-256.png # icon base names for jar -ICONJAR= -C $(ICONDIR) micropeak-16.png \ - -C $(ICONDIR) micropeak-32.png \ - -C $(ICONDIR) micropeak-48.png \ - -C $(ICONDIR) micropeak-64.png \ - -C $(ICONDIR) micropeak-128.png \ - -C $(ICONDIR) micropeak-256.png - -WINDOWS_ICON=$(ICONDIR)/micro-peak.ico $(ICONDIR)/micro-peak.exe -MACOSX_ICON=$(ICONDIR)/MicroPeak.icns +ICONJAR= \ + -C $(ICONDIR) altusmetrum-micropeak-16.png \ + -C $(ICONDIR) altusmetrum-micropeak-32.png \ + -C $(ICONDIR) altusmetrum-micropeak-48.png \ + -C $(ICONDIR) altusmetrum-micropeak-64.png \ + -C $(ICONDIR) altusmetrum-micropeak-128.png\ + -C $(ICONDIR) altusmetrum-micropeak-256.png + +WINDOWS_ICONS =\ + ../icon/altusmetrum-micropeak.ico \ + ../icon/altusmetrum-micropeak.exe + ../icon/application-vnd.altusmetrum.micropeak.ico \ + ../icon/application-vnd.altusmetrum.micropeak.ico + +MACOSX_ICONS =\ + ../icon/altusmetrum-micropeak.icns \ + ../icon/application-vnd.altusmetrum.micropeak.icns desktopdir = $(datadir)/applications desktop_file = altusmetrum-micropeak.desktop @@ -106,14 +114,14 @@ DOC=$(MICROPEAK_DOC) FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) -LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) micropeak.desktop.in ../icon/micropeak.svg -LINUX_EXTRA=micropeak-fat micropeak.desktop.in +LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/altusmetrum-micropeak.svg +LINUX_EXTRA=micropeak-fat $(desktop_file).in MACOSX_DRIVER_URL=http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_2_18.dmg MACOSX_DRIVER=FTDIUSBSerialDriver_v2_2_18.dmg MACOSX_INFO_PLIST=Info.plist MACOSX_README=ReadMe-Mac.rtf -MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_DRIVER) $(MACOSX_README) $(DOC) $(MACOSX_ICON) +MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_DRIVER) $(MACOSX_README) $(DOC) $(MACOSX_ICONS) $(MACOSX_DRIVER): wget $(MACOSX_DRIVER_URL) @@ -124,7 +132,7 @@ WINDOWS_DRIVER=CDM20824_Setup.exe $(WINDOWS_DRIVER): wget $(WINDOWS_DRIVER_URL) -WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(DOC) $(WINDOWS_ICON) $(WINDOWS_DRIVER) +WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(DOC) $(WINDOWS_ICONS) $(WINDOWS_DRIVER) if FATINSTALL @@ -261,7 +269,7 @@ $(MACOSX_DIST): $(MACOSX_FILES) cp -p Info.plist macosx/MicroPeak.app/Contents cp -p $(MACOSX_DRIVER) macosx mkdir -p macosx/MicroPeak.app/Contents/Resources/Java - cp -p $(MACOSX_ICON) macosx/MicroPeak.app/Contents/Resources + cp -p $(MACOSX_ICONS) macosx/MicroPeak.app/Contents/Resources cp -p $(FATJAR) macosx/MicroPeak.app/Contents/Resources/Java/micropeak.jar cp -p libaltos.dylib macosx/MicroPeak.app/Contents/Resources/Java cp -p $(ALTOSLIB_CLASS) macosx/MicroPeak.app/Contents/Resources/Java diff --git a/micropeak/MicroPeak.app/Contents/Resources/MicroPeak.icns b/micropeak/MicroPeak.app/Contents/Resources/MicroPeak.icns deleted file mode 100644 index 9ba83bf5..00000000 Binary files a/micropeak/MicroPeak.app/Contents/Resources/MicroPeak.icns and /dev/null differ diff --git a/micropeak/altusmetrum-micropeak.desktop.in b/micropeak/altusmetrum-micropeak.desktop.in index f7d258ec..782b4704 100644 --- a/micropeak/altusmetrum-micropeak.desktop.in +++ b/micropeak/altusmetrum-micropeak.desktop.in @@ -3,7 +3,7 @@ Type=Application Name=MicroPeak GenericName=MicroPeak Download and Analysis Comment=View and log data from MicroPeak altimeters -Icon=%icondir%/micropeak.svg +Icon=%icondir%/altusmetrum-micropeak.svg Exec=%bindir%/micropeak %f Terminal=false MimeType=application/vnd.altusmetrum.micropeak diff --git a/micropeak/micropeak-windows.nsi.in b/micropeak/micropeak-windows.nsi.in index d8e47505..848523b0 100644 --- a/micropeak/micropeak-windows.nsi.in +++ b/micropeak/micropeak-windows.nsi.in @@ -4,11 +4,13 @@ !include java.nsh !include refresh-sh.nsh -!define REG_NAME "MicroPeak" -!define PROG_ID "org.altusmetrum.micropeak.1" -!define FAT_NAME "micropeak-fat.jar" -!define ICO_ICO "micro-peak.ico" -!define ICO_EXE "micro-peak.exe" +!define REG_NAME "MicroPeak" +!define PROG_ID "org.altusmetrum.micropeak.1" +!define PROG_ID_MPD "org.altusmetrum.micropeak.mpd.1" +!define FAT_NAME "micropeak-fat.jar" +!define WIN_APP_ICON "altusmetrum-micropeak.ico" +!define WIN_APP_EXE "altusmetrum-micropeak.exe" +!define WIN_MPD_EXE "application-vnd.altusmetrum.micropeak.exe" Name "${REG_NAME} Installer" @@ -82,13 +84,13 @@ Section "${REG_NAME} Application" File "*.dll" - File "../icon/${ICO_ICO}" + File "../icon/${WIN_APP_ICON}" - CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${ICO_ICO}" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "${REG_NAME} Desktop Shortcut" - CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${ICO_ICO}" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "Documentation" @@ -102,24 +104,28 @@ Section "File Associations" SetOutPath $INSTDIR - File "../icon/${ICO_EXE}" + File "../icon/${WIN_APP_EXE}" + File "../icon/${WIN_MPD_EXE}" ; application elements - WriteRegStr HKCR "${PROG_ID}" "" "MicroPeak Data File" - WriteRegStr HKCR "${PROG_ID}" "FriendlyTypeName" "MicroPeak Data File" - WriteRegStr HKCR "${PROG_ID}\CurVer" "" "${PROG_ID}" - WriteRegStr HKCR "${PROG_ID}\DefaultIcon" "" '"$INSTDIR\${ICO_EXE}",-101' - WriteRegExpandStr HKCR "${PROG_ID}\shell\play\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + DeleteRegKey HKCR "${PROG_ID}" + DeleteRegKey HKCR "${PROG_ID_MPD}" + + WriteRegStr HKCR "${PROG_ID_MPD}" "" "MicroPeak Data File" + 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"' ; .mpd elements - WriteRegStr HKCR ".mpd" "" "${PROG_ID}" + WriteRegStr HKCR ".mpd" "" "${PROG_ID_MPD}" WriteRegStr HKCR ".mpd" "PerceivedType" "MicroPeak Data File" - WriteRegStr HKCR ".mpd" "Content Type" "application/micropeak" + WriteRegStr HKCR ".mpd" "Content Type" "application/vnd.altusmetrum.micropeak" - WriteRegStr HKCR ".mpd\OpenWithProgids" "${PROG_ID}" "" - WriteRegStr HKCR ".mpd\${PROG_ID}" "" "${REG_NAME}" + WriteRegStr HKCR ".mpd\OpenWithProgids" "${PROG_ID_MPD}" "" + WriteRegStr HKCR ".mpd\${PROG_ID_MPD}" "" "${REG_NAME}" Call RefreshShellIcons SectionEnd @@ -153,15 +159,16 @@ Section "Uninstall" DetailPrint "Delete uninstall reg entries" DeleteRegKey HKCR "${PROG_ID}" + DeleteRegKey HKCR "${PROG_ID_MPD}" - DeleteRegKey HKCR ".mpd\${PROG_ID}" - DeleteRegValue HKCR ".mpd\OpenWithProgids" "${PROG_ID}" + DeleteRegKey HKCR ".mpd\${PROG_ID_MPD}" + DeleteRegValue HKCR ".mpd\OpenWithProgids" "${PROG_ID_MPD}" Delete "$INSTDIR\${FAT_NAME}" Delete "$INSTDIR\uninstall-${REG_NAME}.exe" - Delete "$INSTDIR\${ICO_ICO}" - Delete "$INSTDIR\${ICO_EXE}" + Delete "$INSTDIR\${WIN_APP_ICON}" + Delete "$INSTDIR\${WIN_APP_EXE}" ; Remove shortcuts, if any Delete "$SMPROGRAMS\${REG_NAME}.lnk" diff --git a/telegps/.gitignore b/telegps/.gitignore index edb509f2..37e46ad1 100644 --- a/telegps/.gitignore +++ b/telegps/.gitignore @@ -17,7 +17,7 @@ TeleGPS-Linux-*.tar.bz2 TeleGPS-Linux-*.sh TeleGPS-Mac-*.zip TeleGPS-Windows-*.exe -telegps.desktop +altusmetrum-telegps.desktop telegps-windows.log *.dll *.dylib diff --git a/telegps/Info.plist.in b/telegps/Info.plist.in index 7dbb77d1..89870a8c 100644 --- a/telegps/Info.plist.in +++ b/telegps/Info.plist.in @@ -23,14 +23,14 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleIconFile - TeleGPS.icns + altusmetrum-telegps.icns CFBundleDocumentTypes CFBundleTypeName Telemetry CFBundleTypeIconFile - TeleGPS.icns + application-vnd.altusmetrum.telemetry.icns CFBundleTypeExtensions telem @@ -42,7 +42,7 @@ CFBundleTypeName Eeprom CFBundleTypeIconFile - TeleGPS.icns + application-vnd.altusmetrum.eeprom.icns CFBundleTypeExtensions eeprom diff --git a/telegps/Makefile.am b/telegps/Makefile.am index c4f6a58b..a7defb8a 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -58,23 +58,34 @@ ALTOSUILIB_CLASS=\ ICONDIR=$(top_srcdir)/icon JAVA_ICONS=\ - $(ICONDIR)/telegps-16.png \ - $(ICONDIR)/telegps-32.png \ - $(ICONDIR)/telegps-48.png \ - $(ICONDIR)/telegps-64.png \ - $(ICONDIR)/telegps-128.png \ - $(ICONDIR)/telegps-256.png + $(ICONDIR)/altusmetrum-telegps-16.png \ + $(ICONDIR)/altusmetrum-telegps-32.png \ + $(ICONDIR)/altusmetrum-telegps-48.png \ + $(ICONDIR)/altusmetrum-telegps-64.png \ + $(ICONDIR)/altusmetrum-telegps-128.png\ + $(ICONDIR)/altusmetrum-telegps-256.png # icon base names for jar -ICONJAR= -C $(ICONDIR) telegps-16.png \ - -C $(ICONDIR) telegps-32.png \ - -C $(ICONDIR) telegps-48.png \ - -C $(ICONDIR) telegps-64.png \ - -C $(ICONDIR) telegps-128.png \ - -C $(ICONDIR) telegps-256.png - -WINDOWS_ICON=$(ICONDIR)/telegps.ico $(ICONDIR)/telegps.exe -MACOSX_ICON=$(ICONDIR)/TeleGPS.icns +ICONJAR= \ + -C $(ICONDIR) altusmetrum-telegps-16.png \ + -C $(ICONDIR) altusmetrum-telegps-32.png \ + -C $(ICONDIR) altusmetrum-telegps-48.png \ + -C $(ICONDIR) altusmetrum-telegps-64.png \ + -C $(ICONDIR) altusmetrum-telegps-128.png\ + -C $(ICONDIR) altusmetrum-telegps-256.png + +WINDOWS_ICONS =\ + ../icon/altusmetrum-telegps.ico \ + ../icon/altusmetrum-telegps.exe + ../icon/application-vnd.altusmetrum.eeprom.ico \ + ../icon/application-vnd.altusmetrum.eeprom.exe \ + ../icon/application-vnd.altusmetrum.telemetry.ico \ + ../icon/application-vnd.altusmetrum.telemetry.exe + +MACOSX_ICONS =\ + ../icon/altusmetrum-telegps.icns \ + ../icon/application-vnd.altusmetrum.eeprom.icns \ + ../icon/application-vnd.altusmetrum.telemetry.icns # Firmware FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx @@ -120,15 +131,15 @@ DOC=$(TELEGPS_DOC) FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) -LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/telegps.svg +LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/altusmetrum-telegps.svg LINUX_EXTRA=telegps-fat $(desktop_file).in MACOSX_INFO_PLIST=Info.plist MACOSX_README=ReadMe-Mac.rtf -MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_README) $(DOC) $(MACOSX_ICON) +MACOSX_FILES=$(FAT_FILES) libaltos.dylib $(MACOSX_INFO_PLIST) $(MACOSX_README) $(DOC) $(MACOSX_ICONS) MACOSX_EXTRA=$(FIRMWARE) -WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(DOC) $(WINDOWS_ICON) +WINDOWS_FILES=$(FAT_FILES) altos.dll altos64.dll $(top_srcdir)/altusmetrum.inf $(top_srcdir)/altusmetrum.cat $(DOC) $(WINDOWS_ICONS) if FATINSTALL @@ -194,7 +205,7 @@ $(FATJAR): classtelegps.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CL -C classes org \ -C ../libaltos libaltosJNI -classaltosui.stamp: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) +classtelegps.stamp: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) libaltos.so: build-libaltos -rm -f "$@" @@ -269,7 +280,7 @@ $(MACOSX_DIST): $(MACOSX_FILES) $(MACOSX_EXTRA) Makefile cp -a $(DOC) macosx/Doc cp -p Info.plist macosx/TeleGPS.app/Contents mkdir -p macosx/AltOS-$(VERSION) macosx/TeleGPS.app/Contents/Resources/Java - cp -p $(MACOSX_ICON) macosx/TeleGPS.app/Contents/Resources + cp -p $(MACOSX_ICONS) macosx/TeleGPS.app/Contents/Resources cp -p $(FATJAR) macosx/TeleGPS.app/Contents/Resources/Java/telegps.jar cp -p libaltos.dylib macosx/TeleGPS.app/Contents/Resources/Java cp -p $(ALTOSLIB_CLASS) macosx/TeleGPS.app/Contents/Resources/Java diff --git a/telegps/altusmetrum-telegps.desktop.in b/telegps/altusmetrum-telegps.desktop.in index 76c1eb42..7a1b3536 100644 --- a/telegps/altusmetrum-telegps.desktop.in +++ b/telegps/altusmetrum-telegps.desktop.in @@ -3,7 +3,7 @@ Type=Application Name=TeleGPS GenericName=TeleGPS monitor, download and analysis Comment=View and log data from TeleGPS tracking devices -Icon=%icondir%/telegps.svg +Icon=%icondir%/altusmetrum-telegps.svg Exec=%bindir%/telegps %f Terminal=false MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom diff --git a/telegps/telegps-windows.nsi.in b/telegps/telegps-windows.nsi.in index 3f9648f9..603d4971 100644 --- a/telegps/telegps-windows.nsi.in +++ b/telegps/telegps-windows.nsi.in @@ -4,12 +4,14 @@ !include java.nsh !include refresh-sh.nsh -!define REG_NAME "TeleGPS" -!define PROG_ID "org.altusmetrum.telegps.1" -!define PROG_ALTOSUI "org.altusmetrum.altosui.1" -!define FAT_NAME "telegps-fat.jar" -!define ICO_ICO "telegps.ico" -!define ICO_EXE "telegps.exe" +!define REG_NAME "TeleGPS" +!define PROG_ID_TELEM "altusmetrum.telegps.telem.1" +!define PROG_ID_EEPROM "altusmetrum.telegps.eeprom.1" +!define FAT_NAME "telegps-fat.jar" +!define WIN_APP_ICON "altusmetrum-telegps.ico" +!define WIN_APP_EXE "altusmetrum-telegps.exe" +!define WIN_TELEM_EXE "application-vnd.altusmetrum.telemetry.exe" +!define WIN_EEPROM_EXE "application-vnd.altusmetrum.eeprom.exe" Name "${REG_NAME} Installer" @@ -104,13 +106,13 @@ Section "${REG_NAME} Application" File "*.dll" - File "../icon/${ICO_ICO}" + File "../icon/${WIN_APP_ICON}" - CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${ICO_ICO}" + CreateShortCut "$SMPROGRAMS\${REG_NAME}.lnk" "$SYSDIR\javaw.exe" "-jar ${FAT_NAME}" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "${REG_NAME} Desktop Shortcut" - CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${ICO_ICO}" + CreateShortCut "$DESKTOP\${REG_NAME}.lnk" "$INSTDIR\${FAT_NAME}" "" "$INSTDIR\${WIN_APP_ICON}" SectionEnd Section "TeleGPS, TeleDongle and TeleBT Firmware" @@ -134,35 +136,51 @@ SectionEnd Section "File Associations" + ${DisableX64FSRedirection} + SetOutPath $INSTDIR - File "../icon/${ICO_EXE}" + File "../icon/${WIN_APP_EXE}" + File "../icon/${WIN_TELEM_EXE}" + File "../icon/${WIN_EEPROM_EXE}" - ; application elements - - WriteRegStr HKCR "${PROG_ID}" "" "Altus Metrum Data File" - WriteRegStr HKCR "${PROG_ID}" "FriendlyTypeName" "Altus Metrum Data File" - WriteRegStr HKCR "${PROG_ID}\CurVer" "" "${PROG_ID}" - WriteRegStr HKCR "${PROG_ID}\DefaultIcon" "" '"$INSTDIR\${ICO_EXE}",-101' - WriteRegExpandStr HKCR "${PROG_ID}\shell\play\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"' + 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}" ; .eeprom elements - WriteRegStr HKCR ".eeprom" "" "${PROG_ALTOSUI}" + 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"' + + WriteRegStr HKCR ".eeprom" "" "${PROG_ID_EEPROM}" WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File" - WriteRegStr HKCR ".eeprom" "Content Type" "application/altosui" + WriteRegStr HKCR ".eeprom" "Content Type" "application/vnd.altusmetrum.eeprom" - WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" "" - WriteRegStr HKCR ".eeprom\${PROG_ID}" "" "${REG_NAME}" + WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" "" + WriteRegStr HKCR ".eeprom\${PROG_ID_EEPROM}" "" "${REG_NAME}" ; .telem elements - WriteRegStr HKCR ".telem" "" "${PROG_ALTOSUI}" + 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" "" '"%SYSTEMROOT%\System32\javaw.exe" -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/altosui" + WriteRegStr HKCR ".telem" "Content Type" "application/vnd.altusmetrum.telemetry" - WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID}" "" - WriteRegStr HKCR ".telem\${PROG_ID}" "" "${REG_NAME}" + WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" "" + WriteRegStr HKCR ".telem\${PROG_ID_TELEM}" "" "${REG_NAME}" Call RefreshShellIcons SectionEnd @@ -195,21 +213,22 @@ Section "Uninstall" DetailPrint "Delete uninstall reg entries" - DeleteRegKey HKCR "${PROG_ID}" + DeleteRegKey HKCR "${PROG_ID_EEPROM}" + DeleteRegKey HKCR "${PROG_ID_TELEM}" - DeleteRegKey HKCR ".eeprom\${PROG_ID}" - DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID}" + DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}" + DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" - DeleteRegKey HKCR ".telem\${PROG_ID}" - DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID}" + DeleteRegKey HKCR ".telem\${PROG_ID_TELEM}" + DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" DetailPrint "Delete file association reg entries" Delete "$INSTDIR\${FAT_NAME}" Delete "$INSTDIR\uninstall-${REG_NAME}.exe" - Delete "$INSTDIR\${ICO_ICO}" - Delete "$INSTDIR\${ICO_EXE}" + Delete "$INSTDIR\${WIN_APP_ICON}" + Delete "$INSTDIR\${WIN_APP_EXE}" ; Remove shortcuts, if any Delete "$SMPROGRAMS\${REG_NAME}.lnk" -- cgit v1.2.3 From b2c5f7d10265794a5778546f2e3eca7d763eab56 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 24 Jun 2014 20:31:50 -0700 Subject: Clean all .desktop files, ignore them too All .desktop files are built from .desktop.in files, so just remove all of them in make clean, and ignore all of them in .gitignore. This makes the rename less painful. Signed-off-by: Keith Packard --- altosui/.gitignore | 2 +- altosui/Makefile.am | 2 +- micropeak/.gitignore | 2 +- micropeak/Makefile.am | 2 +- telegps/.gitignore | 2 +- telegps/Makefile.am | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'micropeak') diff --git a/altosui/.gitignore b/altosui/.gitignore index b0c8264b..a9b80aa4 100644 --- a/altosui/.gitignore +++ b/altosui/.gitignore @@ -17,7 +17,7 @@ Altos-Linux-*.tar.bz2 Altos-Linux-*.sh Altos-Mac-*.zip Altos-Windows-*.exe -altusmetrum-altosui.desktop +.desktop *.dll *.dylib *.so diff --git a/altosui/Makefile.am b/altosui/Makefile.am index 45d75699..c79e27c0 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -167,7 +167,7 @@ clean-local: -rm -rf classes $(JAR) $(FATJAR) \ $(LINUX_DIST) $(LINUX_SH) $(MACOSX_DIST) windows $(WINDOWS_DIST) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) \ $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt altos-windows.log altos-windows.nsi \ - altosui altosui-test altosui-jdb macosx linux + altosui altosui-test altosui-jdb macosx linux *.desktop EXTRA_DIST = $(desktop_file).in diff --git a/micropeak/.gitignore b/micropeak/.gitignore index 81dd0749..2cf940a6 100644 --- a/micropeak/.gitignore +++ b/micropeak/.gitignore @@ -11,7 +11,7 @@ micropeak-windows.nsi MicroPeak-Linux-* MicroPeak-Mac-* MicroPeak-Windows-* -altusmetrum-micropeak.desktop +*.desktop *.dll *.dylib *.so diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am index 6270fd74..e3b77c8a 100644 --- a/micropeak/Makefile.am +++ b/micropeak/Makefile.am @@ -95,7 +95,7 @@ clean-local: $(ALTOSUILIB_CLASS) \ $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt \ micropeak micropeak-test micropeak-jdb macosx linux windows micropeak-windows.log \ - micropeak-windows.nsi + micropeak-windows.nsi *.desktop EXTRA_DIST = $(desktop_file).in diff --git a/telegps/.gitignore b/telegps/.gitignore index 37e46ad1..1af9e0f1 100644 --- a/telegps/.gitignore +++ b/telegps/.gitignore @@ -17,7 +17,7 @@ TeleGPS-Linux-*.tar.bz2 TeleGPS-Linux-*.sh TeleGPS-Mac-*.zip TeleGPS-Windows-*.exe -altusmetrum-telegps.desktop +*.desktop telegps-windows.log *.dll *.dylib diff --git a/telegps/Makefile.am b/telegps/Makefile.am index 3f53b949..6138b004 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -112,7 +112,7 @@ clean-local: $(ALTOSUILIB_CLASS) \ $(JFREECHART_CLASS) $(JCOMMON_CLASS) $(LIBALTOS) Manifest.txt Manifest-fat.txt \ telegps telegps-test telegps-jdb macosx linux windows telegps-windows.log \ - telegps-windows.nsi + telegps-windows.nsi *.desktop EXTRA_DIST = $(desktop_file).in -- cgit v1.2.3 From d1527a5457210eb914312cf8857bfb88982a8462 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 6 Jul 2014 12:35:13 -0700 Subject: Add support for the "kite" micropeak variant This uses a 100m 'launch detect' altitude and logs data every 19.2s instead of every .192s. Signed-off-by: Keith Packard --- micropeak/MicroData.java | 26 ++++++-- micropeak/MicroPeak.java | 4 +- src/Makefile | 2 +- src/kernel/ao_log_micro.c | 11 ++++ src/kernel/ao_microflight.c | 15 ++++- src/microkite/.gitignore | 2 + src/microkite/Makefile | 134 ++++++++++++++++++++++++++++++++++++++ src/microkite/ao_pins.h | 70 ++++++++++++++++++++ src/microkite/microkite-load.tmpl | 20 ++++++ src/product/ao_micropeak.h | 11 ++++ 10 files changed, 284 insertions(+), 11 deletions(-) create mode 100644 src/microkite/.gitignore create mode 100644 src/microkite/Makefile create mode 100644 src/microkite/ao_pins.h create mode 100644 src/microkite/microkite-load.tmpl (limited to 'micropeak') diff --git a/micropeak/MicroData.java b/micropeak/MicroData.java index 6c9447aa..c38ada91 100644 --- a/micropeak/MicroData.java +++ b/micropeak/MicroData.java @@ -97,9 +97,15 @@ public class MicroData implements AltosUIDataSet { private double time_step; private double ground_altitude; private ArrayList bytes; + public int log_id; String name; MicroStats stats; - + + public static final int LOG_ID_MICROPEAK = 0; + public static final int LOG_ID_MICROKITE = 1; + + public static final double CLOCK = 0.096; + public class FileEndedException extends Exception { } @@ -172,7 +178,7 @@ public class MicroData implements AltosUIDataSet { if (get_nonwhite(f) == 'M' && get_nonwhite(f) == 'P') return true; } - } + } private int get_32(InputStream f) throws IOException, FileEndedException, NonHexcharException { int v = 0; @@ -345,6 +351,9 @@ public class MicroData implements AltosUIDataSet { ground_pressure = get_32(f); min_pressure = get_32(f); int nsamples = get_16(f); + + log_id = nsamples >> 12; + nsamples &= 0xfff; pressures = new int[nsamples + 1]; ground_altitude = AltosConvert.pressure_to_altitude(ground_pressure); @@ -367,7 +376,7 @@ public class MicroData implements AltosUIDataSet { else cur = down; } - + pressures[i+1] = cur; } @@ -376,7 +385,14 @@ public class MicroData implements AltosUIDataSet { crc_valid = crc == current_crc; - time_step = 0.192; + switch (log_id) { + case LOG_ID_MICROPEAK: + time_step = 2 * CLOCK; + break; + case LOG_ID_MICROKITE: + time_step = 200 * CLOCK; + break; + } stats = new MicroStats(this); } catch (FileEndedException fe) { throw new IOException("File Ended Unexpectedly"); @@ -389,5 +405,5 @@ public class MicroData implements AltosUIDataSet { pressures = new int[1]; pressures[0] = 101000; } - + } diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java index 8bdf4b77..1744e803 100644 --- a/micropeak/MicroPeak.java +++ b/micropeak/MicroPeak.java @@ -107,7 +107,7 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene private void DownloadData() { AltosDevice device = MicroDeviceDialog.show(this); - + if (device != null) new MicroDownload(this, device); } @@ -128,7 +128,7 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene if (save.runDialog()) SetName(data.name); } - + private void Export() { if (data == null) { no_data(); diff --git a/src/Makefile b/src/Makefile index 4e8b3c20..df7a31ee 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,7 +39,7 @@ ARMM0DIRS=\ easymini-v1.0 easymini-v1.0/flash-loader AVRDIRS=\ - telescience-v0.1 telescience-pwm micropeak nanopeak-v0.1 + telescience-v0.1 telescience-pwm micropeak nanopeak-v0.1 microkite SUBDIRS= diff --git a/src/kernel/ao_log_micro.c b/src/kernel/ao_log_micro.c index d665efb5..aef78def 100644 --- a/src/kernel/ao_log_micro.c +++ b/src/kernel/ao_log_micro.c @@ -22,10 +22,17 @@ static uint16_t ao_log_offset = STARTING_LOG_OFFSET; +#define AO_LOG_ID_SHIFT 12 +#define AO_LOG_ID_MASK ((1 << AO_LOG_ID_SHIFT) - 1) + void ao_log_micro_save(void) { uint16_t n_samples = (ao_log_offset - STARTING_LOG_OFFSET) / sizeof (uint16_t); + +#if AO_LOG_ID + n_samples |= AO_LOG_ID << AO_LOG_ID_SHIFT; +#endif ao_eeprom_write(PA_GROUND_OFFSET, &pa_ground, sizeof (pa_ground)); ao_eeprom_write(PA_MIN_OFFSET, &pa_min, sizeof (pa_min)); ao_eeprom_write(N_SAMPLES_OFFSET, &n_samples, sizeof (n_samples)); @@ -99,8 +106,12 @@ ao_log_micro_dump(void) uint16_t crc = 0xffff; ao_eeprom_read(N_SAMPLES_OFFSET, &n_samples, sizeof (n_samples)); + if (n_samples == 0xffff) n_samples = 0; +#if AO_LOG_ID + n_samples &= AO_LOG_ID_MASK; +#endif nbytes = STARTING_LOG_OFFSET + sizeof (uint16_t) * n_samples; ao_async_start(); ao_async_byte('M'); diff --git a/src/kernel/ao_microflight.c b/src/kernel/ao_microflight.c index f680e400..df624e79 100644 --- a/src/kernel/ao_microflight.c +++ b/src/kernel/ao_microflight.c @@ -43,10 +43,12 @@ void ao_microflight(void) { int16_t sample_count; + int16_t log_count; uint16_t time; uint32_t pa_interval_min, pa_interval_max; int32_t pa_diff; - uint8_t h, i; + uint8_t h; + uint8_t i; uint8_t accel_lock = 0; uint32_t pa_sum = 0; @@ -93,7 +95,10 @@ ao_microflight(void) } /* Log the remaining samples so we get a complete history since leaving the ground */ - for (; i != h; i = SKIP_PA_HIST(i,2)) { +#if LOG_INTERVAL < NUM_PA_HIST + for (; i != h; i = SKIP_PA_HIST(i,2)) +#endif + { pa = pa_hist[i]; ao_log_micro_data(); } @@ -101,6 +106,7 @@ ao_microflight(void) /* Now sit around until the pressure is stable again and record the max */ sample_count = 0; + log_count = 0; pa_min = ao_pa; pa_interval_min = ao_pa; pa_interval_max = ao_pa; @@ -112,8 +118,11 @@ ao_microflight(void) ao_microsample(); if ((sample_count & 3) == 0) ao_led_off(AO_LED_REPORT); - if (sample_count & 1) + if (log_count == LOG_INTERVAL - 1) { ao_log_micro_data(); + log_count = 0; + } else + log_count++; /* If accelerating upwards, don't look for min pressure */ if (ao_pa_accel < ACCEL_LOCK_PA) diff --git a/src/microkite/.gitignore b/src/microkite/.gitignore new file mode 100644 index 00000000..7a5d0a1f --- /dev/null +++ b/src/microkite/.gitignore @@ -0,0 +1,2 @@ +ao_product.h +microkite-* diff --git a/src/microkite/Makefile b/src/microkite/Makefile new file mode 100644 index 00000000..b7523758 --- /dev/null +++ b/src/microkite/Makefile @@ -0,0 +1,134 @@ +# +# Tiny AltOS build +# +# +vpath % ../attiny:../drivers:../kernel:../product:.. +vpath ao-make-product.5c ../util +vpath make-altitude-pa ../util + +include ../avr/Makefile.defs + +PROGNAME=microkite-v0.1 +PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx + +SCRIPT=microkite-load + +PUBLISH_DIR=$(HOME)/altusmetrumllc/Binaries +PUBLISH_HEX=$(PUBLISH_DIR)/$(HEX) +PUBLISH_SCRIPT=$(PUBLISH_DIR)/$(SCRIPT) + +MCU=attiny85 +DUDECPUTYPE=t85 +#PROGRAMMER=stk500v2 -P usb +LOADSLOW=-i 32 -B 32 +LOADARG=-p $(DUDECPUTYPE) -c $(PROGRAMMER) -e -U flash:w: + +#LDFLAGS=-L$(LDSCRIPTS) -Tavr25.x + +ALTOS_SRC = \ + ao_micropeak.c \ + ao_spi_attiny.c \ + ao_led.c \ + ao_clock.c \ + ao_ms5607.c \ + ao_exti.c \ + ao_convert_pa.c \ + ao_report_micro.c \ + ao_notask.c \ + ao_eeprom_tiny.c \ + ao_panic.c \ + ao_log_micro.c \ + ao_async.c \ + ao_microflight.c \ + ao_microkalman.c + +INC=\ + ao.h \ + ao_pins.h \ + ao_arch.h \ + ao_arch_funcs.h \ + ao_exti.h \ + ao_ms5607.h \ + ao_log_micro.h \ + ao_micropeak.h \ + altitude-pa.h + +IDPRODUCT=0 +PRODUCT=MicroKite-v0.1 +PRODUCT_DEF=-DMICROPEAK +CFLAGS = $(PRODUCT_DEF) -I. -I../attiny -I../kernel -I.. -I../drivers -I../product +CFLAGS += -g -mmcu=$(MCU) -Wall -Wstrict-prototypes -O2 -mcall-prologues -DATTINY + +NICKLE=nickle + +SRC=$(ALTOS_SRC) +OBJ=$(SRC:.c=.o) + +V=0 +# The user has explicitly enabled quiet compilation. +ifeq ($(V),0) +quiet = @printf " $1 $2 $@\n"; $($1) +endif +# Otherwise, print the full command line. +quiet ?= $($1) + +all: $(PROG) $(HEX) microkite-load + +CHECK=sh ../util/check-avr-mem + +$(PROG): Makefile $(OBJ) + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) + $(call quiet,CHECK) $(PROG) || ($(RM) -f $(PROG); exit 1) + +$(HEX): $(PROG) + avr-size $(PROG) + $(OBJCOPY) -R .eeprom -O ihex $(PROG) $@ + + +load: $(HEX) + $(LOADCMD) $(LOADARG)$(HEX) + +load-slow: $(HEX) + $(LOADCMD) $(LOADSLOW) $(LOADARG)$(HEX) + +ao_product.h: ao-make-product.5c ../Version + $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ + +ao_product.o: ao_product.c ao_product.h + +%.o : %.c $(INC) + $(call quiet,CC) -c $(CFLAGS) $< + +distclean: clean + +clean: + rm -f *.o $(PROG) $(HEX) $(SCRIPT) + rm -f ao_product.h + +publish: $(PUBLISH_HEX) $(PUBLISH_SCRIPT) + +$(PUBLISH_HEX): $(HEX) + cp -a $(HEX) $@ + +$(PUBLISH_SCRIPT): $(SCRIPT) + cp -a $(SCRIPT) $@ + +load-product: + ./$(SCRIPT) fast + +load-product-slow: + ./$(SCRIPT) slow + +../altitude-pa.h: make-altitude-pa + nickle $< > $@ + +$(SCRIPT): $(SCRIPT).tmpl Makefile ../Version + sed -e 's/%HEX%/$(HEX)/' -e 's/%LOADCMD%/$(LOADCMD)/' -e 's/%LOADARG%/$(LOADARG)/' -e 's/%LOADSLOW%/$(LOADSLOW)/' $(SCRIPT).tmpl > $@ || (rm $@ && exit 1) + chmod +x $@ + +install: + +uninstall: + +$(OBJ): ao_product.h $(INC) diff --git a/src/microkite/ao_pins.h b/src/microkite/ao_pins.h new file mode 100644 index 00000000..3c56dfb8 --- /dev/null +++ b/src/microkite/ao_pins.h @@ -0,0 +1,70 @@ +/* + * Copyright © 2011 Keith Packard + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#ifndef _AO_PINS_H_ +#define _AO_PINS_H_ +#include + +#define AO_LED_ORANGE (1<<4) +#define AO_LED_SERIAL 4 +#define AO_LED_PANIC AO_LED_ORANGE +#define AO_LED_REPORT AO_LED_ORANGE +#define LEDS_AVAILABLE (AO_LED_ORANGE) +#define USE_SERIAL_1_STDIN 0 +#define HAS_USB 0 +#define PACKET_HAS_SLAVE 0 +#define HAS_SERIAL_1 0 +#define HAS_TASK 0 +#define HAS_MS5607 1 +#define HAS_MS5611 0 +#define HAS_EEPROM 0 +#define HAS_BEEP 0 +#define AVR_CLOCK 250000UL + +/* SPI */ +#define SPI_PORT PORTB +#define SPI_PIN PINB +#define SPI_DIR DDRB +#define AO_MS5607_CS_PORT PORTB +#define AO_MS5607_CS_PIN 3 + +/* MS5607 */ +#define AO_MS5607_SPI_INDEX 0 +#define AO_MS5607_MISO_PORT PORTB +#define AO_MS5607_MISO_PIN 0 +#define AO_MS5607_BARO_OVERSAMPLE 4096 +#define AO_MS5607_TEMP_OVERSAMPLE 1024 + +/* I2C */ +#define I2C_PORT PORTB +#define I2C_PIN PINB +#define I2C_DIR DDRB +#define I2C_PIN_SCL PINB2 +#define I2C_PIN_SDA PINB0 + +#define AO_CONST_ATTRIB PROGMEM +typedef int32_t alt_t; +#define FETCH_ALT(o) ((alt_t) pgm_read_dword(&altitude_table[o])) + +#define AO_ALT_VALUE(x) ((x) * (alt_t) 10) + +#define BOOST_DETECT 1200 /* 100m (ish) */ +#define LOG_INTERVAL 200 /* 19.2 seconds */ + +#define AO_LOG_ID AO_LOG_ID_MICROKITE + +#endif /* _AO_PINS_H_ */ diff --git a/src/microkite/microkite-load.tmpl b/src/microkite/microkite-load.tmpl new file mode 100644 index 00000000..08236a15 --- /dev/null +++ b/src/microkite/microkite-load.tmpl @@ -0,0 +1,20 @@ +#!/bin/sh +dir=`dirname $0` + +HEX="$dir"/"%HEX%" +LOADCMD="%LOADCMD%" +LOADARG="%LOADARG%" +LOADSLOW="%LOADSLOW%" +LOADFAST="" + +case "$1" in +fast) + LOADSPEED="$LOADFAST" + ;; +*) + LOADSPEED="$LOADSLOW" + ;; +esac + +echo ${LOADCMD} ${LOADSPEED} ${LOADARG}${HEX} +${LOADCMD} ${LOADSPEED} ${LOADARG}${HEX} diff --git a/src/product/ao_micropeak.h b/src/product/ao_micropeak.h index 0ec407d7..396b9a23 100644 --- a/src/product/ao_micropeak.h +++ b/src/product/ao_micropeak.h @@ -29,6 +29,17 @@ #define BOOST_DETECT 360 /* 30m at sea level, 36m at 2000m */ #endif +#ifndef LOG_INTERVAL +#define LOG_INTERVAL 2 /* 192 ms */ +#endif + +#define AO_LOG_ID_MICROPEAK 0 +#define AO_LOG_ID_MICROKITE 1 + +#ifndef AO_LOG_ID +#define AO_LOG_ID AO_LOG_ID_MICROPEAK +#endif + /* Wait after power on before doing anything to give the user time to assemble the rocket */ #define BOOST_DELAY AO_SEC_TO_TICKS(60) -- cgit v1.2.3 From 6f2a4c610dfacbf500650db0eeeca6623bb49c5c Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 10 Jul 2014 00:26:55 -0700 Subject: micropeak/altosui/telegps: Fix icon file names The icon file names are now structured to have an organization name and application name component. This should avoid collisions with other packages when the icon files are installed in a shared directory, as on Linux. Within the Java .jar file, the new names need to be correctly referenced or we won't find them. Signed-off-by: Keith Packard --- altosuilib/AltosUIFrame.java | 12 ++++++------ micropeak/MicroFrame.java | 12 ++++++------ telegps/TeleGPS.java | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'micropeak') diff --git a/altosuilib/AltosUIFrame.java b/altosuilib/AltosUIFrame.java index 5b915e85..2e886932 100644 --- a/altosuilib/AltosUIFrame.java +++ b/altosuilib/AltosUIFrame.java @@ -36,12 +36,12 @@ public class AltosUIFrame extends JFrame implements AltosUIListener, AltosPositi } static String[] altos_icon_names = { - "/altus-metrum-16.png", - "/altus-metrum-32.png", - "/altus-metrum-48.png", - "/altus-metrum-64.png", - "/altus-metrum-128.png", - "/altus-metrum-256.png" + "/altusmetrum-altosui-16.png", + "/altusmetrum-altosui-32.png", + "/altusmetrum-altosui-48.png", + "/altusmetrum-altosui-64.png", + "/altusmetrum-altosui-128.png", + "/altusmetrum-altosui-256.png" }; static public String[] icon_names; diff --git a/micropeak/MicroFrame.java b/micropeak/MicroFrame.java index f82d1c5e..8b3d49b5 100644 --- a/micropeak/MicroFrame.java +++ b/micropeak/MicroFrame.java @@ -25,12 +25,12 @@ import org.altusmetrum.altosuilib_3.*; public class MicroFrame extends AltosUIFrame { static String[] micro_icon_names = { - "/micropeak-16.png", - "/micropeak-32.png", - "/micropeak-48.png", - "/micropeak-64.png", - "/micropeak-128.png", - "/micropeak-256.png" + "/altusmetrum-micropeak-16.png", + "/altusmetrum-micropeak-32.png", + "/altusmetrum-micropeak-48.png", + "/altusmetrum-micropeak-64.png", + "/altusmetrum-micropeak-128.png", + "/altusmetrum-micropeak-256.png" }; static { set_icon_names(micro_icon_names); } diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index d4b7bacf..a4b221e8 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -32,12 +32,12 @@ public class TeleGPS { static String[] telegps_icon_names = { - "/telegps-16.png", - "/telegps-32.png", - "/telegps-48.png", - "/telegps-64.png", - "/telegps-128.png", - "/telegps-256.png" + "/altusmetrum-telegps-16.png", + "/altusmetrum-telegps-32.png", + "/altusmetrum-telegps-48.png", + "/altusmetrum-telegps-64.png", + "/altusmetrum-telegps-128.png", + "/altusmetrum-telegps-256.png" }; static { set_icon_names(telegps_icon_names); } -- cgit v1.2.3 From ec7ceb607f5ba7e1ed5cfd32b7a452a5f364b095 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 15 Jul 2014 00:44:14 -0700 Subject: linux-fat: Fix up fat linux install icons, mime types and .desktop files use the standard xdg utilities to install mime type and .desktop files. The standard xdg icon installer doesn't handle svg icons, so we have to do those manually. With this patch, xfce, gnome3 and kde4 all place the applications in user-visible menus, display correct file icons and launch correct applications for our file types. Signed-off-by: Keith Packard --- altosui/Makefile.am | 10 +++++- altosui/linux-install.sh | 79 +++++++++++++++++++++++++----------------------- micropeak/Makefile.am | 9 +++++- telegps/Makefile.am | 10 +++++- 4 files changed, 68 insertions(+), 40 deletions(-) (limited to 'micropeak') diff --git a/altosui/Makefile.am b/altosui/Makefile.am index c79e27c0..44258fd2 100644 --- a/altosui/Makefile.am +++ b/altosui/Makefile.am @@ -104,6 +104,14 @@ MACOSX_ICONS =\ $(ICONDIR)/application-vnd.altusmetrum.eeprom.icns \ $(ICONDIR)/application-vnd.altusmetrum.telemetry.icns +LINUX_ICONS =\ + $(ICONDIR)/altusmetrum-altosui.svg \ + $(ICONDIR)/application-vnd.altusmetrum.eeprom.svg \ + $(ICONDIR)/application-vnd.altusmetrum.telemetry.svg + +LINUX_MIMETYPE =\ + $(ICONDIR)/org-altusmetrum-mimetypes.xml + # Firmware FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx FIRMWARE_TD=$(FIRMWARE_TD_0_2) @@ -152,7 +160,7 @@ FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFR LINUX_LIBS=libaltos32.so libaltos64.so -LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(ICONDIR)/altusmetrum-altosui.svg +LINUX_FILES=$(FAT_FILES) $(LINUX_LIBS) $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE) LINUX_EXTRA=altosui-fat MACOSX_INFO_PLIST=Info.plist diff --git a/altosui/linux-install.sh b/altosui/linux-install.sh index 957b1aad..2e44c2aa 100644 --- a/altosui/linux-install.sh +++ b/altosui/linux-install.sh @@ -130,6 +130,7 @@ esac # # Create the .desktop file by editing the paths # + case "$target" in /*) target_abs="$target" @@ -149,43 +150,46 @@ for infile in "$target"/AltOS/*.desktop.in; do done # -# Figure out where to install the .desktop files. If we can, write it -# to the public /usr/share/applications, otherwise, write it to the -# per-user ~/.local/share/applications +# Install the .desktop file # -public=/usr/share/applications -private=$HOME/.local/share/applications -apps="" +for desktop in "$target"/AltOS/*.desktop; do + case `id -u` in + 0) + xdg-desktop-menu install --mode system "$desktop" + ;; + *) + xdg-desktop-menu install --mode user "$desktop" + ;; + esac +done -if [ -d "$public" -a -w "$public" ]; then - apps="$public" -else - mkdir -p "$private" >/dev/null 2>&1 - if [ -d "$private" -a -w "$private" ]; then - apps="$private" - fi -fi - -case "$apps" in -"") - echo "Cannot install application icon" - finish 1 - ;; -esac +# +# Install mime type file +# + +for mimetype in "$target"/AltOS/*-mimetypes.xml; do + case `id -u` in + 0) + xdg-mime install --mode system "$mimetype" + ;; + *) + xdg-mime install --mode user "$mimetype" + ;; + esac +done -echo -n "Installing .desktop files to $apps..." +# +# Install icons +# -cp "$target"/AltOS/*.desktop "$apps" +for icon_dir in /usr/share/icons/hicolor/scalable/mimetypes "$HOME/.icons" "$HOME/.kde/share/icons"; do + if [ -w "$icon_dir" ]; then + cp "$target"/AltOS/*.svg "$icon_dir" + update-icon-caches "$icon_dir" + fi +done -case "$?" in -0) - echo " done." - ;; -*) - echo " failed." - ;; -esac # # Install icon to desktop if desired @@ -222,13 +226,14 @@ if [ -d $HOME/Desktop ]; then esac done - echo -n "Installing desktop icons..." case "$do_desktop" in - [yY]*) - for d in "$target"/AltOS/*.desktop; do - ln -f -s "$d" "$HOME/Desktop/" - done - ;; + [yY]*) + echo -n "Installing desktop icons..." + for d in "$target"/AltOS/*.desktop; do + base=`basename $d` + cp --remove-destination "$d" "$HOME/Desktop/" + done + ;; esac echo " done." diff --git a/micropeak/Makefile.am b/micropeak/Makefile.am index e3b77c8a..15865606 100644 --- a/micropeak/Makefile.am +++ b/micropeak/Makefile.am @@ -82,6 +82,13 @@ MACOSX_ICONS =\ ../icon/altusmetrum-micropeak.icns \ ../icon/application-vnd.altusmetrum.micropeak.icns +LINUX_ICONS =\ + $(ICONDIR)/altusmetrum-micropeak.svg \ + $(ICONDIR)/application-vnd.altusmetrum.micropeak.svg + +LINUX_MIMETYPE =\ + $(ICONDIR)/org-altusmetrum-mimetypes.xml + desktopdir = $(datadir)/applications desktop_file = altusmetrum-micropeak.desktop desktop_SCRIPTS = $(desktop_file) @@ -114,7 +121,7 @@ DOC=$(MICROPEAK_DOC) FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) -LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/altusmetrum-micropeak.svg +LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE) LINUX_EXTRA=micropeak-fat $(desktop_file).in MACOSX_DRIVER_URL=http://www.ftdichip.com/Drivers/VCP/MacOSX/FTDIUSBSerialDriver_v2_2_18.dmg diff --git a/telegps/Makefile.am b/telegps/Makefile.am index 6138b004..3b33428e 100644 --- a/telegps/Makefile.am +++ b/telegps/Makefile.am @@ -87,6 +87,14 @@ MACOSX_ICONS =\ ../icon/application-vnd.altusmetrum.eeprom.icns \ ../icon/application-vnd.altusmetrum.telemetry.icns +LINUX_ICONS =\ + $(ICONDIR)/altusmetrum-altosui.svg \ + $(ICONDIR)/application-vnd.altusmetrum.eeprom.svg \ + $(ICONDIR)/application-vnd.altusmetrum.telemetry.svg + +LINUX_MIMETYPE =\ + $(ICONDIR)/org-altusmetrum-mimetypes.xml + # Firmware FIRMWARE_TD_0_2=$(top_srcdir)/src/teledongle-v0.2/teledongle-v0.2-$(VERSION).ihx FIRMWARE_TD=$(FIRMWARE_TD_0_2) @@ -131,7 +139,7 @@ DOC=$(TELEGPS_DOC) FAT_FILES=$(FATJAR) $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS) $(FREETTS_CLASS) $(JFREECHART_CLASS) $(JCOMMON_CLASS) -LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in ../icon/altusmetrum-telegps.svg +LINUX_FILES=$(FAT_FILES) libaltos.so $(FIRMWARE) $(DOC) $(desktop_file).in $(LINUX_ICONS) $(LINUX_MIMETYPE) LINUX_EXTRA=telegps-fat $(desktop_file).in MACOSX_INFO_PLIST=Info.plist -- cgit v1.2.3