]> Pileus Git - aweather/blob - aweather.nsi
Fix typo in man page
[aweather] / aweather.nsi
1 SetCompressor /SOLID lzma
2 !define MULTIUSER_EXECUTIONLEVEL Highest
3 !define MULTIUSER_MUI
4 !define MULTIUSER_INSTALLMODE_COMMANDLINE
5 !define MULTIUSER_INSTALLMODE_INSTDIR AWeather
6 !include "MultiUser.nsh"
7 !include "MUI2.nsh"
8
9 Function .onInit
10         !insertmacro MULTIUSER_INIT
11 FunctionEnd
12
13 Function un.onInit
14         !insertmacro MULTIUSER_UNINIT
15 FunctionEnd
16
17 Name "AWeather"
18 !ifndef VERSION
19         !define VERSION LATEST
20 !endif
21 !ifdef USE_GTK
22         OutFile "aweather-${VERSION}-gtk.exe"
23 !else
24         OutFile "aweather-${VERSION}.exe"
25 !endif
26 InstallDir AWeather
27 Icon "data/icons/48x48/aweather.ico"
28
29 !define MUI_ABORTWARNING
30
31 !insertmacro MUI_PAGE_LICENSE "COPYING"
32 !insertmacro MULTIUSER_PAGE_INSTALLMODE
33 !insertmacro MUI_PAGE_COMPONENTS
34 !insertmacro MUI_PAGE_DIRECTORY
35 !insertmacro MUI_PAGE_INSTFILES
36
37 !insertmacro MUI_UNPAGE_CONFIRM
38 !insertmacro MUI_UNPAGE_INSTFILES
39
40 !insertmacro MUI_LANGUAGE "English"
41
42 Section "AWeather (required)" SecAWeather
43         SectionIn RO
44
45         SetOutPath $INSTDIR
46         File /r build/*
47         !ifdef USE_GTK
48                 file /r gtk/*
49         !endif
50         
51         StrCmp $MultiUser.InstallMode "AllUsers" 0 +4
52                 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
53                 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
54         Goto +3
55                 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
56                 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
57
58         FileOpen $0 $INSTDIR\instmode.dat w
59         FileWrite $0 $MultiUser.InstallMode
60         FileClose $0
61         
62         WriteUninstaller $INSTDIR\uninstaller.exe
63 SectionEnd
64 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
65 !insertmacro MUI_DESCRIPTION_TEXT ${SecAWeather} "AWeather core files."
66 !insertmacro MUI_FUNCTION_DESCRIPTION_END
67
68 Section "Desktop Icons"
69         SetOutPath $INSTDIR\bin
70         CreateShortCut "$DESKTOP\AWeather.lnk" "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
71 SectionEnd
72
73 Section "Start Menu Shortcuts"
74         SetOutPath $INSTDIR\bin
75         CreateDirectory "$SMPROGRAMS\AWeather"
76         CreateShortCut  "$SMPROGRAMS\AWeather\Uninstall AWeather.lnk" "$INSTDIR\uninstaller.exe"  "" "$INSTDIR\uninstaller.exe"  0
77         CreateShortCut  "$SMPROGRAMS\AWeather\AWeather.lnk"           "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
78         CreateShortCut  "$SMPROGRAMS\AWeather\AWeather (debug).lnk" "cmd.exe" "/K aweather-dbg.exe -d 7" "$INSTDIR\bin\aweather-dbg.exe" 0
79 SectionEnd
80
81 Section "Uninstall"
82         FileOpen $0 $INSTDIR\instmode.dat r
83         FileRead $0 $1
84         FileClose $0
85
86         StrCmp $1 "AllUsers" 0 +4
87                 SetShellVarContext all
88                 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
89         Goto +3
90                 SetShellVarContext current
91                 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
92
93         Delete $DESKTOP\AWeather.exe.lnk
94
95         RMDir /r $SMPROGRAMS\AWeather
96         RMDir /r $INSTDIR
97 SectionEnd