summaryrefslogtreecommitdiff
path: root/telegps
diff options
context:
space:
mode:
Diffstat (limited to 'telegps')
-rw-r--r--telegps/.gitignore2
-rw-r--r--telegps/Info.plist.in29
-rw-r--r--telegps/Makefile.am57
-rw-r--r--telegps/TeleGPS.java45
-rw-r--r--telegps/TeleGPSConfig.java4
-rw-r--r--telegps/TeleGPSConfigUI.java63
-rw-r--r--telegps/TeleGPSDisplayThread.java4
-rw-r--r--telegps/TeleGPSGraphUI.java4
-rw-r--r--telegps/TeleGPSInfo.java4
-rw-r--r--telegps/TeleGPSPreferences.java2
-rw-r--r--telegps/TeleGPSState.java4
-rw-r--r--telegps/TeleGPSStatus.java4
-rw-r--r--telegps/TeleGPSStatusUpdate.java2
-rw-r--r--telegps/altusmetrum-telegps.desktop.in (renamed from telegps/telegps.desktop.in)4
-rw-r--r--telegps/telegps-windows.nsi.in176
15 files changed, 281 insertions, 123 deletions
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 df05bb6e..89870a8c 100644
--- a/telegps/Info.plist.in
+++ b/telegps/Info.plist.in
@@ -23,7 +23,34 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleIconFile</key>
- <string>TeleGPS.icns</string>
+ <string>altusmetrum-telegps.icns</string>
+ <key>CFBundleDocumentTypes</key>
+ <array>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Telemetry</string>
+ <key>CFBundleTypeIconFile</key>
+ <string>application-vnd.altusmetrum.telemetry.icns</string>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>telem</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ </dict>
+ <dict>
+ <key>CFBundleTypeName</key>
+ <string>Eeprom</string>
+ <key>CFBundleTypeIconFile</key>
+ <string>application-vnd.altusmetrum.eeprom.icns</string>
+ <key>CFBundleTypeExtensions</key>
+ <array>
+ <string>eeprom</string>
+ </array>
+ <key>CFBundleTypeRole</key>
+ <string>Editor</string>
+ </dict>
+ </array>
<key>Java</key>
<dict>
<key>MainClass</key>
diff --git a/telegps/Makefile.am b/telegps/Makefile.am
index 7b550e9e..3f53b949 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
-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
@@ -89,7 +100,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 +117,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,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) 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/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,8 +205,6 @@ $(FATJAR): classtelegps.stamp Manifest-fat.txt $(ALTOSLIB_CLASS) $(ALTOSUILIB_CL
-C classes org \
-C ../libaltos libaltosJNI
-classaltosui.stamp: $(ALTOSLIB_CLASS) $(ALTOSUILIB_CLASS)
-
libaltos.so: build-libaltos
-rm -f "$@"
$(LN_S) ../libaltos/.libs/"$@" .
@@ -269,7 +278,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/TeleGPS.java b/telegps/TeleGPS.java
index 6e68dd30..e78c2124 100644
--- a/telegps/TeleGPS.java
+++ b/telegps/TeleGPS.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 TeleGPS
extends AltosUIFrame
@@ -351,17 +351,18 @@ public class TeleGPS
frequencies.set_product("Monitor");
frequencies.set_serial(serial);
frequencies.set_frequency(AltosUIPreferences.frequency(serial));
- frequencies.setEnabled(true);
+ menu_bar.add(frequencies);
+ menu_bar.repaint();
}
void disable_frequency_menu() {
- if (frequency_listener != null) {
- frequencies.removeActionListener(frequency_listener);
- frequencies.setEnabled(false);
- frequency_listener = null;
- }
-
+ if (frequency_listener == null)
+ return;
+ frequencies.removeActionListener(frequency_listener);
+ menu_bar.remove(frequencies);
+ menu_bar.repaint();
+ frequency_listener = null;
}
public void set_reader(AltosFlightReader reader, AltosDevice device) {
@@ -409,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();
@@ -435,8 +458,6 @@ public class TeleGPS
monitor_menu = make_menu("Monitor", monitor_menu_entries);
device_menu = make_menu("Device", device_menu_entries);
frequencies = new AltosFreqList();
- frequencies.setEnabled(false);
- menu_bar.add(frequencies);
displays = new LinkedList<AltosFlightDisplay>();
diff --git a/telegps/TeleGPSConfig.java b/telegps/TeleGPSConfig.java
index 3505b0bb..e607a5a5 100644
--- a/telegps/TeleGPSConfig.java
+++ b/telegps/TeleGPSConfig.java
@@ -22,8 +22,8 @@ import javax.swing.*;
import java.io.*;
import java.util.concurrent.*;
import java.text.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class TeleGPSConfig implements ActionListener {
diff --git a/telegps/TeleGPSConfigUI.java b/telegps/TeleGPSConfigUI.java
index 5f269fd3..1fdfd70c 100644
--- a/telegps/TeleGPSConfigUI.java
+++ b/telegps/TeleGPSConfigUI.java
@@ -21,8 +21,8 @@ import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class TeleGPSConfigUI
extends AltosUIDialog
@@ -38,6 +38,7 @@ public class TeleGPSConfigUI
JLabel radio_frequency_label;
JLabel radio_enable_label;
JLabel aprs_interval_label;
+ JLabel aprs_ssid_label;
JLabel flight_log_max_label;
JLabel callsign_label;
JLabel tracker_motion_label;
@@ -53,6 +54,7 @@ public class TeleGPSConfigUI
JTextField radio_calibration_value;
JRadioButton radio_enable_value;
JComboBox<String> aprs_interval_value;
+ JComboBox<Integer> aprs_ssid_value;
JComboBox<String> flight_log_max_value;
JTextField callsign_value;
JComboBox<String> tracker_motion_value;
@@ -72,6 +74,10 @@ public class TeleGPSConfigUI
"10"
};
+ static Integer[] aprs_ssid_values = {
+ 0, 1, 2 ,3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
+ };
+
static String[] tracker_motion_values_m = {
"2",
"5",
@@ -148,6 +154,15 @@ public class TeleGPSConfigUI
aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
}
+ void set_aprs_ssid_tool_tip() {
+ if (aprs_ssid_value.isEnabled())
+ aprs_interval_value.setToolTipText("Set the APRS SSID (secondary station identifier)");
+ else if (aprs_interval_value.isEnabled())
+ aprs_interval_value.setToolTipText("Software version doesn't support setting the APRS SSID");
+ else
+ aprs_interval_value.setToolTipText("Hardware doesn't support APRS");
+ }
+
void set_flight_log_max_tool_tip() {
if (flight_log_max_value.isEnabled())
flight_log_max_value.setToolTipText("Size reserved for each flight log (in kB)");
@@ -257,7 +272,11 @@ public class TeleGPSConfigUI
c.ipady = 5;
radio_frequency_value = new AltosFreqList();
radio_frequency_value.addItemListener(this);
- pane.add(radio_frequency_value, c);
+
+ JMenuBar menu_bar = new JMenuBar();
+ menu_bar.add(radio_frequency_value);
+
+ pane.add(menu_bar, c);
radio_frequency_value.setToolTipText("Telemetry, RDF and packet frequency");
row++;
@@ -337,6 +356,33 @@ public class TeleGPSConfigUI
set_aprs_interval_tool_tip();
row++;
+ /* APRS SSID */
+ c = new GridBagConstraints();
+ c.gridx = 0; c.gridy = row;
+ c.gridwidth = 4;
+ c.fill = GridBagConstraints.NONE;
+ c.anchor = GridBagConstraints.LINE_START;
+ c.insets = il;
+ c.ipady = 5;
+ aprs_ssid_label = new JLabel("APRS SSID:");
+ pane.add(aprs_ssid_label, c);
+
+ c = new GridBagConstraints();
+ c.gridx = 4; c.gridy = row;
+ c.gridwidth = 4;
+ c.fill = GridBagConstraints.HORIZONTAL;
+ c.weightx = 1;
+ c.anchor = GridBagConstraints.LINE_START;
+ c.insets = ir;
+ c.ipady = 5;
+ aprs_ssid_value = new JComboBox<Integer>(aprs_ssid_values);
+ aprs_ssid_value.setEditable(false);
+ aprs_ssid_value.addItemListener(this);
+ aprs_ssid_value.setMaximumRowCount(aprs_ssid_values.length);
+ pane.add(aprs_ssid_value, c);
+ set_aprs_ssid_tool_tip();
+ row++;
+
/* Callsign */
c = new GridBagConstraints();
c.gridx = 0; c.gridy = row;
@@ -782,4 +828,15 @@ public class TeleGPSConfigUI
return 0;
return parse_int("aprs interval", s, false);
}
+
+ public void set_aprs_ssid(int new_aprs_ssid) {
+ aprs_ssid_value.setSelectedItem(Math.max(0,new_aprs_ssid));
+ aprs_ssid_value.setVisible(new_aprs_ssid >= 0);
+ set_aprs_ssid_tool_tip();
+ }
+
+ public int aprs_ssid() throws AltosConfigDataException {
+ Integer i = (Integer) aprs_ssid_value.getSelectedItem();
+ return i;
+ }
}
diff --git a/telegps/TeleGPSDisplayThread.java b/telegps/TeleGPSDisplayThread.java
index a3d4ea07..18b8d9fc 100644
--- a/telegps/TeleGPSDisplayThread.java
+++ b/telegps/TeleGPSDisplayThread.java
@@ -21,8 +21,8 @@ import java.awt.*;
import javax.swing.*;
import java.io.*;
import java.text.*;
-import org.altusmetrum.altoslib_4.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altoslib_5.*;
+import org.altusmetrum.altosuilib_3.*;
public class TeleGPSDisplayThread extends Thread {
diff --git a/telegps/TeleGPSGraphUI.java b/telegps/TeleGPSGraphUI.java
index 244eb7b9..b59b122c 100644
--- a/telegps/TeleGPSGraphUI.java
+++ b/telegps/TeleGPSGraphUI.java
@@ -26,8 +26,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.*;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
diff --git a/telegps/TeleGPSInfo.java b/telegps/TeleGPSInfo.java
index e87fea90..1b4751b9 100644
--- a/telegps/TeleGPSInfo.java
+++ b/telegps/TeleGPSInfo.java
@@ -21,8 +21,8 @@ import java.util.*;
import java.awt.*;
import java.awt.event.*;
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 TeleGPSInfo extends AltosUIFlightTab {
diff --git a/telegps/TeleGPSPreferences.java b/telegps/TeleGPSPreferences.java
index 8bd371f4..2738ceea 100644
--- a/telegps/TeleGPSPreferences.java
+++ b/telegps/TeleGPSPreferences.java
@@ -22,7 +22,7 @@ import java.awt.event.*;
import java.beans.*;
import javax.swing.*;
import javax.swing.event.*;
-import org.altusmetrum.altosuilib_2.*;
+import org.altusmetrum.altosuilib_3.*;
public class TeleGPSPreferences
extends AltosUIConfigure
diff --git a/telegps/TeleGPSState.java b/telegps/TeleGPSState.java
index a76182ed..27321c73 100644
--- a/telegps/TeleGPSState.java
+++ b/telegps/TeleGPSState.java
@@ -21,8 +21,8 @@ import java.util.*;
import java.awt.*;
import java.awt.event.*;
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 TeleGPSState extends AltosUIFlightTab {
diff --git a/telegps/TeleGPSStatus.java b/telegps/TeleGPSStatus.java
index f3951a37..1d4415d6 100644
--- a/telegps/TeleGPSStatus.java
+++ b/telegps/TeleGPSStatus.java
@@ -19,8 +19,8 @@ package org.altusmetrum.telegps;
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 TeleGPSStatus extends JComponent implements AltosFlightDisplay {
GridBagLayout layout;
diff --git a/telegps/TeleGPSStatusUpdate.java b/telegps/TeleGPSStatusUpdate.java
index e7684d88..3d2b7f34 100644
--- a/telegps/TeleGPSStatusUpdate.java
+++ b/telegps/TeleGPSStatusUpdate.java
@@ -18,7 +18,7 @@
package org.altusmetrum.telegps;
import java.awt.event.*;
-import org.altusmetrum.altoslib_4.*;
+import org.altusmetrum.altoslib_5.*;
public class TeleGPSStatusUpdate implements ActionListener {
diff --git a/telegps/telegps.desktop.in b/telegps/altusmetrum-telegps.desktop.in
index 3d249d8a..7a1b3536 100644
--- a/telegps/telegps.desktop.in
+++ b/telegps/altusmetrum-telegps.desktop.in
@@ -3,8 +3,8 @@ 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=text/plain;
+MimeType=application/vnd.altusmetrum.telemetry;application/vnd.altusmetrum.eeprom
Categories=Education;Electronics;Science;
diff --git a/telegps/telegps-windows.nsi.in b/telegps/telegps-windows.nsi.in
index e6798c46..603d4971 100644
--- a/telegps/telegps-windows.nsi.in
+++ b/telegps/telegps-windows.nsi.in
@@ -1,19 +1,25 @@
!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
+!include refresh-sh.nsh
-Name "TeleGPS Installer"
+!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"
; 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"
@@ -23,7 +29,7 @@ RequestExecutionLevel admin
ShowInstDetails Show
-ComponentText "TeleGPS Software Installer"
+ComponentText "${REG_NAME} Software and Driver Installer"
Function .onInit
DetailPrint "Checking host operating system"
@@ -35,43 +41,14 @@ Function .onInit
${EndIf}
FunctionEnd
-Var JavaDownload
-Var JavaBits
-
-Function GetJRE
+Function un.onInit
+ DetailPrint "Checking host operating system"
${If} ${RunningX64}
- StrCpy $JavaDownload ${JRE64_URL}
- StrCpy $JavaBits "64"
- ${Else}
- StrCpy $JavaDownload ${JRE32_URL}
- StrCpy $JavaBits "32"
+ DetailPrint "Installer running on 64-bit host"
+ SetRegView 64
+ StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum"
+ ${DisableX64FSRedirection}
${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
@@ -109,12 +86,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"
@@ -129,13 +106,13 @@ Section "TeleGPS Application"
File "*.dll"
- File "../icon/*.ico"
+ File "../icon/${WIN_APP_ICON}"
- 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\${WIN_APP_ICON}"
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\${WIN_APP_ICON}"
SectionEnd
Section "TeleGPS, TeleDongle and TeleBT Firmware"
@@ -157,38 +134,105 @@ Section "Documentation"
File "../doc/telemetry.pdf"
SectionEnd
+Section "File Associations"
+
+ ${DisableX64FSRedirection}
+
+ SetOutPath $INSTDIR
+
+ File "../icon/${WIN_APP_EXE}"
+ File "../icon/${WIN_TELEM_EXE}"
+ File "../icon/${WIN_EEPROM_EXE}"
+
+ DeleteRegKey HKCR "${PROG_ID_TELEM}"
+ DeleteRegKey HKCR "${PROG_ID_EEPROM}"
+
+ DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}"
+ DeleteRegKey HKCR ".telem\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".telem\OpenWithProgids" "${PROG_ID_EEPROM}"
+
+ ; .eeprom elements
+
+ WriteRegStr HKCR "${PROG_ID_EEPROM}" "" "Altus Metrum Log File"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}" "FriendlyTypeName" "Altus Metrum Log File"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}\CurVer" "" "${PROG_ID_EEPROM}"
+ WriteRegStr HKCR "${PROG_ID_EEPROM}\DefaultIcon" "" '"$INSTDIR\${WIN_EEPROM_EXE}",-101'
+ WriteRegExpandStr HKCR "${PROG_ID_EEPROM}\shell\open\command" "" '"%SYSTEMROOT%\System32\javaw.exe" -Djava.library.path="$INSTDIR" -jar "$INSTDIR\${FAT_NAME}" "%1"'
+
+ WriteRegStr HKCR ".eeprom" "" "${PROG_ID_EEPROM}"
+ WriteRegStr HKCR ".eeprom" "PerceivedType" "Altus Metrum Log File"
+ WriteRegStr HKCR ".eeprom" "Content Type" "application/vnd.altusmetrum.eeprom"
+
+ WriteRegStr HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}" ""
+ WriteRegStr HKCR ".eeprom\${PROG_ID_EEPROM}" "" "${REG_NAME}"
+
+ ; .telem elements
+
+ WriteRegStr HKCR "${PROG_ID_TELEM}" "" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR "${PROG_ID_TELEM}" "FriendlyTypeName" "Altus Metrum Telemetry File"
+ WriteRegStr HKCR "${PROG_ID_TELEM}\CurVer" "" "${PROG_ID_TELEM}"
+ WriteRegStr HKCR "${PROG_ID_TELEM}\DefaultIcon" "" '"$INSTDIR\${WIN_TELEM_EXE}",-101'
+ WriteRegExpandStr HKCR "${PROG_ID_TELEM}\shell\open\command" "" '"%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/vnd.altusmetrum.telemetry"
+
+ WriteRegStr HKCR ".telem\OpenWithProgids" "${PROG_ID_TELEM}" ""
+ WriteRegStr HKCR ".telem\${PROG_ID_TELEM}" "" "${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_EEPROM}"
+ DeleteRegKey HKCR "${PROG_ID_TELEM}"
+
+ DeleteRegKey HKCR ".eeprom\${PROG_ID_EEPROM}"
+ DeleteRegValue HKCR ".eeprom\OpenWithProgids" "${PROG_ID_EEPROM}"
+
+ 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\${WIN_APP_ICON}"
+ Delete "$INSTDIR\${WIN_APP_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