source: trunk/OpenYahtzee/windows_installer.nsi @ 26

Last change on this file since 26 was 26, checked in by guyru, 7 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1; installer.nsi
2;
3; This is the NSIS installer script for Open Yahtzee.
4;
5;
6;
7;--------------------------------
8
9; The name of the installer
10Name "Open Yahtzee 1.5.1"
11
12; The file to write
13OutFile "OpenYahtzee-1.5.1.exe"
14
15; The default installation directory
16InstallDir $PROGRAMFILES\OpenYahtzee
17
18;hides details of the install and uninstall but allows the users to see them if he wants
19ShowInstDetails hide
20ShowUninstDetails hide
21
22; Registry key to check for directory (so if you install again, it will
23; overwrite the old one automatically)
24InstallDirRegKey HKLM "Software\OpenYahtzee" "Install_Dir"
25
26;make the installer controls use the new XP style when running on Windows XP
27XPStyle on
28
29;set the license
30LicenseData COPYING.txt
31
32;--------------------------------
33
34; Pages
35
36Page license
37Page components
38Page directory
39Page instfiles
40UninstPage uninstConfirm
41UninstPage instfiles
42
43
44;--------------------------------
45
46; The stuff to install
47Section "OpenYahtzee-1.5.1 (required)"
48
49  SectionIn RO
50 
51  ; Set output path to the installation directory.
52  SetOutPath $INSTDIR
53 
54  ; Put file there
55  File "openyahtzee.exe"
56  File "mingwm10.dll"
57  File "wxbase28_gcc_custom.dll"
58  File "wxmsw28_core_gcc_custom.dll"
59  File "README.txt"
60  File "COPYING.txt"
61 
62  ; Write the installation path into the registry
63  WriteRegStr HKLM SOFTWARE\OpenYahtzee "Install_Dir" "$INSTDIR"
64 
65  ; Write the uninstall keys for Windows
66  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "DisplayName" "OpenYahtzee"
67  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "UninstallString" '"$INSTDIR\uninstall.exe"'
68  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "NoModify" 1
69  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee" "NoRepair" 1
70  WriteUninstaller "uninstall.exe"
71 
72SectionEnd
73
74; Optional section (can be disabled by the user)
75Section "Start Menu Shortcuts"
76
77  CreateDirectory "$SMPROGRAMS\OpenYahtzee"
78  CreateShortCut "$SMPROGRAMS\OpenYahtzee\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
79  CreateShortCut "$SMPROGRAMS\OpenYahtzee\OpenYahtzee.lnk" "$INSTDIR\openyahtzee.exe" "" "$INSTDIR\openyahtzee.exe" 0
80 
81SectionEnd
82
83;--------------------------------
84
85; Uninstaller
86
87Section "Uninstall"
88 
89  ; Remove registry keys
90  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenYahtzee"
91  DeleteRegKey HKLM SOFTWARE\OpenYahtzee
92
93  ; Remove files and uninstaller
94  Delete $INSTDIR\openyahtzee.exe
95  Delete "wxbase28_gcc_custom.dll"
96  Delete "wxmsw28_core_gcc_custom.dll"
97  Delete "COPYING.txt"
98  Delete "README.txt"
99  Delete $INSTDIR\uninstall.exe
100
101  ; Remove shortcuts, if any
102  Delete "$SMPROGRAMS\OpenYahtzee\*.*"
103
104  ; Remove directories used
105  RMDir "$SMPROGRAMS\OpenYahtzee"
106  RMDir "$INSTDIR"
107
108SectionEnd
Note: See TracBrowser for help on using the repository browser.