1 SetCompressor /SOLID lzma
2 !define MULTIUSER_EXECUTIONLEVEL Highest
4 !define MULTIUSER_INSTALLMODE_COMMANDLINE
5 !define MULTIUSER_INSTALLMODE_INSTDIR AWeather
6 !include "MultiUser.nsh"
10 !insertmacro MULTIUSER_INIT
14 !insertmacro MULTIUSER_UNINIT
19 !define VERSION LATEST
22 OutFile "aweather-${VERSION}-gtk.exe"
24 OutFile "aweather-${VERSION}.exe"
27 Icon "${ROOT}/data/icons/48x48/aweather.ico"
29 !define MUI_ABORTWARNING
31 !insertmacro MUI_PAGE_LICENSE "${ROOT}/COPYING"
32 !insertmacro MULTIUSER_PAGE_INSTALLMODE
33 !insertmacro MUI_PAGE_COMPONENTS
34 !insertmacro MUI_PAGE_DIRECTORY
35 !insertmacro MUI_PAGE_INSTFILES
37 !insertmacro MUI_UNPAGE_CONFIRM
38 !insertmacro MUI_UNPAGE_INSTFILES
40 !insertmacro MUI_LANGUAGE "English"
42 Section "AWeather (required)" SecAWeather
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"
55 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
56 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
58 FileOpen $0 $INSTDIR\instmode.dat w
59 FileWrite $0 $MultiUser.InstallMode
62 WriteUninstaller $INSTDIR\uninstaller.exe
64 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
65 !insertmacro MUI_DESCRIPTION_TEXT ${SecAWeather} "AWeather core files."
66 !insertmacro MUI_FUNCTION_DESCRIPTION_END
68 Section "Desktop Icons"
69 SetOutPath $INSTDIR\bin
70 CreateShortCut "$DESKTOP\AWeather.lnk" "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
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
82 FileOpen $0 $INSTDIR\instmode.dat r
86 StrCmp $1 "AllUsers" 0 +4
87 SetShellVarContext all
88 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
90 SetShellVarContext current
91 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
93 Delete $DESKTOP\AWeather.exe.lnk
95 RMDir /r $SMPROGRAMS\AWeather