| 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 |
|---|
| 10 | Name "Open Yahtzee 1.5.1" |
|---|
| 11 | |
|---|
| 12 | ; The file to write |
|---|
| 13 | OutFile "OpenYahtzee-1.5.1.exe" |
|---|
| 14 | |
|---|
| 15 | ; The default installation directory |
|---|
| 16 | InstallDir $PROGRAMFILES\OpenYahtzee |
|---|
| 17 | |
|---|
| 18 | ;hides details of the install and uninstall but allows the users to see them if he wants |
|---|
| 19 | ShowInstDetails hide |
|---|
| 20 | ShowUninstDetails hide |
|---|
| 21 | |
|---|
| 22 | ; Registry key to check for directory (so if you install again, it will |
|---|
| 23 | ; overwrite the old one automatically) |
|---|
| 24 | InstallDirRegKey HKLM "Software\OpenYahtzee" "Install_Dir" |
|---|
| 25 | |
|---|
| 26 | ;make the installer controls use the new XP style when running on Windows XP |
|---|
| 27 | XPStyle on |
|---|
| 28 | |
|---|
| 29 | ;set the license |
|---|
| 30 | LicenseData COPYING.txt |
|---|
| 31 | |
|---|
| 32 | ;-------------------------------- |
|---|
| 33 | |
|---|
| 34 | ; Pages |
|---|
| 35 | |
|---|
| 36 | Page license |
|---|
| 37 | Page components |
|---|
| 38 | Page directory |
|---|
| 39 | Page instfiles |
|---|
| 40 | UninstPage uninstConfirm |
|---|
| 41 | UninstPage instfiles |
|---|
| 42 | |
|---|
| 43 | |
|---|
| 44 | ;-------------------------------- |
|---|
| 45 | |
|---|
| 46 | ; The stuff to install |
|---|
| 47 | Section "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 | |
|---|
| 72 | SectionEnd |
|---|
| 73 | |
|---|
| 74 | ; Optional section (can be disabled by the user) |
|---|
| 75 | Section "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 | |
|---|
| 81 | SectionEnd |
|---|
| 82 | |
|---|
| 83 | ;-------------------------------- |
|---|
| 84 | |
|---|
| 85 | ; Uninstaller |
|---|
| 86 | |
|---|
| 87 | Section "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 | |
|---|
| 108 | SectionEnd |
|---|