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