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 MicroPeak 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 MicroPeak Software 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 "MicroPeak Application"
70 File "micropeak-fat.jar"
71 File "altoslib_@ALTOSLIB_VERSION@.jar"
72 File "altosuilib_@ALTOSUILIB_VERSION@.jar"
80 CreateShortCut "$SMPROGRAMS\MicroPeak.lnk" "$SYSDIR\javaw.exe" "-jar micropeak-fat.jar" "$INSTDIR\micro-peak.ico"
83 Section "FTDI USB Driver"
86 File "CDM20824_Setup.exe"
88 StrCpy $2 "$INSTDIR\CDM20824_Setup.exe"
92 Section "MicroPeak Desktop Shortcut"
93 CreateShortCut "$DESKTOP\MicroPeak.lnk" "$INSTDIR\micropeak-fat.jar" "" "$INSTDIR\micro-peak.ico"
96 Section "Documentation"
100 File "../doc/micropeak.pdf"
103 Section "Uninstaller"
105 ; Deal with the uninstaller
109 ; Write the install path to the registry
110 WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
112 ; Write the uninstall keys for windows
113 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
114 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
115 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
116 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
118 WriteUninstaller "uninstall.exe"
122 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
123 DeleteRegKey HKLM "Software\AltusMetrum"
125 Delete "$INSTDIR\*.*"
128 ; Remove shortcuts, if any
129 Delete "$SMPROGRAMS\MicroPeak.lnk"
130 Delete "$DESKTOP\MicroPeak.lnk"