1 !addplugindir ../altosui/Instdrv/NSIS/Plugins
3 ; Definitions for Java 1.7 Detection
4 !define JRE_VERSION "1.7"
5 !define JRE_ALTERNATE "1.6"
6 !define JRE32_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83383&/jre-7u51-windows-i586.exe"
7 !define JRE64_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=83385&/jre-7u51-windows-x64.exe"
8 !define PRODUCT_NAME "TeleGPS Windows Software"
10 Name "TeleGPS Installer"
12 ; Default install directory
13 InstallDir "$PROGRAMFILES\AltusMetrum"
15 ; Tell the installer where to re-install a new version
16 InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir"
18 LicenseText "GNU General Public License Version 2"
19 LicenseData "../COPYING"
21 ; Need admin privs for Vista or Win7
22 RequestExecutionLevel admin
26 ComponentText "TeleGPS Software Installer"
29 DetailPrint "Checking host operating system"
31 DetailPrint "Installer running on 64-bit host"
33 StrCpy $INSTDIR "$PROGRAMFILES64\AltusMetrum"
34 ${DisableX64FSRedirection}
43 StrCpy $JavaDownload ${JRE64_URL}
46 StrCpy $JavaDownload ${JRE32_URL}
50 MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION}, \
51 $JavaBits bits, it will now \
52 be downloaded and installed"
54 StrCpy $2 "$TEMP\Java Runtime Environment.exe"
55 nsisdl::download /TIMEOUT=30000 $JavaDownload $2
56 Pop $R0 ;Get the return value
57 StrCmp $R0 "success" +3
58 MessageBox MB_OK "Download failed: $R0"
65 ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \
68 StrCmp $2 ${JRE_VERSION} done
70 StrCmp $2 ${JRE_ALTERNATE} done
84 UninstPage uninstConfirm
87 ; And the stuff to install
89 Section "Install Driver" InstDriver
91 InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
93 DetailPrint "InitDriverSetup: $0"
94 InstDrv::DeleteOemInfFiles /NOUNLOAD
95 InstDrv::CreateDevice /NOUNLOAD
98 File "../altusmetrum.inf"
99 File "../altusmetrum.cat"
101 ${DisableX64FSRedirection}
102 IfFileExists $WINDIR\System32\PnPutil.exe 0 nopnp
103 ${DisableX64FSRedirection}
104 nsExec::ExecToLog '"$WINDIR\System32\PnPutil.exe" -i -a "$INSTDIR\altusmetrum.inf"'
107 InstDrv::InstallDriver /NOUNLOAD "$INSTDIR\altusmetrum.inf"
112 Section "TeleGPS Application"
117 File "telegps-fat.jar"
118 File "altoslib_@ALTOSLIB_VERSION@.jar"
119 File "altosuilib_@ALTOSUILIB_VERSION@.jar"
122 File "cmu_time_awb.jar"
123 File "cmutimelex.jar"
124 File "cmu_us_kal.jar"
127 File "jfreechart.jar"
134 CreateShortCut "$SMPROGRAMS\TeleGPS.lnk" "$SYSDIR\javaw.exe" "-jar telegps-fat.jar" "$INSTDIR\telegps.ico"
137 Section "TeleGPS Desktop Shortcut"
138 CreateShortCut "$DESKTOP\TeleGPS.lnk" "$INSTDIR\telegps-fat.jar" "" "$INSTDIR\telegps.ico"
141 Section "TeleGPS, TeleDongle and TeleBT Firmware"
145 File "../src/telegps-v1.0/telegps-v1.0-${VERSION}.ihx"
146 File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
147 File "../src/telebt-v1.0/telebt-v1.0-${VERSION}.ihx"
151 Section "Documentation"
155 File "../doc/telegps.pdf"
156 File "../doc/altos.pdf"
157 File "../doc/telemetry.pdf"
160 Section "Uninstaller"
162 ; Deal with the uninstaller
166 ; Write the install path to the registry
167 WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
169 ; Write the uninstall keys for windows
170 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
171 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
172 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
173 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
175 WriteUninstaller "uninstall.exe"
179 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
180 DeleteRegKey HKLM "Software\AltusMetrum"
182 Delete "$INSTDIR\*.*"
186 InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
187 InstDrv::DeleteOemInfFiles /NOUNLOAD
188 InstDrv::RemoveAllDevices
190 ; Remove shortcuts, if any
191 Delete "$SMPROGRAMS\TeleGPS.lnk"
192 Delete "$DESKTOP\TeleGPS.lnk"