polipo-mingw.nsi 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. ;polipo-mingw.nsi - A basic win32 installer for Polipo
  2. ; Originally written by J Doe.
  3. ; Modified by Andrew Lewman
  4. ; See the Tor LICENSE for licencing information
  5. ;-----------------------------------------
  6. ;
  7. !include "MUI.nsh"
  8. !define VERSION "1.0.4.0"
  9. !define INSTALLER "polipo-${VERSION}-win32.exe"
  10. !define WEBSITE "http://www.pps.jussieu.fr/~jch/software/polipo/"
  11. !define LICENSE "COPYING"
  12. !define BIN "." ;BIN is where it expects to find polipo.exe
  13. SetCompressor /SOLID LZMA ;Tighter compression
  14. RequestExecutionLevel user ;Updated for Vista compatibility
  15. OutFile ${INSTALLER}
  16. InstallDir $PROGRAMFILES\Polipo
  17. SetOverWrite ifnewer
  18. Name "Polipo"
  19. Caption "Polipo ${VERSION} Setup"
  20. BrandingText "A Caching Web Proxy"
  21. CRCCheck on
  22. XPStyle on
  23. VIProductVersion "${VERSION}"
  24. VIAddVersionKey "ProductName" "Polipo: A caching web proxy"
  25. VIAddVersionKey "Comments" "http://www.pps.jussieu.fr/~jch/software/polipo/"
  26. VIAddVersionKey "LegalTrademarks" "See COPYING"
  27. VIAddVersionKey "LegalCopyright" "©2008, Juliusz Chroboczek"
  28. VIAddVersionKey "FileDescription" "Polipo is a caching web proxy."
  29. VIAddVersionKey "FileVersion" "${VERSION}"
  30. !define MUI_WELCOMEPAGE_TITLE "Welcome to the Polipo Setup Wizard"
  31. !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of Polipo ${VERSION}.\r\n\r\nIf you have previously installed Polipo and it is currently running, please exit Polipo first before continuing this installation.\r\n\r\n$_CLICK"
  32. !define MUI_ABORTWARNING
  33. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
  34. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
  35. !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
  36. !define MUI_HEADERIMAGE
  37. ;!define MUI_FINISHPAGE_RUN
  38. !define MUI_FINISHPAGE_LINK "Visit the Polipo website for the latest updates."
  39. !define MUI_FINISHPAGE_LINK_LOCATION ${WEBSITE}
  40. !insertmacro MUI_PAGE_WELCOME
  41. ; There's no point in having a clickthrough license: Our license adds
  42. ; certain rights, but doesn't remove them.
  43. ; !insertmacro MUI_PAGE_LICENSE "${LICENSE}"
  44. !insertmacro MUI_PAGE_COMPONENTS
  45. !insertmacro MUI_PAGE_DIRECTORY
  46. !insertmacro MUI_PAGE_INSTFILES
  47. !insertmacro MUI_PAGE_FINISH
  48. !insertmacro MUI_UNPAGE_WELCOME
  49. !insertmacro MUI_UNPAGE_CONFIRM
  50. !insertmacro MUI_UNPAGE_INSTFILES
  51. !insertmacro MUI_UNPAGE_FINISH
  52. !insertmacro MUI_LANGUAGE "English"
  53. Var configfile
  54. ;Sections
  55. ;--------
  56. Section "Polipo" Polipo
  57. ;Files that have to be installed for polipo to run and that the user
  58. ;cannot choose not to install
  59. SectionIn RO
  60. SetOutPath $INSTDIR
  61. File "${BIN}\polipo.exe"
  62. File "${BIN}\COPYING"
  63. File "${BIN}\CHANGES"
  64. File "${BIN}\config.sample"
  65. File "${BIN}\forbidden.sample"
  66. File "${BIN}\README.Windows"
  67. WriteIniStr "$INSTDIR\Polipo Website.url" "InternetShortcut" "URL" ${WEBSITE}
  68. StrCpy $configfile "config"
  69. SetOutPath $INSTDIR
  70. ;If there's already a polipo config file, ask if they want to
  71. ;overwrite it with the new one.
  72. IfFileExists "$INSTDIR\config" "" endifconfig
  73. MessageBox MB_ICONQUESTION|MB_YESNO "You already have a Polipo config file.$\r$\nDo you want to overwrite it with the default sample config file?" IDNO yesreplace
  74. Delete $INSTDIR\config
  75. Goto endifconfig
  76. yesreplace:
  77. StrCpy $configfile ".\config.sample"
  78. endifconfig:
  79. File /oname=$configfile ".\config.sample"
  80. IfFileExists "$INSTDIR\www\*.*" "" endifwebroot
  81. CreateDirectory "$INSTDIR\www"
  82. endifwebroot:
  83. CopyFiles "${BIN}\localindex.html" $INSTDIR\www\index.html
  84. IfFileExists "$INSTDIR\cache\*.*" "" endifcache
  85. CreateDirectory "$INSTDIR\cache"
  86. endifcache:
  87. SectionEnd
  88. SubSection /e "Shortcuts" Shortcuts
  89. Section "Start Menu" StartMenu
  90. SetOutPath $INSTDIR
  91. IfFileExists "$SMPROGRAMS\Polipo\*.*" "" +2
  92. RMDir /r "$SMPROGRAMS\Polipo"
  93. CreateDirectory "$SMPROGRAMS\Polipo"
  94. CreateShortCut "$SMPROGRAMS\Polipo\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config"
  95. CreateShortCut "$SMPROGRAMS\Polipo\Poliporc.lnk" "Notepad.exe" "$INSTDIR\config"
  96. CreateShortCut "$SMPROGRAMS\Polipo\Polipo Documentation.lnk" "$INSTDIR\www\index.html"
  97. CreateShortCut "$SMPROGRAMS\Polipo\Polipo Website.lnk" "$INSTDIR\Polipo Website.url"
  98. CreateShortCut "$SMPROGRAMS\Polipo\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
  99. SectionEnd
  100. Section "Desktop" Desktop
  101. SetOutPath $INSTDIR
  102. CreateShortCut "$DESKTOP\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config"
  103. SectionEnd
  104. Section /o "Run at startup" Startup
  105. SetOutPath $INSTDIR
  106. CreateShortCut "$SMSTARTUP\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config" "" "" "" SW_SHOWMINIMIZED
  107. SectionEnd
  108. SubSectionEnd
  109. Section "Uninstall"
  110. Delete "$DESKTOP\Polipo.lnk"
  111. Delete "$INSTDIR\polipo.exe"
  112. Delete "$INSTDIR\Polipo Website.url"
  113. Delete "$INSTDIR\config"
  114. Delete "$INSTDIR\config.sample"
  115. StrCmp $INSTDIR $INSTDIR +2 ""
  116. RMDir /r $INSTDIR
  117. Delete "$INSTDIR\Uninstall.exe"
  118. RMDir /r "$INSTDIR\Documents"
  119. RMDir $INSTDIR
  120. RMDir /r "$SMPROGRAMS\Polipo"
  121. RMDir /r "$APPDATA\Polipo"
  122. Delete "$SMSTARTUP\Polipo.lnk"
  123. DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Polipo"
  124. SectionEnd
  125. Section -End
  126. WriteUninstaller "$INSTDIR\Uninstall.exe"
  127. ;The registry entries simply add the Polipo uninstaller to the Windows
  128. ;uninstall list.
  129. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo" "DisplayName" "Polipo (remove only)"
  130. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo" "UninstallString" '"$INSTDIR\Uninstall.exe"'
  131. SectionEnd
  132. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  133. !insertmacro MUI_DESCRIPTION_TEXT ${Polipo} "The core executable and config files needed for Polipo to run."
  134. !insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} "Shortcuts to easily start Polipo"
  135. !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Polipo and it's documentation from the Start Menu"
  136. !insertmacro MUI_DESCRIPTION_TEXT ${Desktop} "A shortcut to start Polipo from the desktop"
  137. !insertmacro MUI_DESCRIPTION_TEXT ${Startup} "Launches Polipo automatically at startup in a minimized window"
  138. !insertmacro MUI_FUNCTION_DESCRIPTION_END