Subversion Repositories Games.Chess Giants

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pmbaty 1
!include "MUI2.nsh"
2
!include "FileFunc.nsh"
3
 
4
!define PRODUCT_NAME "Chess Giants"
5
!define PUBLISHER "Pierre-Marie Baty"
6
!define PUBLISHER_WEBSITE "http://www.pmbaty.com/chess/"
7
!define INSTALLER_SRC "C:\Users\Pierre-Marie Baty\Documents\Mes projets\Chess Giants"
8
 
9
Name "${PRODUCT_NAME}"
22 pmbaty 10
OutFile "C:\Users\Pierre-Marie Baty\Documents\Mes projets\www.pmbaty.com\chess\Chess Giants Installer.exe"
19 pmbaty 11
BrandingText "${PRODUCT_NAME} by ${PUBLISHER} - ${PUBLISHER_WEBSITE}"
1 pmbaty 12
 
13
SetCompressor lzma
14
RequestExecutionLevel user
15
 
16
AllowRootDirInstall true
19 pmbaty 17
InstallDir "$LOCALAPPDATA\${PRODUCT_NAME}"
1 pmbaty 18
 
19 pmbaty 19
!define MUI_ICON "${INSTALLER_SRC}\resource\installer.ico"
1 pmbaty 20
!define MUI_HEADERIMAGE
19 pmbaty 21
!define MUI_HEADERIMAGE_BITMAP "${INSTALLER_SRC}\resource\installer.bmp"
1 pmbaty 22
!define MUI_ABORTWARNING
23
 
24
!insertmacro MUI_PAGE_LICENSE "${INSTALLER_SRC}\License.txt"
25
!insertmacro MUI_PAGE_DIRECTORY
26
;!insertmacro MUI_PAGE_COMPONENTS
27
!insertmacro MUI_PAGE_INSTFILES
73 pmbaty 28
AutoCloseWindow true
1 pmbaty 29
 
30
!insertmacro MUI_UNPAGE_CONFIRM
31
!insertmacro MUI_UNPAGE_INSTFILES
32
 
33
!insertmacro MUI_LANGUAGE "English"
34
!insertmacro MUI_LANGUAGE "French"
35
 
36
Section ""
37
	SetOutPath "$INSTDIR"
38
 
39
	File /r "${INSTALLER_SRC}\data"
44 pmbaty 40
	File /r "${INSTALLER_SRC}\engines"
1 pmbaty 41
	File /r "${INSTALLER_SRC}\helpfiles"
42
	File /r "${INSTALLER_SRC}\themes"
43
	File "${INSTALLER_SRC}\*.pgn"
44
	File "${INSTALLER_SRC}\${PRODUCT_NAME}.exe"
45
	File "${INSTALLER_SRC}\${PRODUCT_NAME}.exe.manifest"
29 pmbaty 46
	File "${INSTALLER_SRC}\Chess Giants (English).html"
47
	File "${INSTALLER_SRC}\Chess Giants (French).html"
1 pmbaty 48
	File "${INSTALLER_SRC}\config.ini"
49
	File "${INSTALLER_SRC}\materials.cfg"
50
	File "${INSTALLER_SRC}\d3dx9_42.dll"
51
	File "${INSTALLER_SRC}\msvcr90.dll"
52
 
53
	CreateShortCut "$DESKTOP\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" "" "" "" "" "" "Start a chess game"
54
	CreateDirectory "$SMPROGRAMS\${PRODUCT_NAME}"
55
	CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\${PRODUCT_NAME}.lnk" "$INSTDIR\${PRODUCT_NAME}.exe" "" "" "" "" "" "Start a chess game"
29 pmbaty 56
	CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Documentation (English).lnk" "$INSTDIR\Chess Giants (English).html" "" "" "" "" "" "Read the software documentation in English"
57
	CreateShortCut "$SMPROGRAMS\${PRODUCT_NAME}\Documentation (Français).lnk" "$INSTDIR\Chess Giants (French).html" "" "" "" "" "" "Read the software documentation in French"
1 pmbaty 58
 
59
	WriteRegStr HKCU "Software\Classes\.pgn" "" "ChessGiantsPGN"
60
	WriteRegStr HKCU "Software\Classes\ChessGiantsPGN" "" "Portable Game Notation"
61
;	WriteRegStr HKCU "Software\Classes\ChessGiantsPGN\DefaultIcon" "" "$INSTDIR\${PRODUCT_NAME}.exe,1"
62
	WriteRegStr HKCU "Software\Classes\ChessGiantsPGN\shell\open\command" "" '"$INSTDIR\${PRODUCT_NAME}.exe" "%1"'
63
 
64
	WriteRegStr HKCU "Software\Classes\.fen" "" "ChessGiantsFEN"
65
	WriteRegStr HKCU "Software\Classes\ChessGiantsFEN" "" "Forsyth-Edwards Notation"
66
;	WriteRegStr HKCU "Software\Classes\ChessGiantsFEN\DefaultIcon" "" "$INSTDIR\${PRODUCT_NAME}.exe,1"
67
	WriteRegStr HKCU "Software\Classes\ChessGiantsFEN\shell\open\command" "" '"$INSTDIR\${PRODUCT_NAME}.exe" "%1"'
68
 
69
	WriteUninstaller $INSTDIR\uninstall.exe
70
	WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayName" "${PRODUCT_NAME}"
55 pmbaty 71
	WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "DisplayIcon" "$INSTDIR\${PRODUCT_NAME}.exe,0"
1 pmbaty 72
	WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
73
	WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S"
74
	WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "Publisher" "${PUBLISHER}"
75
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoModify" 1
76
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "NoRepair" 1
77
	${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2
78
	IntFmt $0 "0x%08X" $0
79
	WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" "EstimatedSize" "$0"
73 pmbaty 80
 
81
	Exec '"$WINDIR\explorer.exe" "$INSTDIR\${PRODUCT_NAME}.exe"'
1 pmbaty 82
SectionEnd
14 pmbaty 83
 
1 pmbaty 84
Section "Uninstall"
85
	DeleteRegKey HKCU "Software\Classes\.pgn"
86
	DeleteRegKey HKCU "Software\Classes\ChessGiantsPGN"
87
	DeleteRegKey HKCU "Software\Classes\.fen"
88
	DeleteRegKey HKCU "Software\Classes\ChessGiantsFEN"
89
 
90
	Delete "$DESKTOP\${PRODUCT_NAME}.lnk"
91
	RMDir /r "$SMPROGRAMS\${PRODUCT_NAME}"
92
	RMDir /r "$INSTDIR"
93
 
94
	DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
95
SectionEnd