1 !addplugindir 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 "Altus Metrum Windows Software"
10 Name "Altus Metrum MicroPeak 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 "Altus Metrum MicroPeak 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" \
67 StrCmp $2 ${JRE_VERSION} done
69 StrCmp $2 ${JRE_ALTERNATE} done
83 UninstPage uninstConfirm
86 ; And the stuff to install
88 Section "MicroPeak Application"
93 File "micropeak-fat.jar"
94 File "altoslib_@ALTOSLIB_VERSION@.jar"
95 File "altosuilib_@ALTOSUILIB_VERSION@.jar"
103 CreateShortCut "$SMPROGRAMS\MicroPeak.lnk" "$SYSDIR\javaw.exe" "-jar micropeak-fat.jar" "$INSTDIR\micro-peak.ico"
106 Section "FTDI USB Driver"
109 File "CDM20824_Setup.exe"
111 StrCpy $2 "$INSTDIR\CDM20824_Setup.exe"
115 Section "MicroPeak Desktop Shortcut"
116 CreateShortCut "$DESKTOP\MicroPeak.lnk" "$INSTDIR\micropeak-fat.jar" "" "$INSTDIR\micro-peak.ico"
119 Section "Documentation"
123 File "../doc/micropeak.pdf"
126 Section "Uninstaller"
128 ; Deal with the uninstaller
132 ; Write the install path to the registry
133 WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
135 ; Write the uninstall keys for windows
136 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
137 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
138 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
139 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
141 WriteUninstaller "uninstall.exe"
145 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
146 DeleteRegKey HKLM "Software\AltusMetrum"
148 Delete "$INSTDIR\*.*"
151 ; Remove shortcuts, if any
152 Delete "$SMPROGRAMS\MicroPeak.lnk"
153 Delete "$DESKTOP\MicroPeak.lnk"