Update directions, copyrights, and clarify licenses of polipo
[tor/rransom.git] / contrib / polipo / polipo-mingw.nsi
blob624e825eb606500ccb9dcabc7d648bc55ecb1763
1 ;polipo-mingw.nsi - A basic win32 installer for Polipo
2 ; Originally written by J Doe.
3 ; Modified by Andrew Lewman
4 ; This is licensed under a Modified BSD license.
5 ;-----------------------------------------
7 !include "MUI.nsh"
9 !define VERSION "1.0.4.0-forbidden-1"
10 !define INSTALLER "polipo-${VERSION}-win32.exe"
11 !define WEBSITE "http://www.pps.jussieu.fr/~jch/software/polipo/"
13 !define LICENSE "COPYING"
14 ;BIN is where it expects to find polipo.exe
15 !define BIN "."
17 SetCompressor lzma
18 OutFile ${INSTALLER}
19 InstallDir $PROGRAMFILES\Polipo
20 SetOverWrite ifnewer
22 Name "Polipo"
23 Caption "Polipo ${VERSION} Setup"
24 BrandingText "A Caching Web Proxy"
25 CRCCheck on
26 XPStyle on
27 VIProductVersion "${VERSION}"
28 VIAddVersionKey "ProductName" "Polipo: A caching web proxy"
29 VIAddVersionKey "Comments" "http://www.pps.jussieu.fr/~jch/software/polipo/"
30 VIAddVersionKey "LegalTrademarks" "See COPYING"
31 VIAddVersionKey "LegalCopyright" "©2008, Juliusz Chroboczek"
32 VIAddVersionKey "FileDescription" "Polipo is a caching web proxy."
33 VIAddVersionKey "FileVersion" "${VERSION}"
35 !define MUI_WELCOMEPAGE_TITLE "Welcome to the Polipo ${VERSION} Setup Wizard"
36 !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"
37 !define MUI_ABORTWARNING
38 !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\win-install.ico"
39 !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico"
40 !define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\win.bmp"
41 !define MUI_HEADERIMAGE
42 ;!define MUI_FINISHPAGE_RUN
43 !define MUI_FINISHPAGE_LINK "Visit the Polipo website for the latest updates."
44 !define MUI_FINISHPAGE_LINK_LOCATION ${WEBSITE}
46 !insertmacro MUI_PAGE_WELCOME
47 !insertmacro MUI_PAGE_COMPONENTS
48 !insertmacro MUI_PAGE_DIRECTORY
49 !insertmacro MUI_PAGE_INSTFILES
50 !insertmacro MUI_PAGE_FINISH
51 !insertmacro MUI_UNPAGE_WELCOME
52 !insertmacro MUI_UNPAGE_CONFIRM
53 !insertmacro MUI_UNPAGE_INSTFILES
54 !insertmacro MUI_UNPAGE_FINISH
55 !insertmacro MUI_LANGUAGE "English"
57 Var configfile
58 Var forbiddenfile
60 ;Sections
61 ;--------
63 Section "Polipo" Polipo
64 ;Files that have to be installed for polipo to run and that the user
65 ;cannot choose not to install
66 SectionIn RO
67 SetOutPath $INSTDIR
68 File "${BIN}\polipo.exe"
69 File "${BIN}\COPYING"
70 File "${BIN}\CHANGES"
71 File "${BIN}\config.sample"
72 File "${BIN}\forbidden.sample"
73 File "${BIN}\README.Windows"
74 File "${BIN}\libgnurx-0.dll"
75 WriteIniStr "$INSTDIR\Polipo Website.url" "InternetShortcut" "URL" ${WEBSITE}
77 StrCpy $configfile "config"
78 StrCpy $forbiddenfile "forbidden"
79 SetOutPath $INSTDIR
80 ;If there's already a polipo config file, ask if they want to
81 ;overwrite it with the new one.
82 IfFileExists "$INSTDIR\config" "" endifconfig
83 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
84 Delete $INSTDIR\config
85 Goto endifconfig
86 yesreplace:
87 StrCpy $configfile ".\config.sample"
88 endifconfig:
89 File /oname=$configfile ".\config.sample"
90 ;If there's already a polipo forbidden file, ask if they want to
91 ;overwrite it with the new one.
92 IfFileExists "$INSTDIR\forbidden" "" endifforbidden
93 MessageBox MB_ICONQUESTION|MB_YESNO "You already have a Polipo forbidden file.$\r$\nDo you want to overwrite it with the default sample forbidden file?" IDNO forbidyesreplace
94 Delete $INSTDIR\forbidden
95 Goto endifforbidden
96 forbidyesreplace:
97 StrCpy $forbiddenfile ".\forbidden.sample"
98 endifforbidden:
99 File /oname=$forbiddenfile ".\forbidden.sample"
100 IfFileExists "$INSTDIR\bin\*.*" "" endifbinroot
101 CreateDirectory "$INSTDIR\bin"
102 endifbinroot:
103 CopyFiles "${BIN}\localindex.html" $INSTDIR\index.html
104 IfFileExists "$INSTDIR\cache\*.*" "" endifcache
105 CreateDirectory "$INSTDIR\cache"
106 endifcache:
107 SectionEnd
109 SubSection /e "Shortcuts" Shortcuts
111 Section "Start Menu" StartMenu
112 SetOutPath $INSTDIR
113 IfFileExists "$SMPROGRAMS\Polipo\*.*" "" +2
114 RMDir /r "$SMPROGRAMS\Polipo"
115 CreateDirectory "$SMPROGRAMS\Polipo"
116 CreateShortCut "$SMPROGRAMS\Polipo\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config"
117 CreateShortCut "$SMPROGRAMS\Polipo\Poliporc.lnk" "Notepad.exe" "$INSTDIR\config"
118 CreateShortCut "$SMPROGRAMS\Polipo\Polipo Documentation.lnk" "$INSTDIR\www\index.html"
119 CreateShortCut "$SMPROGRAMS\Polipo\Polipo Website.lnk" "$INSTDIR\Polipo Website.url"
120 CreateShortCut "$SMPROGRAMS\Polipo\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
121 SectionEnd
123 Section "Desktop" Desktop
124 SetOutPath $INSTDIR
125 CreateShortCut "$DESKTOP\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config"
126 SectionEnd
128 Section /o "Run at startup" Startup
129 SetOutPath $INSTDIR
130 CreateShortCut "$SMSTARTUP\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config -f forbidden" "" "" "" SW_SHOWMINIMIZED
131 SectionEnd
133 SubSectionEnd
135 Section "Uninstall"
136 Delete "$DESKTOP\Polipo.lnk"
137 Delete "$INSTDIR\polipo.exe"
138 Delete "$INSTDIR\Polipo Website.url"
139 Delete "$INSTDIR\config"
140 Delete "$INSTDIR\config.sample"
141 Delete "$INSTDIR\forbidden.sample"
142 Delete "$INSTDIR\libgnurx-0.dll"
143 Delete "$INSTDIR\COPYING"
144 Delete "$INSTDIR\CHANGES"
145 Delete "$INSTDIR\README.Windows"
146 StrCmp $INSTDIR $INSTDIR +2 ""
147 RMDir /r $INSTDIR
148 Delete "$INSTDIR\Uninstall.exe"
149 RMDir /r "$INSTDIR\Documents"
150 RMDir $INSTDIR
151 RMDir /r "$SMPROGRAMS\Polipo"
152 RMDir /r "$APPDATA\Polipo"
153 Delete "$SMSTARTUP\Polipo.lnk"
154 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Polipo"
155 SectionEnd
157 Section -End
158 WriteUninstaller "$INSTDIR\Uninstall.exe"
159 ;The registry entries simply add the Polipo uninstaller to the Windows
160 ;uninstall list.
161 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo" "DisplayName" "Polipo (remove only)"
162 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo" "UninstallString" '"$INSTDIR\Uninstall.exe"'
163 SectionEnd
165 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
166 !insertmacro MUI_DESCRIPTION_TEXT ${Polipo} "The core executable and config files needed for Polipo to run."
167 !insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} "Shortcuts to easily start Polipo"
168 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Polipo and it's documentation from the Start Menu"
169 !insertmacro MUI_DESCRIPTION_TEXT ${Desktop} "A shortcut to start Polipo from the desktop"
170 !insertmacro MUI_DESCRIPTION_TEXT ${Startup} "Launches Polipo automatically at startup in a minimized window"
171 !insertmacro MUI_FUNCTION_DESCRIPTION_END