lynx.nsi 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. ; $LynxId: lynx.nsi,v 1.15 2014/02/08 01:00:47 tom Exp $
  2. ; Script originally generated with the Venis Install Wizard, but customized.
  3. ; The Inno Setup script is preferred; but this can be built via cross-compiling.
  4. ; Define the application name
  5. !define APPNAME "Lynx"
  6. !define EXENAME "lynx.exe"
  7. !define VERSION_EPOCH "2"
  8. !define VERSION_MAJOR "8"
  9. !define VERSION_MINOR "8"
  10. !define VERSION_LEVEL "2005"
  11. !define VERSION_PATCH "pre.5"
  12. !define SUBKEY "Lynx"
  13. !define INSTALL "Lynx - web browser"
  14. !define VERSION "${VERSION_EPOCH}.${VERSION_MAJOR}.${VERSION_MINOR}${VERSION_PATCH}"
  15. ; Main Install settings
  16. Name "${INSTALL}"
  17. InstallDir "$PROGRAMFILES\${INSTALL}"
  18. InstallDirRegKey HKLM "Software\${SUBKEY}" "$INSTDIR\bin"
  19. OutFile "NSIS-Output\${APPNAME}-${VERSION}-setup.exe"
  20. CRCCheck on
  21. SetCompressor /SOLID lzma
  22. VIAddVersionKey ProductName "${SUBKEY}"
  23. VIAddVersionKey CompanyName "http://lynx.isc.org"
  24. VIAddVersionKey LegalCopyright "© 1997-2013,2014, Thomas E. Dickey"
  25. VIAddVersionKey FileDescription "Lynx Installer (MinGW)"
  26. VIAddVersionKey FileVersion "${VERSION}"
  27. VIAddVersionKey ProductVersion "${VERSION}"
  28. VIAddVersionKey Comments "This installer was built with NSIS and cross-compiling to MinGW."
  29. VIAddVersionKey InternalName "setup-${APPNAME}-${VERSION}.exe"
  30. VIProductVersion "${VERSION_EPOCH}.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_LEVEL}"
  31. ; adapted from http://nsis.sourceforge.net/Readme_Page_Based_on_MUI_License_Page
  32. !macro MUI_EXTRAPAGE_README UN TheFile
  33. !define MUI_LICENSEPAGE_BUTTON "$(^NextBtn)"
  34. !insertmacro MUI_${UN}PAGE_LICENSE "${TheFile}"
  35. !macroend
  36. !define ReadmeRun "!insertmacro MUI_EXTRAPAGE_README"
  37. !macro MUI_PAGE_README TheFile
  38. ${ReadmeRun} "" "${TheFile}"
  39. !macroend
  40. ; Modern interface settings
  41. !include "MUI.nsh"
  42. !define MUI_ABORTWARNING
  43. !define MUI_FINISHPAGE_RUN "$INSTDIR\${EXENAME}"
  44. !insertmacro MUI_PAGE_WELCOME
  45. !insertmacro MUI_PAGE_LICENSE "..\COPYHEADER"
  46. !insertmacro MUI_PAGE_README "..\README"
  47. !insertmacro MUI_PAGE_COMPONENTS
  48. !insertmacro MUI_PAGE_DIRECTORY
  49. !insertmacro MUI_PAGE_INSTFILES
  50. !insertmacro MUI_PAGE_FINISH
  51. !insertmacro MUI_UNPAGE_CONFIRM
  52. !insertmacro MUI_UNPAGE_INSTFILES
  53. ; Set languages (first is default language)
  54. !insertmacro MUI_LANGUAGE "English"
  55. !insertmacro MUI_RESERVEFILE_LANGDLL
  56. !define LYNX_CFG "lynx.cfg"
  57. InstType "Full" ; SectionIn 1
  58. InstType "Typical" ; SectionIn 2
  59. InstType "Minimal" ; SectionIn 3
  60. Section "${APPNAME}" Section1
  61. SectionIn 1 2 3
  62. ; Set Section properties
  63. SetOverwrite on
  64. ; Set Section Files and Shortcuts
  65. SetOutPath "$INSTDIR"
  66. File /oname=${EXENAME} ".\bin\*${EXENAME}"
  67. File ".\bin\bzip2.exe"
  68. File ".\bin\gzip.exe"
  69. File ".\bin\*.dll"
  70. ; TODO: bzip2.exe, gzip.exe, *.dll
  71. CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\${EXENAME}"
  72. CreateShortCut "$SENDTO\${APPNAME}.lnk" "$INSTDIR\${EXENAME}"
  73. CreateDirectory "$SMPROGRAMS\${INSTALL}"
  74. CreateShortCut "$SMPROGRAMS\${INSTALL}\${INSTALL}.lnk" "$INSTDIR\${EXENAME}"
  75. CreateShortCut "$SMPROGRAMS\${INSTALL}\${APPNAME} - Help.lnk" "$INSTDIR\help\lynx_help_main.html"
  76. CreateShortCut "$SMPROGRAMS\${INSTALL}\Uninstall.lnk" "$INSTDIR\uninstall.exe"
  77. File ".\share\lynx_doc\samples\*.lss"
  78. ; preinstall lynx.cfg as a temporary file
  79. File /oname=${LYNX_CFG} ".\etc\${LYNX_CFG}"
  80. ; at install-time, append our customization
  81. FileOpen $0 "${LYNX_CFG}" a
  82. FileSeek $0 0 END
  83. FileWrite $0 "HELPFILE:$INSTDIR\help\Lynx_help_main.html.gz$\n"
  84. FileWrite $0 "COLOR_STYLE:$INSTDIR\opaque.lss$\n"
  85. FileWrite $0 "CHMOD_PATH:$\n"
  86. FileWrite $0 "COPY_PATH:$\n"
  87. FileWrite $0 "MKDIR_PATH:$\n"
  88. FileWrite $0 "MV_PATH:$\n"
  89. FileWrite $0 "RMDIR_PATH:$\n"
  90. FileWrite $0 "RM_PATH:$\n"
  91. FileWrite $0 "TOUCH_PATH:$\n"
  92. FileClose $0
  93. File "..\samples\lynx.bat"
  94. File "..\samples\lynx-demo.cfg"
  95. File "..\samples\oldlynx.bat"
  96. File "..\samples\jumps.htm"
  97. File "..\samples\home.htm"
  98. File "..\samples\lynx_bookmarks.htm"
  99. SetOutPath "$INSTDIR\icon"
  100. File "..\samples\lynx.ico"
  101. SetOutPath "$INSTDIR\tmp"
  102. SectionEnd
  103. Section "documentation" Section2
  104. SectionIn 1 2
  105. ; Set Section properties
  106. SetOverwrite on
  107. ; Set Section Files and Shortcuts
  108. SetOutPath "$INSTDIR"
  109. File "..\lynx.man"
  110. SetOutPath "$INSTDIR\doc"
  111. File ".\share\lynx_doc\CHANGES*.*"
  112. File ".\share\lynx_doc\COPY*.*"
  113. File ".\share\lynx_doc\PROBLEM*.*"
  114. File ".\share\lynx_doc\README*.*"
  115. SetOutPath "$INSTDIR\help"
  116. File ".\share\lynx_help\*.*"
  117. SetOutPath "$INSTDIR\help\keystrokes"
  118. File ".\share\lynx_help\keystrokes\*.*"
  119. SectionEnd
  120. Section "samples" Section3
  121. SectionIn 1
  122. ; Set Section properties
  123. SetOverwrite on
  124. ; Set Section Files and Shortcuts
  125. SetOutPath "$INSTDIR\doc\samples"
  126. File ".\share\lynx_doc\samples\*.*"
  127. SetOutPath "$INSTDIR\doc\test"
  128. File ".\share\lynx_doc\test\*.*"
  129. SectionEnd
  130. Section -FinishSection
  131. WriteRegStr HKLM "Software\${SUBKEY}" "" "$INSTDIR"
  132. WriteRegStr HKLM "Software\${SUBKEY}" "Environment" ""
  133. WriteRegStr HKLM "Software\${SUBKEY}\Environment" "LYNX_CFG" "$INSTDIR\${LYNX_CFG}"
  134. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL}" "DisplayName" "${INSTALL} ${VERSION}"
  135. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL}" "UninstallString" "$INSTDIR\uninstall.exe"
  136. WriteUninstaller "$INSTDIR\uninstall.exe"
  137. SectionEnd
  138. ; Modern install component descriptions
  139. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  140. !insertmacro MUI_DESCRIPTION_TEXT ${Section1} "${SUBKEY}"
  141. !insertmacro MUI_DESCRIPTION_TEXT ${Section2} "Documentation"
  142. !insertmacro MUI_DESCRIPTION_TEXT ${Section3} "Samples and Test-files."
  143. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  144. ;Uninstall section
  145. Section Uninstall
  146. ;Remove from registry...
  147. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${INSTALL}"
  148. DeleteRegKey HKLM "SOFTWARE\${SUBKEY}"
  149. ; Delete self
  150. Delete "$INSTDIR\uninstall.exe"
  151. ; Delete Shortcuts
  152. Delete "$DESKTOP\${APPNAME}.lnk"
  153. Delete "$SENDTO\${APPNAME}.lnk"
  154. Delete "$SMPROGRAMS\${INSTALL}\${INSTALL}.lnk"
  155. Delete "$SMPROGRAMS\${INSTALL}\${APPNAME} - Help.lnk"
  156. Delete "$SMPROGRAMS\${INSTALL}\Uninstall.lnk"
  157. ; Clean up application
  158. Delete "$INSTDIR\${EXENAME}"
  159. Delete "$INSTDIR\doc\samples\*.*"
  160. Delete "$INSTDIR\doc\test\*.*"
  161. Delete "$INSTDIR\doc\*.*"
  162. Delete "$INSTDIR\help\keystrokes\*.*"
  163. Delete "$INSTDIR\help\*.*"
  164. Delete "$INSTDIR\icon\*.*"
  165. Delete "$INSTDIR\tmp\*.*"
  166. Delete "$INSTDIR\bzip2.exe"
  167. Delete "$INSTDIR\gzip.exe"
  168. Delete "$INSTDIR\*.bat"
  169. Delete "$INSTDIR\*.cfg"
  170. Delete "$INSTDIR\*.dll"
  171. Delete "$INSTDIR\*.htm"
  172. Delete "$INSTDIR\*.man"
  173. Delete "$INSTDIR\*.lss"
  174. Delete "$INSTDIR\*.tmp"
  175. ; Remove remaining directories
  176. RMDir "$SMPROGRAMS\${INSTALL}"
  177. RMDir "$INSTDIR\doc\samples"
  178. RMDir "$INSTDIR\doc\test"
  179. RMDir "$INSTDIR\doc"
  180. RMDir "$INSTDIR\help\keystrokes"
  181. RMDir "$INSTDIR\help"
  182. RMDir "$INSTDIR\icon"
  183. RMDir "$INSTDIR\tmp"
  184. RMDir "$INSTDIR\"
  185. SectionEnd
  186. ; eof