2007-09-23 01:16:28 +00:00
;polipo-mingw.nsi - A basic win32 installer for Polipo
; Originally written by J Doe.
; Modified by Andrew Lewman
2008-02-13 15:08:45 +00:00
; This is licensed under a Modified BSD license.
2007-09-23 01:16:28 +00:00
;-----------------------------------------
;
!include " MUI.nsh "
2008-02-07 01:41:46 +00:00
!define VERSION " 1.0.4.0-forbidden-1 "
2007-09-23 01:16:28 +00:00
!define INSTALLER " polipo-${VERSION}-win32.exe "
!define WEBSITE " http://www.pps.jussieu.fr/~jch/software/polipo/ "
!define LICENSE " COPYING "
2008-02-07 01:41:46 +00:00
;BIN is where it expects to find polipo.exe
!define BIN " . "
2007-09-23 01:16:28 +00:00
2008-02-07 01:41:46 +00:00
SetCompressor lzma
2007-09-23 01:16:28 +00:00
OutFile ${INSTALLER}
InstallDir $PROGRAMFILES \ Polipo
SetOverWrite ifnewer
Name " Polipo "
Caption " Polipo ${VERSION} Setup "
BrandingText " A Caching Web Proxy "
CRCCheck on
XPStyle on
VIProductVersion " ${VERSION} "
VIAddVersionKey " ProductName " " Polipo: A caching web proxy "
VIAddVersionKey " Comments " " http://www.pps.jussieu.fr/~jch/software/polipo/ "
VIAddVersionKey " LegalTrademarks " " See COPYING "
2008-01-11 14:25:49 +00:00
VIAddVersionKey " LegalCopyright " " <EFBFBD> 2008, Juliusz Chroboczek"
2007-09-23 01:16:28 +00:00
VIAddVersionKey " FileDescription " " Polipo is a caching web proxy. "
VIAddVersionKey " FileVersion " " ${VERSION} "
2008-02-07 01:41:46 +00:00
!define MUI_WELCOMEPAGE_TITLE " Welcome to the Polipo ${VERSION} Setup Wizard "
2007-09-23 01:16:28 +00:00
!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 "
!define MUI_ABORTWARNING
!define MUI_ICON " ${NSISDIR} \Contrib\Graphics\Icons\win-install.ico "
!define MUI_UNICON " ${NSISDIR} \Contrib\Graphics\Icons\win-uninstall.ico "
!define MUI_HEADERIMAGE_BITMAP " ${NSISDIR} \Contrib\Graphics\Header\win.bmp "
!define MUI_HEADERIMAGE
2007-09-24 22:50:22 +00:00
;!define MUI_FINISHPAGE_RUN
2007-09-23 01:16:28 +00:00
!define MUI_FINISHPAGE_LINK " Visit the Polipo website for the latest updates. "
!define MUI_FINISHPAGE_LINK_LOCATION ${WEBSITE}
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE " English "
Var configfile
2008-02-07 01:41:46 +00:00
Var forbiddenfile
2007-09-23 01:16:28 +00:00
;Sections
;--------
Section " Polipo " Polipo
;Files that have to be installed for polipo to run and that the user
;cannot choose not to install
SectionIn RO
SetOutPath $INSTDIR
File " ${BIN}\polipo.exe "
File " ${BIN}\COPYING "
File " ${BIN}\CHANGES "
2008-01-11 15:24:54 +00:00
File " ${BIN}\config.sample "
2007-09-23 01:16:28 +00:00
File " ${BIN}\forbidden.sample "
File " ${BIN}\README.Windows "
2008-02-07 01:41:46 +00:00
File " ${BIN}\libgnurx-0.dll "
2007-09-23 01:16:28 +00:00
WriteIniStr " $INSTDIR \Polipo Website.url " " InternetShortcut " " URL " ${WEBSITE}
StrCpy $configfile " config "
2008-02-07 01:41:46 +00:00
StrCpy $forbiddenfile " forbidden "
2007-09-24 22:17:57 +00:00
SetOutPath $INSTDIR
2007-09-23 01:16:28 +00:00
;If there's already a polipo config file, ask if they want to
;overwrite it with the new one.
2007-09-24 22:17:57 +00:00
IfFileExists " $INSTDIR \config " " " endifconfig
2007-09-23 01:16:28 +00:00
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
2007-09-24 22:17:57 +00:00
Delete $INSTDIR \ config
2007-09-23 01:16:28 +00:00
Goto endifconfig
yesreplace :
2008-01-11 15:24:54 +00:00
StrCpy $configfile " .\config.sample "
2007-09-23 01:16:28 +00:00
endifconfig :
2008-01-11 15:24:54 +00:00
File /oname = $configfile " .\config.sample "
2008-02-07 01:41:46 +00:00
;If there's already a polipo forbidden file, ask if they want to
;overwrite it with the new one.
IfFileExists " $INSTDIR \forbidden " " " endifforbidden
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
Delete $INSTDIR \ forbidden
Goto endifforbidden
forbidyesreplace :
StrCpy $forbiddenfile " .\forbidden.sample "
endifforbidden :
File /oname = $forbiddenfile " .\forbidden.sample "
IfFileExists " $INSTDIR \bin\*.* " " " endifbinroot
CreateDirectory " $INSTDIR \bin "
endifbinroot :
CopyFiles " ${BIN}\localindex.html " $INSTDIR \ index.html
2007-09-23 01:16:28 +00:00
IfFileExists " $INSTDIR \cache\*.* " " " endifcache
CreateDirectory " $INSTDIR \cache "
endifcache :
SectionEnd
SubSection /e " Shortcuts " Shortcuts
Section " Start Menu " StartMenu
SetOutPath $INSTDIR
IfFileExists " $SMPROGRAMS \Polipo\*.* " " " + 2
RMDir /r " $SMPROGRAMS \Polipo "
CreateDirectory " $SMPROGRAMS \Polipo "
2007-09-24 22:50:22 +00:00
CreateShortCut " $SMPROGRAMS \Polipo\Polipo.lnk " " $INSTDIR \polipo.exe " " -c config "
2007-09-24 22:17:57 +00:00
CreateShortCut " $SMPROGRAMS \Polipo\Poliporc.lnk " " Notepad.exe " " $INSTDIR \config "
2007-09-23 01:16:28 +00:00
CreateShortCut " $SMPROGRAMS \Polipo\Polipo Documentation.lnk " " $INSTDIR \www\index.html "
CreateShortCut " $SMPROGRAMS \Polipo\Polipo Website.lnk " " $INSTDIR \Polipo Website.url "
CreateShortCut " $SMPROGRAMS \Polipo\Uninstall.lnk " " $INSTDIR \Uninstall.exe "
SectionEnd
Section " Desktop " Desktop
SetOutPath $INSTDIR
2007-09-24 22:50:22 +00:00
CreateShortCut " $DESKTOP \Polipo.lnk " " $INSTDIR \polipo.exe " " -c config "
2007-09-23 01:16:28 +00:00
SectionEnd
Section /o " Run at startup " Startup
SetOutPath $INSTDIR
2008-02-07 01:41:46 +00:00
CreateShortCut " $SMSTARTUP \Polipo.lnk " " $INSTDIR \polipo.exe " " -c config -f forbidden " " " " " " " SW_SHOWMINIMIZED
2007-09-23 01:16:28 +00:00
SectionEnd
SubSectionEnd
Section " Uninstall "
Delete " $DESKTOP \Polipo.lnk "
Delete " $INSTDIR \polipo.exe "
Delete " $INSTDIR \Polipo Website.url "
Delete " $INSTDIR \config "
Delete " $INSTDIR \config.sample "
2008-02-07 01:41:46 +00:00
Delete " $INSTDIR \forbidden.sample "
Delete " $INSTDIR \libgnurx-0.dll "
Delete " $INSTDIR \COPYING "
Delete " $INSTDIR \CHANGES "
Delete " $INSTDIR \README.Windows "
2007-09-24 22:17:57 +00:00
StrCmp $INSTDIR $INSTDIR + 2 " "
RMDir /r $INSTDIR
2007-09-23 01:16:28 +00:00
Delete " $INSTDIR \Uninstall.exe "
RMDir /r " $INSTDIR \Documents "
RMDir $INSTDIR
RMDir /r " $SMPROGRAMS \Polipo "
RMDir /r " $APPDATA \Polipo "
Delete " $SMSTARTUP \Polipo.lnk "
DeleteRegKey HKLM " SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Polipo "
SectionEnd
Section - End
WriteUninstaller " $INSTDIR \Uninstall.exe "
;The registry entries simply add the Polipo uninstaller to the Windows
;uninstall list.
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo " " DisplayName " " Polipo (remove only) "
WriteRegStr HKLM " Software\Microsoft\Windows\CurrentVersion\Uninstall\Polipo " " UninstallString " '"$INSTDIR\Uninstall.exe"'
SectionEnd
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${Polipo} " The core executable and config files needed for Polipo to run. "
!insertmacro MUI_DESCRIPTION_TEXT ${ShortCuts} " Shortcuts to easily start Polipo "
!insertmacro MUI_DESCRIPTION_TEXT ${StartMenu} " Shortcuts to access Polipo and it's documentation from the Start Menu "
!insertmacro MUI_DESCRIPTION_TEXT ${Desktop} " A shortcut to start Polipo from the desktop "
!insertmacro MUI_DESCRIPTION_TEXT ${Startup} " Launches Polipo automatically at startup in a minimized window "
!insertmacro MUI_FUNCTION_DESCRIPTION_END