|
|
@ -1,44 +1,150 @@
|
|
|
|
;yacy.nsi
|
|
|
|
;yacy.nsi
|
|
|
|
;--------
|
|
|
|
; ----------------------------------------
|
|
|
|
;(C) 2004-2006 by Alexander Schier
|
|
|
|
;(C) 2004-2006 by Alexander Schier
|
|
|
|
;(C) 2008 by David Wieditz
|
|
|
|
;(C) 2008 by David Wieditz
|
|
|
|
|
|
|
|
/*----------------------------------------
|
|
|
|
|
|
|
|
MANUALS
|
|
|
|
|
|
|
|
http://nsis.sourceforge.net/Docs/
|
|
|
|
|
|
|
|
http://nsis.sourceforge.net/Docs/Modern%20UI%202/Readme.html
|
|
|
|
|
|
|
|
----------------------------------------
|
|
|
|
|
|
|
|
COMMAND LINE OPTIONS (case sensitive):
|
|
|
|
|
|
|
|
/S - silent install/uninstall
|
|
|
|
|
|
|
|
/D="C:\yacy" - installation folder
|
|
|
|
|
|
|
|
----------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
!define JRE_VERSION6 "1.6"
|
|
|
|
; ----------------------------------------
|
|
|
|
!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=23112" ;jre-6u7-windows-i586-p.exe
|
|
|
|
; MODERN UI
|
|
|
|
|
|
|
|
|
|
|
|
Name "YaCy"
|
|
|
|
!include MUI2.nsh
|
|
|
|
Icon "RELEASE\MAIN\addon\YaCy.ico"
|
|
|
|
|
|
|
|
UninstallIcon "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;requested execution level on Vista
|
|
|
|
; ----------------------------------------
|
|
|
|
RequestExecutionLevel user
|
|
|
|
; GENERAL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name "YaCy @REPL_VERSION@"
|
|
|
|
OutFile "RELEASE\WINDOWS\yacy_v@REPL_VERSION@_@REPL_DATE@_@REPL_REVISION_NR@.exe"
|
|
|
|
OutFile "RELEASE\WINDOWS\yacy_v@REPL_VERSION@_@REPL_DATE@_@REPL_REVISION_NR@.exe"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;default installation folder
|
|
|
|
InstallDir "$PROFILE\YaCy"
|
|
|
|
InstallDir "$PROFILE\YaCy"
|
|
|
|
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString"
|
|
|
|
InstallDirRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;requested execution level on Vista
|
|
|
|
|
|
|
|
RequestExecutionLevel user
|
|
|
|
|
|
|
|
|
|
|
|
SetCompressor /SOLID LZMA
|
|
|
|
SetCompressor /SOLID LZMA
|
|
|
|
|
|
|
|
!insertmacro MUI_RESERVEFILE_LANGDLL ;loads faster
|
|
|
|
|
|
|
|
|
|
|
|
InstType /CUSTOMSTRING=Custom
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; JAVA VERSION
|
|
|
|
|
|
|
|
|
|
|
|
#InstType "Minimal"
|
|
|
|
!define JRE_VERSION6 "1.6"
|
|
|
|
InstType "Normal"
|
|
|
|
!define JRE_URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=23112" ;jre-6u7-windows-i586-p.exe
|
|
|
|
#InstType "Full"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; The text to prompt the user to enter a directory
|
|
|
|
; ----------------------------------------
|
|
|
|
ComponentText "This will install YaCy v@REPL_VERSION@ (Build @REPL_DATE@) on your computer. Select which optional things you want to be installed."
|
|
|
|
; GENERAL APPEARANCE
|
|
|
|
; The text to prompt the user to enter a directory
|
|
|
|
|
|
|
|
DirText "Choose a directory to install into:"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LicenseText "You must agree to this license to install YaCy."
|
|
|
|
!define MUI_ICON "RELEASE\MAIN\addon\YaCy.ico"
|
|
|
|
LicenseData "gpl.txt"
|
|
|
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
|
|
|
|
|
|
|
|
|
|
|
|
Section "Binaries (required)"
|
|
|
|
!define MUI_WELCOMEFINISHPAGE_BITMAP "RELEASE\MAIN\addon\installer\network.bmp"
|
|
|
|
SectionIn 1 2 3 RO
|
|
|
|
|
|
|
|
|
|
|
|
!define MUI_HEADERIMAGE
|
|
|
|
;clear old shortcuts
|
|
|
|
!define MUI_HEADERIMAGE_BITMAP "RELEASE\MAIN\addon\installer\logo.bmp"
|
|
|
|
|
|
|
|
!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!define MUI_ABORTWARNING ;display warning before aborting installation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; INSTALLER PAGES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_LICENSE gpl.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!define MUI_COMPONENTSPAGE_NODESC
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
|
|
|
|
|
|
|
ComponentText "YaCy v@REPL_VERSION@ (Build @REPL_DATE@)"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; UNINSTALLER PAGES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; LANGUAGES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "English"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "French"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "German"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Spanish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "SpanishInternational"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "SimpChinese"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "TradChinese"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Japanese"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Korean"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Italian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Dutch"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Danish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Swedish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Norwegian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "NorwegianNynorsk"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Finnish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Greek"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Russian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Portuguese"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "PortugueseBR"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Polish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Ukrainian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Czech"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Slovak"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Croatian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Bulgarian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Hungarian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Thai"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Romanian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Latvian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Macedonian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Estonian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Turkish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Lithuanian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Slovenian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Serbian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "SerbianLatin"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Arabic"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Farsi"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Hebrew"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Indonesian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Mongolian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Luxembourgish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Albanian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Breton"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Belarusian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Icelandic"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Malay"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Bosnian"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Kurdish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Irish"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Uzbek"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Galician"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Afrikaans"
|
|
|
|
|
|
|
|
!insertmacro MUI_LANGUAGE "Catalan"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; INSTALLABLE MODULES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;InstType "Normal"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Section "YaCy"
|
|
|
|
|
|
|
|
SectionIn 1 RO
|
|
|
|
SetShellVarContext current
|
|
|
|
SetShellVarContext current
|
|
|
|
RMDir /r "$SMPROGRAMS\YaCy"
|
|
|
|
RMDir /r "$SMPROGRAMS\YaCy" ;clear old shortcuts
|
|
|
|
Delete "$QUICKLAUNCH\YaCy-Search.lnk" ;old
|
|
|
|
Delete "$QUICKLAUNCH\YaCy-Search.lnk" ;old
|
|
|
|
Delete "$DESKTOP\YaCy-Search.lnk" ;old
|
|
|
|
Delete "$DESKTOP\YaCy-Search.lnk" ;old
|
|
|
|
Delete "$SMSTARTUP\start YaCy (no console).lnk" ;old
|
|
|
|
Delete "$SMSTARTUP\start YaCy (no console).lnk" ;old
|
|
|
@ -51,12 +157,16 @@ Section "Binaries (required)"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DisplayName" "YaCy"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DisplayName" "YaCy"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString" '"$INSTDIR\uninstall.exe"'
|
|
|
|
WriteUninstaller "uninstall.exe"
|
|
|
|
WriteUninstaller "uninstall.exe"
|
|
|
|
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
|
|
Call DetectJRE
|
|
|
|
Section "Java"
|
|
|
|
|
|
|
|
SectionIn 1 RO
|
|
|
|
|
|
|
|
SetShellVarContext current
|
|
|
|
|
|
|
|
Call DetectJRE
|
|
|
|
SectionEnd
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
|
|
Section "Shortcuts in the Start Menu"
|
|
|
|
Section "Start Menu Group"
|
|
|
|
SectionIn 1 2 3
|
|
|
|
SectionIn 1
|
|
|
|
SetShellVarContext current
|
|
|
|
SetShellVarContext current
|
|
|
|
CreateDirectory "$SMPROGRAMS\YaCy"
|
|
|
|
CreateDirectory "$SMPROGRAMS\YaCy"
|
|
|
|
CreateShortCut "$SMPROGRAMS\YaCy\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
|
|
|
|
CreateShortCut "$SMPROGRAMS\YaCy\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
|
|
|
@ -65,8 +175,8 @@ Section "Shortcuts in the Start Menu"
|
|
|
|
CreateShortCut "$SMPROGRAMS\YaCy\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
|
|
|
CreateShortCut "$SMPROGRAMS\YaCy\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
|
|
|
|
SectionEnd
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
|
|
Section "YaCy on the Desktop"
|
|
|
|
Section "Desktop Icon"
|
|
|
|
SectionIn 1 2 3
|
|
|
|
SectionIn 1
|
|
|
|
SetShellVarContext current
|
|
|
|
SetShellVarContext current
|
|
|
|
CreateShortCut "$DESKTOP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
|
|
|
|
CreateShortCut "$DESKTOP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
|
|
|
|
SectionEnd
|
|
|
|
SectionEnd
|
|
|
@ -78,16 +188,18 @@ Section "YaCy in Startup"
|
|
|
|
SectionEnd
|
|
|
|
SectionEnd
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; UNINSTALLER
|
|
|
|
|
|
|
|
|
|
|
|
Section "Uninstall"
|
|
|
|
Section "Uninstall"
|
|
|
|
IfFileExists "$INSTDIR\DATA\yacy.running" 0 +3
|
|
|
|
IfFileExists "$INSTDIR\DATA\yacy.running" 0 +3
|
|
|
|
MessageBox MB_ICONSTOP "YaCy is still running. Please stop YaCy first."
|
|
|
|
MessageBox MB_ICONSTOP "YaCy is still running. Please stop YaCy first." /SD IDOK
|
|
|
|
Goto nouninstall
|
|
|
|
Goto nouninstall
|
|
|
|
|
|
|
|
|
|
|
|
MessageBox MB_YESNO|MB_ICONQUESTION "Do you really want to uninstall YaCy?" IDNO nouninstall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetShellVarContext current
|
|
|
|
SetShellVarContext current
|
|
|
|
|
|
|
|
|
|
|
|
RMDir /r "$INSTDIR\addon"
|
|
|
|
RMDir /r "$INSTDIR\addon"
|
|
|
|
|
|
|
|
RMDir /r "$INSTDIR\bin"
|
|
|
|
RMDir /r "$INSTDIR\classes"
|
|
|
|
RMDir /r "$INSTDIR\classes"
|
|
|
|
RMDir /r "$INSTDIR\defaults"
|
|
|
|
RMDir /r "$INSTDIR\defaults"
|
|
|
|
RMDir /r "$INSTDIR\htroot"
|
|
|
|
RMDir /r "$INSTDIR\htroot"
|
|
|
@ -99,7 +211,7 @@ Section "Uninstall"
|
|
|
|
RMDir /r "$INSTDIR\source"
|
|
|
|
RMDir /r "$INSTDIR\source"
|
|
|
|
Delete "$INSTDIR\*.*"
|
|
|
|
Delete "$INSTDIR\*.*"
|
|
|
|
|
|
|
|
|
|
|
|
MessageBox MB_YESNO|MB_ICONQUESTION "Do you want to keep the Data (i.e. if you want to reinstall later)?" IDYES keepdata
|
|
|
|
MessageBox MB_YESNO|MB_ICONQUESTION "Keep the data?" /SD IDYES IDYES keepdata
|
|
|
|
|
|
|
|
|
|
|
|
;delete all
|
|
|
|
;delete all
|
|
|
|
RMDir /r "$INSTDIR"
|
|
|
|
RMDir /r "$INSTDIR"
|
|
|
@ -114,17 +226,17 @@ Section "Uninstall"
|
|
|
|
nouninstall:
|
|
|
|
nouninstall:
|
|
|
|
SectionEnd
|
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; ----------------------------------------
|
|
|
|
|
|
|
|
; FUNCTIONS
|
|
|
|
|
|
|
|
|
|
|
|
Function GetJRE
|
|
|
|
Function GetJRE
|
|
|
|
; based on http://nsis.sourceforge.net/Simple_Java_Runtime_Download_Script
|
|
|
|
; based on http://nsis.sourceforge.net/Simple_Java_Runtime_Download_Script
|
|
|
|
MessageBox MB_OK "YaCy uses Java ${JRE_VERSION6}. \
|
|
|
|
|
|
|
|
It will now be downloaded and installed."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userInfo::getAccountType
|
|
|
|
userInfo::getAccountType
|
|
|
|
Pop $0
|
|
|
|
Pop $0
|
|
|
|
StrCmp $0 "Admin" +3
|
|
|
|
StrCmp $0 "Admin" +3
|
|
|
|
MessageBox MB_ICONEXCLAMATION "You need Administrator privileges to install Java. \
|
|
|
|
MessageBox MB_ICONEXCLAMATION "You need Administrator privileges to install Java. \
|
|
|
|
It will now be downloaded to the shared documents folder. \
|
|
|
|
It will now be downloaded to the shared documents folder. \
|
|
|
|
YaCy won't run without Java."
|
|
|
|
YaCy won't run without Java." /SD IDOK
|
|
|
|
|
|
|
|
|
|
|
|
SetShellVarContext all
|
|
|
|
SetShellVarContext all
|
|
|
|
StrCpy $2 "$DOCUMENTS\Java Runtime Environment (install for YaCy).exe"
|
|
|
|
StrCpy $2 "$DOCUMENTS\Java Runtime Environment (install for YaCy).exe"
|
|
|
@ -132,7 +244,7 @@ Function GetJRE
|
|
|
|
nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2
|
|
|
|
nsisdl::download /TIMEOUT=30000 ${JRE_URL} $2
|
|
|
|
Pop $R0 ;Get the return value
|
|
|
|
Pop $R0 ;Get the return value
|
|
|
|
StrCmp $R0 "success" +3
|
|
|
|
StrCmp $R0 "success" +3
|
|
|
|
MessageBox MB_OK "Download failed: $R0"
|
|
|
|
MessageBox MB_OK "Download failed: $R0" /SD IDOK
|
|
|
|
Return
|
|
|
|
Return
|
|
|
|
StrCmp $0 "Admin" +3
|
|
|
|
StrCmp $0 "Admin" +3
|
|
|
|
CreateShortCut "$DESKTOP\Install Java for YaCy.lnk" "$2"
|
|
|
|
CreateShortCut "$DESKTOP\Install Java for YaCy.lnk" "$2"
|
|
|
|