1 !addplugindir Instdrv/NSIS/Plugins
2 ; Definitions for Java 1.6 Detection
3 !define JRE_VERSION "1.6"
4 !define JRE_ALTERNATE "1.7"
5 !define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52247&/jre-6u27-windows-i586-p.exe"
6 !define PRODUCT_NAME "Altus Metrum Windows Software"
8 Name "Altus Metrum Installer"
10 ; Default install directory
11 InstallDir "$PROGRAMFILES\AltusMetrum"
13 ; Tell the installer where to re-install a new version
14 InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir"
16 LicenseText "GNU General Public License Version 2"
17 LicenseData "../COPYING"
19 ; Need admin privs for Vista or Win7
20 RequestExecutionLevel admin
24 ComponentText "Altus Metrum Software and Driver Installer"
27 MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION} 32-bit, it will now \
28 be downloaded and installed"
30 StrCpy $2 "$TEMP\Java Runtime Environment.exe"
31 nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2
32 Pop $R0 ;Get the return value
33 StrCmp $R0 "success" +3
34 MessageBox MB_OK "Download failed: $R0"
42 ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \
44 StrCmp $2 ${JRE_VERSION} done
46 StrCmp $2 ${JRE_ALTERNATE} done
60 UninstPage uninstConfirm
63 ; And the stuff to install
65 Section "Install Driver" InstDriver
67 InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
69 DetailPrint "InitDriverSetup: $0"
70 InstDrv::DeleteOemInfFiles /NOUNLOAD
71 InstDrv::CreateDevice /NOUNLOAD
74 File "../telemetrum.inf"
75 InstDrv::InstallDriver /NOUNLOAD "$TEMP\telemetrum.inf"
78 File "../telemetrum.inf"
80 SetOutPath $WINDIR\Inf
81 File "../telemetrum.inf"
85 Section "AltosUI Application"
90 File "altosui-fat.jar"
93 File "cmu_time_awb.jar"
105 CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$SYSDIR\javaw.exe" "-jar altosui-fat.jar" "$INSTDIR\altus-metrum.ico"
108 Section "AltosUI Desktop Shortcut"
109 CreateShortCut "$DESKTOP\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar" "" "$INSTDIR\altus-metrum.ico"
112 Section "TeleMetrum and TeleDongle Firmware"
116 File "../src/telemetrum-v1.0/telemetrum-v1.0-${VERSION}.ihx"
117 File "../src/telemetrum-v1.1/telemetrum-v1.1-${VERSION}.ihx"
118 File "../src/telemetrum-v1.2/telemetrum-v1.2-${VERSION}.ihx"
119 File "../src/telemini-v1.0/telemini-v1.0-${VERSION}.ihx"
120 File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
124 Section "Documentation"
128 File "../doc/altusmetrum.pdf"
129 File "../doc/altos.pdf"
130 File "../doc/telemetry.pdf"
131 File "../doc/telemetrum-outline.pdf"
132 File "../doc/megametrum-outline.pdf"
135 Section "Uninstaller"
137 ; Deal with the uninstaller
141 ; Write the install path to the registry
142 WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
144 ; Write the uninstall keys for windows
145 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
146 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
147 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
148 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
150 WriteUninstaller "uninstall.exe"
154 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
155 DeleteRegKey HKLM "Software\AltusMetrum"
157 Delete "$INSTDIR\*.*"
161 InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
162 InstDrv::DeleteOemInfFiles /NOUNLOAD
163 InstDrv::RemoveAllDevices
165 ; Remove shortcuts, if any
166 Delete "$SMPROGRAMS\AltusMetrum.lnk"
167 Delete "$DESKTOP\AltusMetrum.lnk"