1 !addplugindir Instdrv/NSIS/Plugins
2 ; Definitions for Java 1.6 Detection
3 !define JRE_VERSION "1.6"
4 !define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=52247&/jre-6u27-windows-i586-p.exe"
5 !define PRODUCT_NAME "Altus Metrum Windows Software"
7 Name "Altus Metrum Installer"
9 ; Default install directory
10 InstallDir "$PROGRAMFILES\AltusMetrum"
12 ; Tell the installer where to re-install a new version
13 InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir"
15 LicenseText "GNU General Public License Version 2"
16 LicenseData "../COPYING"
18 ; Need admin privs for Vista or Win7
19 RequestExecutionLevel admin
23 ComponentText "Altus Metrum Software and Driver Installer"
26 MessageBox MB_OK "${PRODUCT_NAME} uses Java ${JRE_VERSION} 32-bit, it will now \
27 be downloaded and installed"
29 StrCpy $2 "$TEMP\Java Runtime Environment.exe"
30 nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2
31 Pop $R0 ;Get the return value
32 StrCmp $R0 "success" +3
33 MessageBox MB_OK "Download failed: $R0"
41 ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" \
43 StrCmp $2 ${JRE_VERSION} done
57 UninstPage uninstConfirm
60 ; And the stuff to install
62 Section "Install Driver" InstDriver
64 InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
66 DetailPrint "InitDriverSetup: $0"
67 InstDrv::DeleteOemInfFiles /NOUNLOAD
68 InstDrv::CreateDevice /NOUNLOAD
71 File "../telemetrum.inf"
72 InstDrv::InstallDriver /NOUNLOAD "$TEMP\telemetrum.inf"
75 File "../telemetrum.inf"
77 SetOutPath $WINDIR\Inf
78 File "../telemetrum.inf"
82 Section "AltosUI Application"
87 File "altosui-fat.jar"
90 File "cmu_time_awb.jar"
102 CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$SYSDIR\javaw.exe" "-jar altosui-fat.jar" "$INSTDIR\altus-metrum.ico"
105 Section "AltosUI Desktop Shortcut"
106 CreateShortCut "$DESKTOP\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar" "" "$INSTDIR\altus-metrum.ico"
109 Section "TeleMetrum and TeleDongle Firmware"
113 File "../src/telemetrum-v1.0/telemetrum-v1.0-${VERSION}.ihx"
114 File "../src/telemetrum-v1.1/telemetrum-v1.1-${VERSION}.ihx"
115 File "../src/telemini-v1.0/telemini-v1.0-${VERSION}.ihx"
116 File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
120 Section "Documentation"
124 File "../doc/altusmetrum.pdf"
125 File "../doc/altos.pdf"
126 File "../doc/telemetry.pdf"
127 File "../doc/telemetrum-outline.pdf"
130 Section "Uninstaller"
132 ; Deal with the uninstaller
136 ; Write the install path to the registry
137 WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
139 ; Write the uninstall keys for windows
140 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
141 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
142 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
143 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
145 WriteUninstaller "uninstall.exe"
149 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
150 DeleteRegKey HKLM "Software\AltusMetrum"
152 Delete "$INSTDIR\*.*"
156 InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
157 InstDrv::DeleteOemInfFiles /NOUNLOAD
158 InstDrv::RemoveAllDevices
160 ; Remove shortcuts, if any
161 Delete "$SMPROGRAMS\AltusMetrum.lnk"
162 Delete "$DESKTOP\AltusMetrum.lnk"