Subversion Repositories Games.Chess Giants

Rev

Rev 133 | Rev 147 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 133 Rev 144
Line 13... Line 13...
13
RequestExecutionLevel user
13
RequestExecutionLevel user
14
 
14
 
15
AllowRootDirInstall true
15
AllowRootDirInstall true
16
InstallDir "$LOCALAPPDATA\${PRODUCT_NAME}"
16
InstallDir "$LOCALAPPDATA\${PRODUCT_NAME}"
17
 
17
 
18
!define MUI_ICON "${INSTALLER_SRC}\resource\installer.ico"
18
!define MUI_ICON "${INSTALLER_SRC}\installer\installer.ico"
19
!define MUI_HEADERIMAGE
19
!define MUI_HEADERIMAGE
20
!define MUI_HEADERIMAGE_BITMAP "${INSTALLER_SRC}\resource\installer.bmp"
20
!define MUI_HEADERIMAGE_BITMAP "${INSTALLER_SRC}\installer\installer.bmp"
-
 
21
!define MUI_WELCOMEFINISHPAGE_BITMAP "${INSTALLER_SRC}\installer\finish.bmp"
21
!define MUI_ABORTWARNING
22
!define MUI_ABORTWARNING
22
 
23
 
23
!insertmacro MUI_PAGE_LICENSE "${INSTALLER_SRC}\License.txt"
24
!insertmacro MUI_PAGE_LICENSE "${INSTALLER_SRC}\License.txt"
24
!insertmacro MUI_PAGE_DIRECTORY
25
!insertmacro MUI_PAGE_DIRECTORY
25
 
26
 
Line 28... Line 29...
28
Var STR_CONTAINS_VAR_1
29
Var STR_CONTAINS_VAR_1
29
Var STR_CONTAINS_VAR_2
30
Var STR_CONTAINS_VAR_2
30
Var STR_CONTAINS_VAR_3
31
Var STR_CONTAINS_VAR_3
31
Var STR_CONTAINS_VAR_4
32
Var STR_CONTAINS_VAR_4
32
Var STR_RETURN_VAR
33
Var STR_RETURN_VAR
-
 
34
Var LABEL_RESETCONFIG
-
 
35
Var CHECKBOX_RESETCONFIG
33
 
36
 
34
Function StrContains
37
Function StrContains
35
		Exch $STR_NEEDLE
38
		Exch $STR_NEEDLE
36
		Exch 1
39
		Exch 1
37
		Exch $STR_HAYSTACK
40
		Exch $STR_HAYSTACK
Line 87... Line 90...
87
	pathbad:
90
	pathbad:
88
		Abort
91
		Abort
89
	pathgood:
92
	pathgood:
90
		Pop $R1
93
		Pop $R1
91
		Pop $R0
94
		Pop $R0
-
 
95
FunctionEnd
-
 
96
 
-
 
97
Function MyFinishShow
-
 
98
		${NSD_CreateLabel} 120u 120u 60% 40u "If the program was previously installed, all your custom settings are preserved. If you want to reset them as well (for example, to fix a misconfiguration problem) then tick the following checkbox."
-
 
99
		Pop $LABEL_RESETCONFIG
-
 
100
		SetCtlColors $LABEL_RESETCONFIG "" "ffffff"
-
 
101
		${NSD_CreateCheckbox} 120u 165u 60% 10u "&Reset all program settings"
-
 
102
		Pop $CHECKBOX_RESETCONFIG
-
 
103
		SetCtlColors $CHECKBOX_RESETCONFIG "" "ffffff"
-
 
104
FunctionEnd
-
 
105
 
-
 
106
Function MyFinishLeave
-
 
107
		${NSD_GetState} $CHECKBOX_RESETCONFIG $0
-
 
108
		${If} $0 <> 0
-
 
109
			; if asked to, reset the configuration file
-
 
110
			Delete "$INSTDIR\config.ini"
-
 
111
		${EndIf}
92
FunctionEnd
112
FunctionEnd
93
 
113
 
94
;!insertmacro MUI_PAGE_COMPONENTS
114
;!insertmacro MUI_PAGE_COMPONENTS
95
!insertmacro MUI_PAGE_INSTFILES
115
!insertmacro MUI_PAGE_INSTFILES
96
AutoCloseWindow true
116
AutoCloseWindow true
97
 
117
 
98
!insertmacro MUI_UNPAGE_CONFIRM
118
!insertmacro MUI_UNPAGE_CONFIRM
99
!insertmacro MUI_UNPAGE_INSTFILES
119
!insertmacro MUI_UNPAGE_INSTFILES
-
 
120
 
-
 
121
!define MUI_FINISHPAGE_RUN "$INSTDIR\${PRODUCT_NAME}.exe"
-
 
122
!define MUI_PAGE_CUSTOMFUNCTION_SHOW MyFinishShow
-
 
123
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE MyFinishLeave
-
 
124
!insertmacro MUI_PAGE_FINISH
100
 
125
 
101
!insertmacro MUI_LANGUAGE "English"
126
!insertmacro MUI_LANGUAGE "English"
102
!insertmacro MUI_LANGUAGE "French"
127
!insertmacro MUI_LANGUAGE "French"
103
 
128
 
104
Section ""
129
Section ""
105
	SetOutPath "$INSTDIR"
130
	SetOutPath "$INSTDIR"
-
 
131
 
-
 
132
	; erase old files
-
 
133
	RMDir /r "$INSTDIR\data"
-
 
134
	RMDir /r "$INSTDIR\engines"
-
 
135
	RMDir /r "$INSTDIR\helpfiles"
-
 
136
	; RMDir /r "$INSTDIR\themes"; -- keep user themes
106
 
137
 
107
	; deploy our files
138
	; deploy our files
108
	File /r "${INSTALLER_SRC}\data"
139
	File /r "${INSTALLER_SRC}\data"
109
	File /r "${INSTALLER_SRC}\engines"
140
	File /r "${INSTALLER_SRC}\engines"
110
	File /r "${INSTALLER_SRC}\helpfiles"
141
	File /r "${INSTALLER_SRC}\helpfiles"
Line 112... Line 143...
112
	File "${INSTALLER_SRC}\*.pgn"
143
	File "${INSTALLER_SRC}\*.pgn"
113
	File "${INSTALLER_SRC}\${PRODUCT_NAME}.exe"
144
	File "${INSTALLER_SRC}\${PRODUCT_NAME}.exe"
114
	File "${INSTALLER_SRC}\${PRODUCT_NAME}.exe.manifest"
145
	File "${INSTALLER_SRC}\${PRODUCT_NAME}.exe.manifest"
115
	File "${INSTALLER_SRC}\Chess Giants (English).html"
146
	File "${INSTALLER_SRC}\Chess Giants (English).html"
116
	File "${INSTALLER_SRC}\Chess Giants (French).html"
147
	File "${INSTALLER_SRC}\Chess Giants (French).html"
117
	File ";${INSTALLER_SRC}\config.ini"
148
	; File ";${INSTALLER_SRC}\config.ini" -- config.ini shall be created on-the-fly
-
 
149
 
118
	File "${INSTALLER_SRC}\materials.cfg"
150
	File "${INSTALLER_SRC}\materials.cfg"
119
	File "${INSTALLER_SRC}\d3dx9_42.dll"
151
	File "${INSTALLER_SRC}\d3dx9_42.dll"
120
	File "${INSTALLER_SRC}\msvcr90.dll"
152
	File "${INSTALLER_SRC}\msvcr90.dll"
121
	File "${INSTALLER_SRC}\openal32.dll"
153
	File "${INSTALLER_SRC}\openal32.dll"
122
	File "${INSTALLER_SRC}\wrap_oal.dll"
154
	File "${INSTALLER_SRC}\wrap_oal.dll"
Line 151... Line 183...
151
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1
183
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1
152
	${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
184
	${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
153
	IntFmt $0 "0x%08X" $0
185
	IntFmt $0 "0x%08X" $0
154
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "EstimatedSize" "$0"
186
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "EstimatedSize" "$0"
155
 
187
 
156
	; the program was installed successfully, start it and ask it to delete the installer by writing a little registry key
188
	; the program was installed successfully, ask it to delete the installer by writing a little registry key
157
	WriteRegStr HKCU "Software\Chess Giants" "InstallerPath" "$EXEPATH"
189
	WriteRegStr HKCU "Software\Chess Giants" "InstallerPath" "$EXEPATH"
158
	Exec '"$WINDIR\explorer.exe" "$INSTDIR\${PRODUCT_NAME}.exe"'
-
 
159
SectionEnd
190
SectionEnd
160
 
191
 
161
Section "Uninstall"
192
Section "Uninstall"
162
	DeleteRegKey HKCU "Software\Classes\.pgn"
193
	DeleteRegKey HKCU "Software\Classes\.pgn"
163
	DeleteRegKey HKCU "Software\Classes\ChessGiantsPGN"
194
	DeleteRegKey HKCU "Software\Classes\ChessGiantsPGN"