windows: Update NSIS installer file to use compatibility IDs
[fw/altos] / altosui / altos-windows.nsi
1 !addplugindir Instdrv/NSIS/Plugins
2
3 Name "Altus Metrum Installer"
4
5 ; Default install directory
6 InstallDir "$PROGRAMFILES\AltusMetrum"
7
8 ; Tell the installer where to re-install a new version
9 InstallDirRegKey HKLM "Software\AltusMetrum" "Install_Dir"
10
11 LicenseText "GNU General Public License Version 2"
12 LicenseData "../COPYING"
13
14 ; Need admin privs for Vista or Win7
15 RequestExecutionLevel admin
16
17 ShowInstDetails Show
18
19 ComponentText "Altus Metrum Software and Driver Installer"
20
21 ; Pages to present
22
23 Page license
24 Page components
25 Page directory
26 Page instfiles
27
28 UninstPage uninstConfirm
29 UninstPage instfiles
30
31 ; And the stuff to install
32
33 Section "Install Driver" InstDriver
34
35         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
36         Pop $0
37         DetailPrint "InitDriverSetup: $0"
38         InstDrv::DeleteOemInfFiles /NOUNLOAD
39         InstDrv::CreateDevice /NOUNLOAD
40
41         SetOutPath $TEMP
42         File "../telemetrum.inf"
43         InstDrv::InstallDriver /NOUNLOAD "$TEMP\telemetrum.inf"
44
45         SetOutPath $INSTDIR
46         File "../telemetrum.inf"
47
48         SetOutPath $WINDIR\Inf
49         File "../telemetrum.inf"
50
51 SectionEnd
52
53 Section "AltosUI Application"
54         SetOutPath $INSTDIR
55
56         File "altosui-fat.jar"
57         File "cmudict04.jar"
58         File "cmulex.jar"
59         File "cmu_time_awb.jar"
60         File "cmutimelex.jar"
61         File "cmu_us_kal.jar"
62         File "en_us.jar"
63         File "freetts.jar"
64         File "jfreechart.jar"
65         File "jcommon.jar"
66
67         File "*.dll"
68
69         File "../icon/*.ico"
70
71         CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar" "" "$INSTDIR\altus-metrum.ico"
72 SectionEnd
73
74 Section "AltosUI Desktop Shortcut"
75         CreateShortCut "$DESKTOP\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar"  "" "$INSTDIR\altus-metrum.ico"
76 SectionEnd
77
78 Section "TeleMetrum and TeleDongle Firmware"
79
80         SetOutPath $INSTDIR
81
82         File "../src/telemetrum-v1.0/telemetrum-v1.0-${VERSION}.ihx"
83         File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
84
85 SectionEnd
86
87 Section "Uninstaller"
88
89         ; Deal with the uninstaller
90         
91         SetOutPath $INSTDIR
92
93         ; Write the install path to the registry
94         WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
95         
96         ; Write the uninstall keys for windows
97         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
98         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
99         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
100         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
101
102         WriteUninstaller "uninstall.exe"
103 SectionEnd
104
105 Section "Uninstall"
106         DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
107         DeleteRegKey HKLM "Software\AltusMetrum"
108
109         Delete "$INSTDIR\*.*"
110         RMDir "$INSTDIR"
111
112         ; Remove devices
113         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} AltusMetrumSerial
114         InstDrv::DeleteOemInfFiles /NOUNLOAD
115         InstDrv::RemoveAllDevices
116
117         ; Remove shortcuts, if any
118         Delete "$SMPROGRAMS\AltusMetrum.lnk"
119         Delete "$DESKTOP\AltusMetrum.lnk"
120 SectionEnd