altosui: Correct windows hardware IDs for nsis installer file
[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         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000A
35         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000B
36         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000C
37         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000D
38         Pop $0
39         DetailPrint "InitDriverSetup: $0"
40
41         InstDrv::DeleteOemInfFiles /NOUNLOAD
42         InstDrv::CreateDevice /NOUNLOAD
43         SetOutPath $TEMP
44         File "../telemetrum.inf"
45         InstDrv::InstallDriver /NOUNLOAD "$TEMP\telemetrum.inf"
46
47         SetOutPath $INSTDIR
48         File "../telemetrum.inf"
49 SectionEnd
50
51 Section "AltosUI Application"
52         SetOutPath $INSTDIR
53
54         File "altosui-fat.jar"
55         File "cmudict04.jar"
56         File "cmulex.jar"
57         File "cmu_time_awb.jar"
58         File "cmutimelex.jar"
59         File "cmu_us_kal.jar"
60         File "en_us.jar"
61         File "freetts.jar"
62
63         File "*.dll"
64
65         File "../icon/*.ico"
66
67         CreateShortCut "$SMPROGRAMS\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar" "" "$INSTDIR\altus-metrum.ico"
68 SectionEnd
69
70 Section "AltosUI Desktop Shortcut"
71         CreateShortCut "$DESKTOP\AltusMetrum.lnk" "$INSTDIR\altosui-fat.jar"  "" "$INSTDIR\altus-metrum.ico"
72 SectionEnd
73
74 Section "TeleMetrum and TeleDongle Firmware"
75
76         SetOutPath $INSTDIR
77
78         File "../src/telemetrum-v1.0/telemetrum-v1.0-${VERSION}.ihx"
79         File "../src/teledongle-v0.2/teledongle-v0.2-${VERSION}.ihx"
80
81 SectionEnd
82
83 Section "Uninstaller"
84
85         ; Deal with the uninstaller
86         
87         SetOutPath $INSTDIR
88
89         ; Write the install path to the registry
90         WriteRegStr HKLM SOFTWARE\AltusMetrum "Install_Dir" "$INSTDIR"
91         
92         ; Write the uninstall keys for windows
93         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "DisplayName" "Altus Metrum"
94         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "UninstallString" '"$INSTDIR\uninstall.exe"'
95         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoModify" "1"
96         WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum" "NoRepair" "1"
97
98         WriteUninstaller "uninstall.exe"
99 SectionEnd
100
101 Section "Uninstall"
102         DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AltusMetrum"
103         DeleteRegKey HKLM "Software\AltusMetrum"
104
105         Delete "$INSTDIR\*.*"
106         RMDir "$INSTDIR"
107
108         ; Remove devices
109         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000A
110         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000B
111         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000C
112         InstDrv::InitDriverSetup /NOUNLOAD {4D36E96D-E325-11CE-BFC1-08002BE10318} USB\VID_FFFE&PID_000D
113         InstDrv::DeleteOemInfFiles /NOUNLOAD
114         InstDrv::RemoveAllDevices
115
116         ; Remove shortcuts, if any
117         Delete "$SMPROGRAMS\AltusMetrum.lnk"
118         Delete "$DESKTOP\AltusMetrum.lnk"
119 SectionEnd