1 !define MULTIUSER_EXECUTIONLEVEL Highest
3 !define MULTIUSER_INSTALLMODE_COMMANDLINE
4 !define MULTIUSER_INSTALLMODE_INSTDIR AWeather
5 !include "MultiUser.nsh"
9 !insertmacro MULTIUSER_INIT
13 !insertmacro MULTIUSER_UNINIT
18 !define VERSION LATEST
21 outFile "aweather-${VERSION}-gtk.exe"
23 outFile "aweather-${VERSION}.exe"
26 Icon "data/aweather.ico"
28 !define MUI_ABORTWARNING
30 !insertmacro MUI_PAGE_LICENSE "COPYING"
31 !insertmacro MULTIUSER_PAGE_INSTALLMODE
32 !insertmacro MUI_PAGE_COMPONENTS
33 !insertmacro MUI_PAGE_DIRECTORY
34 !insertmacro MUI_PAGE_INSTFILES
36 !insertmacro MUI_UNPAGE_CONFIRM
37 !insertmacro MUI_UNPAGE_INSTFILES
39 !insertmacro MUI_LANGUAGE "English"
41 section "AWeather (required)" SecAWeather
50 StrCmp $MultiUser.InstallMode "AllUsers" 0 +4
51 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
52 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
54 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "DisplayName" "AWeather"
55 WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather" "UninstallString" "$INSTDIR\uninstaller.exe"
57 FileOpen $0 $INSTDIR\instmode.dat w
58 FileWrite $0 $MultiUser.InstallMode
61 writeUninstaller $INSTDIR\uninstaller.exe
63 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
64 !insertmacro MUI_DESCRIPTION_TEXT ${SecAWeather} "AWeather core files."
65 !insertmacro MUI_FUNCTION_DESCRIPTION_END
67 Section "Desktop Icons"
68 setOutPath $INSTDIR\bin
69 CreateShortCut "$DESKTOP\AWeather.lnk" "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
72 Section "Start Menu Shortcuts"
73 setOutPath $INSTDIR\bin
74 CreateDirectory "$SMPROGRAMS\AWeather"
75 CreateShortCut "$SMPROGRAMS\AWeather\Uninstall AWeather.lnk" "$INSTDIR\uninstaller.exe" "" "$INSTDIR\uninstaller.exe" 0
76 CreateShortCut "$SMPROGRAMS\AWeather\AWeather.lnk" "$INSTDIR\bin\aweather.exe" "" "$INSTDIR\bin\aweather.exe" 0
77 CreateShortCut "$SMPROGRAMS\AWeather\AWeather (debug).lnk" "cmd.exe" "/K aweather-dbg.exe -d 7" "$INSTDIR\bin\aweather-dbg.exe" 0
81 FileOpen $0 $INSTDIR\instmode.dat r
85 StrCmp $1 "AllUsers" 0 +4
86 SetShellVarContext all
87 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
89 SetShellVarContext current
90 DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\AWeather"
92 delete $DESKTOP\AWeather.exe.lnk
94 rmdir /r $SMPROGRAMS\AWeather