source: branches/openyahtzee1.7PE/windows_installer.nsi @ 62

Revision 62, 4.0 KB checked in by guyru, 5 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1; installer.nsi
2;
3; This is the NSIS installer script for Open Yahtzee.
4;
5;
6;
7;--------------------------------
8!define version 1.7
9;--------------------------------
10;Include Modern UI
11
12  !include "MUI.nsh"
13
14;--------------------------------
15
16; The name of the installer
17Name "OpenYahtzee ${version}"
18
19; The file to write
20OutFile "OpenYahtzee-${version}.exe"
21
22; The default installation directory
23InstallDir $PROGRAMFILES\OpenYahtzee
24
25;hides details of the install and uninstall but allows the users to see them if he wants
26ShowInstDetails hide
27ShowUninstDetails hide
28
29; Registry key to check for directory (so if you install again, it will
30; overwrite the old one automatically)
31InstallDirRegKey HKLM "Software\OpenYahtzee" "Install_Dir"
32
33; set the icon for installer
34;Icon "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
35!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
36!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
37
38;--------------------------------
39;Interface Settings
40
41  !define MUI_ABORTWARNING
42
43;--------------------------------
44;Pages
45
46  !insertmacro MUI_PAGE_LICENSE "COPYING.txt"
47  !insertmacro MUI_PAGE_COMPONENTS
48  !insertmacro MUI_PAGE_DIRECTORY
49  !insertmacro MUI_PAGE_INSTFILES
50 
51  !insertmacro MUI_UNPAGE_CONFIRM
52  !insertmacro MUI_UNPAGE_INSTFILES
53 
54;--------------------------------
55
56; The stuff to install
57Section "OpenYahtzee-${version} (required)" SecOpenYahtzee
58
59  SectionIn RO
60 
61  ; Set output path to the installation directory.
62  SetOutPath $INSTDIR
63 
64  ; Put file there
65  File "openyahtzee.exe"
66  File "mingwm10.dll"
67  File "wxbase28_gcc_custom.dll"
68  File "wxmsw28_core_gcc_custom.dll"
69  File "README.txt"
70  File "COPYING.txt"
71  File "icon32.ico"
72 
73  ; Write the installation path into the registry
74  WriteRegStr HKLM SOFTWARE\OpenYahtzee "Install_Dir" "$INSTDIR"
75 
76  ; Write the uninstall keys for Windows
77  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "DisplayName" "OpenYahtzee"
78  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "UninstallString" '"$INSTDIR\uninstall.exe"'
79  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "NoModify" 1
80  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "NoRepair" 1
81  WriteUninstaller "uninstall.exe"
82 
83SectionEnd
84
85; Optional section (can be disabled by the user)
86Section "Start Menu Shortcuts" SecStartMenu
87  ; Remove old shortcuts, if any
88  Delete "$SMPROGRAMS\OpenYahtzee\*.*"
89
90  CreateDirectory "$SMPROGRAMS\OpenYahtzee"
91  CreateShortCut "$SMPROGRAMS\OpenYahtzee\OpenYahtzee.lnk" "$INSTDIR\openyahtzee.exe" "" "$INSTDIR\icon32.ico" 0
92  CreateShortCut "$SMPROGRAMS\OpenYahtzee\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
93 
94SectionEnd
95;--------------------------------
96;Languages
97 
98  !insertmacro MUI_LANGUAGE "English"
99
100;--------------------------------
101;Descriptions
102
103  ;Language strings
104  LangString DESC_SecOpenYahtzee ${LANG_ENGLISH} "The OpenYahtzee game files and the required libraries."
105  LangString DESC_SecStartMenu ${LANG_ENGLISH} "Create shortcuts in the Start menu"
106
107  ;Assign language strings to sections
108  !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
109    !insertmacro MUI_DESCRIPTION_TEXT ${SecOpenYahtzee} $(DESC_SecOpenYahtzee)
110    !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenu} $(DESC_SecStartMenu)
111  !insertmacro MUI_FUNCTION_DESCRIPTION_END
112
113;--------------------------------
114
115; Uninstaller
116
117Section "Uninstall"
118 
119  ; Remove registry keys
120  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee"
121  DeleteRegKey HKLM SOFTWARE\OpenYahtzee
122
123  ; Remove files and uninstaller
124  Delete $INSTDIR\openyahtzee.exe
125  Delete "wxbase28_gcc_custom.dll"
126  Delete "wxmsw28_core_gcc_custom.dll"
127  Delete "COPYING.txt"
128  Delete "README.txt"
129  Delete "icon32.ico"
130  Delete $INSTDIR\uninstall.exe
131
132  ; Remove shortcuts, if any
133  Delete "$SMPROGRAMS\OpenYahtzee\*.*"
134
135  ; Remove directories used
136  RMDir "$SMPROGRAMS\OpenYahtzee"
137  RMDir "$INSTDIR"
138
139SectionEnd
Note: See TracBrowser for help on using the repository browser.