update postflight to put the man page in the right place on osx.
[tor/rransom.git] / contrib / polipo / polipo-mingw.nsi
blob8e4f76b06d1b423f10b854234510acd31569ac4e
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 ;-----------------------------------------
7 !include "MUI.nsh"
9 !define VERSION "1.0.3"
10 !define INSTALLER "polipo-${VERSION}-win32.exe"
11 !define WEBSITE "http://www.pps.jussieu.fr/~jch/software/polipo/"
13 !define LICENSE "COPYING"
14 !define BIN "." ;BIN is where it expects to find polipo.exe
16 SetCompressor /SOLID LZMA ;Tighter compression
17 RequestExecutionLevel user ;Updated for Vista compatibility
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" "©2007, Juliusz Chroboczek"
32 VIAddVersionKey "FileDescription" "Polipo is a caching web proxy."
33 VIAddVersionKey "FileVersion" "${VERSION}"
35 !define MUI_WELCOMEPAGE_TITLE "Welcome to the Polipo 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 ; There's no point in having a clickthrough license: Our license adds
48 ; certain rights, but doesn't remove them.
49 ; !insertmacro MUI_PAGE_LICENSE "${LICENSE}"
50 !insertmacro MUI_PAGE_COMPONENTS
51 !insertmacro MUI_PAGE_DIRECTORY
52 !insertmacro MUI_PAGE_INSTFILES
53 !insertmacro MUI_PAGE_FINISH
54 !insertmacro MUI_UNPAGE_WELCOME
55 !insertmacro MUI_UNPAGE_CONFIRM
56 !insertmacro MUI_UNPAGE_INSTFILES
57 !insertmacro MUI_UNPAGE_FINISH
58 !insertmacro MUI_LANGUAGE "English"
60 Var configfile
62 ;Sections
63 ;--------
65 Section "Polipo" Polipo
66 ;Files that have to be installed for polipo to run and that the user
67 ;cannot choose not to install
68 SectionIn RO
69 SetOutPath $INSTDIR
70 File "${BIN}\polipo.exe"
71 File "${BIN}\COPYING"
72 File "${BIN}\CHANGES"
73 File "${BIN}\config.windows"
74 File "${BIN}\forbidden.sample"
75 File "${BIN}\README.Windows"
76 WriteIniStr "$INSTDIR\Polipo Website.url" "InternetShortcut" "URL" ${WEBSITE}
78 StrCpy $configfile "config"
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.windows"
88 endifconfig:
89 File /oname=$configfile ".\config.windows"
90 IfFileExists "$INSTDIR\www\*.*" "" endifwebroot
91 CreateDirectory "$INSTDIR\www"
92 endifwebroot:
93 CopyFiles "${BIN}\localindex.html" $INSTDIR\www\index.html
94 IfFileExists "$INSTDIR\cache\*.*" "" endifcache
95 CreateDirectory "$INSTDIR\cache"
96 endifcache:
97 SectionEnd
99 SubSection /e "Shortcuts" Shortcuts
101 Section "Start Menu" StartMenu
102 SetOutPath $INSTDIR
103 IfFileExists "$SMPROGRAMS\Polipo\*.*" "" +2
104 RMDir /r "$SMPROGRAMS\Polipo"
105 CreateDirectory "$SMPROGRAMS\Polipo"
106 CreateShortCut "$SMPROGRAMS\Polipo\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config"
107 CreateShortCut "$SMPROGRAMS\Polipo\Poliporc.lnk" "Notepad.exe" "$INSTDIR\config"
108 CreateShortCut "$SMPROGRAMS\Polipo\Polipo Documentation.lnk" "$INSTDIR\www\index.html"
109 CreateShortCut "$SMPROGRAMS\Polipo\Polipo Website.lnk" "$INSTDIR\Polipo Website.url"
110 CreateShortCut "$SMPROGRAMS\Polipo\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
111 SectionEnd
113 Section "Desktop" Desktop
114 SetOutPath $INSTDIR
115 CreateShortCut "$DESKTOP\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config"
116 SectionEnd
118 Section /o "Run at startup" Startup
119 SetOutPath $INSTDIR
120 CreateShortCut "$SMSTARTUP\Polipo.lnk" "$INSTDIR\polipo.exe" "-c config" "" "" "" SW_SHOWMINIMIZED
121 SectionEnd
123 SubSectionEnd
125 Section "Uninstall"
126 Delete "$DESKTOP\Polipo.lnk"
127 Delete "$INSTDIR\polipo.exe"
128 Delete "$INSTDIR\Polipo Website.url"
129 Delete "$INSTDIR\config"
130 Delete "$INSTDIR\config.sample"
131 StrCmp $INSTDIR $INSTDIR +2 ""
132 RMDir /r $INSTDIR
133 Delete "$INSTDIR\Uninstall.exe"
134 RMDir /r "$INSTDIR\Documents"
135 RMDir $INSTDIR
136 RMDir /r "$SMPROGRAMS\Polipo"
137 RMDir /r "$APPDATA\Polipo"
138 Delete "$SMSTARTUP\Polipo.lnk"
139 DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Polipo"
140 SectionEnd
142 Section -End
143 WriteUninstaller "$INSTDIR\Uninstall.exe"
144 ;The registry entries simply add the Polipo uninstaller to the Windows
145 ;uninstall list.
146 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo" "DisplayName" "Polipo (remove only)"
147 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo" "UninstallString" '"$INSTDIR\Uninstall.exe"'
148 SectionEnd
150 !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
151 !insertmacro MUI_DESCRIPTION_TEXT ${Polipo} "The core executable and config files needed for Polipo to run."
152 !insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} "Shortcuts to easily start Polipo"
153 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} "Shortcuts to access Polipo and it's documentation from the Start Menu"
154 !insertmacro MUI_DESCRIPTION_TEXT ${Desktop} "A shortcut to start Polipo from the desktop"
155 !insertmacro MUI_DESCRIPTION_TEXT ${Startup} "Launches Polipo automatically at startup in a minimized window"
156 !insertmacro MUI_FUNCTION_DESCRIPTION_END