1 #------------------------------------------------------------------------------
3 !include "LogicLib.nsh"
5 #------------------------------------------------------------------------------
8 !define VERSION
"unknown"
12 !define OUTFILE
"../neverball-${VERSION}-setup.exe"
15 !define UNINSTALL_REG_ROOT \
16 "Software\Microsoft\Windows\CurrentVersion\Uninstall\Neverball"
18 #------------------------------------------------------------------------------
21 Name "Neverball ${VERSION}"
22 LicenseData "COPYING.txt"
23 InstallDir "$PROGRAMFILES\Neverball"
26 SetCompressor
/solid lzma
27 RequestExecutionLevel user
29 #------------------------------------------------------------------------------
41 SetShellVarContext all
45 Section "Neverball/Neverputt"
51 File /r
/x
.svn
/x
*.map
/x
*.obj data
54 File neverball
.exe neverputt
.exe
*.dll
56 File /oname=data\icon\neverball
.ico dist\ico\neverball
.ico
57 File /oname=data\icon\neverputt
.ico dist\ico\neverputt
.ico
59 CreateDirectory "$INSTDIR\bin"
61 SetOutPath "$INSTDIR\bin"
63 File scripts\neverball
.bat
64 File scripts\neverputt
.bat
65 File contrib\curve
.exe
67 # http://nsis.sourceforge.net/\
68 # Add_uninstall_information_to_Add/Remove_Programs
70 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
71 "DisplayName" "Neverball ${VERSION}"
72 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
73 "DisplayVersion" "${VERSION}"
74 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
75 "DisplayIcon" "$INSTDIR\data\icon\neverball.ico"
76 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
77 "UninstallString" "$INSTDIR\uninstall.exe"
78 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
79 "URLInfoAbout" "http://www.neverball.org/"
80 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
81 "URLUpdateInfo" "http://www.neverball.org/"
82 WriteRegStr SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
83 "HelpLink" "http://www.nevercorner.net/"
84 WriteRegDWORD SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
86 WriteRegDWORD SHELL_CONTEXT
${UNINSTALL_REG_ROOT} \
89 WriteUninstaller "$INSTDIR\uninstall.exe"
92 Section "Mapping tools (compiler, maps, ...)"
96 File /oname=bin\mapc
.bat scripts\mapc
.bat
98 SetOutPath "$INSTDIR\data"
100 File /r
/x
".svn" data\
*.map
101 File /r
/x
".svn" data\
*.obj
104 SectionGroup
"Shortcuts"
105 Section "In Start menu"
106 # Reset to get a proper working directory
107 SetOutPath "$INSTDIR"
109 CreateDirectory "$SMPROGRAMS\Neverball"
112 "$SMPROGRAMS\Neverball\Neverball.lnk" \
113 "$INSTDIR\neverball.exe" "" \
114 "$INSTDIR\data\icon\neverball.ico"
117 "$SMPROGRAMS\Neverball\Neverputt.lnk" \
118 "$INSTDIR\neverputt.exe" "" \
119 "$INSTDIR\data\icon\neverputt.ico"
123 # Reset to get a proper working directory
124 SetOutPath "$INSTDIR"
127 "$DESKTOP\Neverball.lnk" \
128 "$INSTDIR\neverball.exe" "" \
129 "$INSTDIR\data\icon\neverball.ico"
132 "$DESKTOP\Neverputt.lnk" \
133 "$INSTDIR\neverputt.exe" "" \
134 "$INSTDIR\data\icon\neverputt.ico"
138 #------------------------------------------------------------------------------
140 UninstPage uninstConfirm
148 SetShellVarContext all
153 Delete "$SMPROGRAMS\Neverball\Neverball.lnk"
154 Delete "$SMPROGRAMS\Neverball\Neverputt.lnk"
155 RMDir "$SMPROGRAMS\Neverball"
156 Delete "$DESKTOP\Neverball.lnk"
157 Delete "$DESKTOP\Neverputt.lnk"
159 DeleteRegKey SHELL_CONTEXT
${UNINSTALL_REG_ROOT}
161 # FIXME: unsafe if the directory contains other-than-installed stuff
165 #------------------------------------------------------------------------------
167 # URL: http://nsis.sourceforge.net/IsUserAdmin
168 # Author: Lilla (lilla@earthlink.net) 2003-06-13
170 !macro IsUserAdmin un
171 Function ${un}IsUserAdmin
180 UserInfo::GetAccountType
183 StrCmp $R2 "Admin" 0 Continue
203 !insertmacro IsUserAdmin
""
204 !insertmacro IsUserAdmin
"un."
206 #------------------------------------------------------------------------------