2005-04-21 15:49:51 +02:00
;yacy.nsi
2008-11-10 16:33:54 +01:00
; ----------------------------------------
2006-08-23 15:09:48 +02:00
;(C) 2004-2006 by Alexander Schier
2010-08-26 18:53:20 +02:00
;(C) 2008-2010 by David Wieditz
2011-04-30 21:32:07 +02:00
;(C) 2011- by Rene Kluge
2008-11-10 16:33:54 +01:00
/*----------------------------------------
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
----------------------------------------*/
2006-08-23 15:09:48 +02:00
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; MODERN UI
2008-06-09 09:14:21 +02:00
2008-11-10 16:33:54 +01:00
!include MUI2.nsh
2009-03-19 19:53:30 +01:00
!include x64.nsh
2011-03-08 20:07:22 +01:00
!include FileFunc.nsh
2011-03-10 20:30:05 +01:00
!include WinVer.nsh
2009-03-19 19:53:30 +01:00
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; GENERAL
2008-06-07 20:40:20 +02:00
2009-03-19 19:53:30 +01:00
VIProductVersion "@REPL_VERSION@.0.0"
VIAddVersionKey "ProductName" "YaCy"
VIAddVersionKey "LegalCopyright" "YaCy"
VIAddVersionKey "FileVersion" "@REPL_VERSION@"
VIAddVersionKey "FileDescription" "YaCy"
VIAddVersionKey "OriginalFilename" "yacy_v@REPL_VERSION@_@REPL_DATE@_@REPL_REVISION_NR@.exe"
2008-11-10 16:33:54 +01:00
Name "YaCy @REPL_VERSION@"
2008-06-07 20:40:20 +02:00
OutFile "RELEASE\WINDOWS\yacy_v@REPL_VERSION@_@REPL_DATE@_@REPL_REVISION_NR@.exe"
2008-11-10 16:33:54 +01:00
;default installation folder
2008-06-14 20:34:12 +02:00
InstallDir "$PROFILE\YaCy"
2008-12-07 20:37:49 +01:00
InstallDirRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString"
2005-04-09 12:00:11 +02:00
2011-03-08 20:07:22 +01:00
;recommend free space in GB for YaCy
!define RecommendSpace "30"
2011-05-09 22:06:05 +02:00
; commands for firewall config, see http://support.microsoft.com/kb/947709/en-us
!define WinXPAddFwRulePort 'netsh firewall add allowedprogram name="YaCy" program="%SystemRoot%\System32\javaw.exe"'
!define WinXPDelFwRulePort 'netsh firewall del allowedprogram program="%SystemRoot%\System32\javaw.exe"'
!define WinVistaAddFwRulePort 'netsh advfirewall firewall add rule name="YaCy" program="%SystemRoot%\System32\javaw.exe" dir=in action=allow'
!define WinVistaDelFwRulePort 'netsh advfirewall firewall del rule name="YaCy"'
var WinAddFwRulePort
var WinDelFwRulePort
2011-03-14 20:32:08 +01:00
2010-08-26 18:53:20 +02:00
;requested execution level on Vista / 7
RequestExecutionLevel admin
2008-11-10 16:33:54 +01:00
2008-06-07 20:40:20 +02:00
SetCompressor /SOLID LZMA
2008-11-10 16:33:54 +01:00
!insertmacro MUI_RESERVEFILE_LANGDLL ;loads faster
2005-06-03 15:38:07 +02:00
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; JAVA VERSION
2009-03-19 19:53:30 +01:00
; http://www.java.com/de/download/manual.jsp BundleId +1 / +2
2005-04-09 12:00:11 +02:00
2008-11-10 16:33:54 +01:00
!define JRE_VERSION6 "1.6"
2010-08-27 20:55:44 +02:00
!define JRE_32 "http://yacy.berlios.de/download.php?what=jre&version=32&yacyrevnr=@REPL_REVISION_NR@"
!define JRE_64 "http://yacy.berlios.de/download.php?what=jre&version=64&yacyrevnr=@REPL_REVISION_NR@"
2005-04-09 12:00:11 +02:00
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; GENERAL APPEARANCE
2005-04-09 12:00:11 +02:00
2011-05-27 18:30:55 +02:00
;BrandingText "yacy.net"
2009-03-19 19:53:30 +01:00
2008-11-10 16:33:54 +01:00
!define MUI_ICON "RELEASE\MAIN\addon\YaCy.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
2005-04-09 12:00:11 +02:00
2008-11-10 16:33:54 +01:00
!define MUI_WELCOMEFINISHPAGE_BITMAP "RELEASE\MAIN\addon\installer\network.bmp"
!define MUI_HEADERIMAGE
!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@)"
2011-03-08 20:07:22 +01:00
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckDriveSpace
2008-11-10 16:33:54 +01:00
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
2011-03-14 20:32:08 +01:00
!define MUI_PAGE_CUSTOMFUNCTION_SHOW SHOW_PageFinish_custom
2010-08-30 22:04:19 +02:00
!define MUI_FINISHPAGE_SHOWREADME http://www.yacy-websuche.de/wiki/index.php/InstallerFinished
!define MUI_FINISHPAGE_SHOWREADME_TEXT $(finishPage)
2008-11-10 16:33:54 +01:00
!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"
2009-03-19 19:53:30 +01:00
LangString stillRunning ${LANG_ENGLISH} "YaCy is still active. Please stop YaCy first."
LangString keepData 0 "Do you want to keep the data?"
2009-06-23 11:39:35 +02:00
LangString noAdminForJava 0 "You need Administrator privileges to install Java. Java will now be downloaded to the shared documents folder. YaCy won't run without Java."
2010-08-30 22:04:19 +02:00
LangString finishPage 0 "Show how to configure the Windows Firewall for YaCy."
2011-03-08 20:07:22 +01:00
LangString yacyNoHd 0 "YaCy should be installed on a hard disk. Continue with selected folder?"
LangString yacyNeedSpace 0 "We recommend ${RecommendSpace} GB free space for YaCy. There are only $TempDriveFree GB left. Continue anyway?"
2011-03-10 20:30:05 +01:00
LangString yacyNeedOs 0 "Please run Windows 2000 or better (e.g. Windows XP, Vista or Windows 7) for YaCy."
2009-03-19 19:53:30 +01:00
LangString stillRunning ${LANG_FRENCH} "YaCy is still active. Please stop YaCy first."
LangString keepData 0 "Do you want to keep the data?"
2009-06-23 11:39:35 +02:00
LangString noAdminForJava 0 "You need Administrator privileges to install Java. Java will now be downloaded to the shared documents folder. YaCy won't run without Java."
2010-08-30 22:04:19 +02:00
LangString finishPage 0 "Show how to configure the Windows Firewall for YaCy."
2011-03-08 20:07:22 +01:00
LangString yacyNoHd 0 "YaCy should be installed on a hard disk. Continue with selected folder?"
LangString yacyNeedSpace 0 "We recommend ${RecommendSpace} GB free space for YaCy. There are only $TempDriveFree GB left. Continue anyway?"
2011-03-10 20:30:05 +01:00
LangString yacyNeedOs 0 "Please run Windows 2000 or better (e.g. Windows XP, Vista or Windows 7) for YaCy."
2009-03-19 19:53:30 +01:00
LangString stillRunning ${LANG_GERMAN} "YaCy ist noch aktiv. Bitte beenden Sie YaCy."
LangString keepData 0 "Moechten Sie die Daten behalten?"
2009-06-23 11:39:35 +02:00
LangString noAdminForJava 0 "Sie benoetigen Administrator-Rechte um Java zu installieren. Java wird nun in 'Gemeinsame Dokumente' gespeichert. YaCy benoetigt Java zur Ausfuehrung."
2010-08-30 22:04:19 +02:00
LangString finishPage 0 "Zeige die Windows Firewall Konfiguration fuer YaCy."
2011-03-08 20:07:22 +01:00
LangString yacyNoHd 0 "YaCy sollte auf einer Festplatte installiert werden. Soll der gewaehlte Ordner trotzdem verwendet werden?"
LangString yacyNeedSpace 0 "Wir empfehlen ${RecommendSpace} GB fuer YaCy. Es sind noch $TempDriveFree GB frei. Trotzdem fortfahren?"
2011-03-10 20:30:05 +01:00
LangString yacyNeedOs 0 "YaCy benoetigt Windows 2000 oder besser (z.B. Windows XP, Vista oder Windows 7)."
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; INSTALLABLE MODULES
;InstType "Normal"
Section "YaCy"
SectionIn 1 RO
2010-10-30 10:49:39 +02:00
SetShellVarContext current ; use system variables (folders) for current user
2011-03-03 19:34:32 +01:00
RMDir /r "$INSTDIR\lib" ;remove old libraries in case of update
2008-11-10 16:33:54 +01:00
RMDir /r "$SMPROGRAMS\YaCy" ;clear old shortcuts
2008-07-13 10:17:20 +02:00
Delete "$QUICKLAUNCH\YaCy-Search.lnk" ;old
Delete "$DESKTOP\YaCy-Search.lnk" ;old
Delete "$SMSTARTUP\start YaCy (no console).lnk" ;old
2005-04-09 12:00:11 +02:00
SetOutPath $INSTDIR
2009-01-06 19:17:53 +01:00
;set noindex attribute for windows indexing service
2011-03-09 21:19:34 +01:00
nsExec::Exec 'attrib +I "$INSTDIR"'
nsExec::Exec 'attrib +I "$INSTDIR\*" /S /D'
2009-01-06 19:17:53 +01:00
2008-06-07 20:40:20 +02:00
File /r "RELEASE\MAIN\*"
2005-04-09 12:00:11 +02:00
2008-12-07 20:37:49 +01:00
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DisplayName" "YaCy"
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "UninstallString" '"$INSTDIR\uninstall.exe"'
2005-04-09 12:00:11 +02:00
WriteUninstaller "uninstall.exe"
2008-11-10 16:33:54 +01:00
SectionEnd
2005-04-09 12:00:11 +02:00
2011-04-30 21:32:07 +02:00
Section "Java (Oracle JRE)" Sec_Java_id
2011-03-09 21:19:34 +01:00
SectionIn 1 RO
SetShellVarContext current
Call GetJRE
2005-04-09 12:00:11 +02:00
SectionEnd
2008-11-10 16:33:54 +01:00
Section "Start Menu Group"
SectionIn 1
2008-06-14 20:34:12 +02:00
SetShellVarContext current
2008-06-07 20:40:20 +02:00
CreateDirectory "$SMPROGRAMS\YaCy"
2008-07-24 08:49:30 +02:00
CreateShortCut "$SMPROGRAMS\YaCy\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
2008-06-07 20:40:20 +02:00
CreateShortCut "$SMPROGRAMS\YaCy\Readme.lnk" "$INSTDIR\readme.txt"
CreateShortCut "$SMPROGRAMS\YaCy\Uninstall.lnk" "$INSTDIR\Uninstall.exe"
2005-04-09 12:00:11 +02:00
SectionEnd
2008-11-10 16:33:54 +01:00
Section "Desktop Icon"
SectionIn 1
2008-06-14 20:34:12 +02:00
SetShellVarContext current
2008-07-24 08:49:30 +02:00
CreateShortCut "$DESKTOP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
2005-04-09 12:00:11 +02:00
SectionEnd
2011-05-09 22:06:05 +02:00
Section "Configure Firewall" Sec_Firewall_id
2011-03-14 20:32:08 +01:00
SectionIn 1
SetShellVarContext current
call OpenFirewall
SectionEnd
2008-09-02 17:09:31 +02:00
/*
2008-06-07 20:40:20 +02:00
Section "YaCy in Startup"
2008-06-14 20:34:12 +02:00
SetShellVarContext current
2008-07-24 08:49:30 +02:00
CreateShortCut "$SMSTARTUP\YaCy.lnk" "$INSTDIR\startYACY.bat" "" "$INSTDIR\addon\YaCy.ico" "" SW_SHOWMINIMIZED
2005-04-09 12:00:11 +02:00
SectionEnd
2008-09-02 17:09:31 +02:00
*/
2005-04-09 12:00:11 +02:00
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; UNINSTALLER
2005-04-09 12:00:11 +02:00
Section "Uninstall"
2009-03-19 19:53:30 +01:00
IfFileExists "$INSTDIR\DATA\yacy.running" 0 uninstall
MessageBox MB_ICONSTOP "$(stillRunning)" /SD IDOK
2008-06-14 20:34:12 +02:00
Goto nouninstall
2011-03-14 20:32:08 +01:00
2009-03-19 19:53:30 +01:00
uninstall:
2011-03-14 20:32:08 +01:00
Call un.CloseFirewall
2008-06-14 20:34:12 +02:00
SetShellVarContext current
2008-06-07 20:40:20 +02:00
RMDir /r "$INSTDIR\addon"
2011-03-09 21:19:34 +01:00
RMDir /r "$INSTDIR\bin"
2005-04-09 12:00:11 +02:00
RMDir /r "$INSTDIR\classes"
2008-06-07 20:40:20 +02:00
RMDir /r "$INSTDIR\defaults"
2005-04-09 12:00:11 +02:00
RMDir /r "$INSTDIR\htroot"
2008-06-07 20:40:20 +02:00
RMDir /r "$INSTDIR\lib"
RMDir /r "$INSTDIR\libx"
2005-06-03 15:38:07 +02:00
RMDir /r "$INSTDIR\locales"
2008-06-07 20:40:20 +02:00
RMDir /r "$INSTDIR\ranking"
RMDir /r "$INSTDIR\skins"
2005-04-09 12:00:11 +02:00
RMDir /r "$INSTDIR\source"
Delete "$INSTDIR\*.*"
2009-03-19 19:53:30 +01:00
MessageBox MB_YESNO|MB_ICONQUESTION "$(keepData)" /SD IDYES IDYES keepdata
2005-04-09 12:00:11 +02:00
2008-06-20 16:22:26 +02:00
;delete all
2005-04-09 12:00:11 +02:00
RMDir /r "$INSTDIR"
2008-06-20 16:22:26 +02:00
;or jump to this
2005-04-09 12:00:11 +02:00
keepdata:
2008-07-13 10:17:20 +02:00
RMDir /r "$SMPROGRAMS\YaCy"
Delete "$DESKTOP\YaCy.lnk"
Delete "$SMSTARTUP\YaCy.lnk"
2008-06-07 20:40:20 +02:00
2008-12-07 20:37:49 +01:00
DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy"
2008-06-07 20:40:20 +02:00
nouninstall:
2005-04-09 12:00:11 +02:00
SectionEnd
2008-06-09 09:14:21 +02:00
2008-11-10 16:33:54 +01:00
; ----------------------------------------
; FUNCTIONS
2011-03-09 21:19:34 +01:00
Function .onInit
2011-03-10 20:30:05 +01:00
; check Windows-Version, need Win 2000 or higher
${If} ${AtMostWinME}
MessageBox MB_ICONSTOP "$(yacyNeedOs)"
Abort
${EndIf}
2011-03-14 20:32:08 +01:00
; init of JRE section
2011-03-10 20:30:05 +01:00
; detect JRE first
2011-03-09 21:19:34 +01:00
var /global InstalledJREVersion
${If} ${RunningX64}
SetRegView 64
${EndIf}
ReadRegStr $InstalledJREVersion HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
2011-03-10 20:30:05 +01:00
; if right JRE already installed hide and deselect JRE section
2011-03-09 21:19:34 +01:00
${If} $InstalledJREVersion = ${JRE_VERSION6}
SectionSetText ${Sec_Java_id} ""
2011-03-10 20:30:05 +01:00
SectionSetFlags ${Sec_Java_id} 0
2011-03-09 21:19:34 +01:00
${EndIf}
2011-03-14 20:32:08 +01:00
; init of Firewall section, only valid for WindowsXP SP2/SP3 and Vista/Win 7 with Admin
var /global FirewallServiceStart
IntOp $FirewallServiceStart 3 + 0
${If} ${IsWinVista}
${OrIf} ${IsWin7}
2011-05-09 22:06:05 +02:00
StrCpy $WinAddFwRulePort '${WinVistaAddFwRulePort}'
StrCpy $WinDelFwRulePort '${WinVistaDelFwRulePort}'
ReadRegDWORD $FirewallServiceStart HKLM "SYSTEM\CurrentControlSet\services\MpsSvc" "Start"
2011-03-14 20:32:08 +01:00
${EndIf}
2011-05-09 22:06:05 +02:00
${If} ${IsWinXP}
${AndIf} ${AtLeastServicePack} 2
StrCpy $WinAddFwRulePort '${WinXPAddFwRulePort}'
StrCpy $WinDelFwRulePort '${WinXPDelFwRulePort}'
ReadRegDWORD $FirewallServiceStart HKLM "SYSTEM\CurrentControlSet\services\SharedAccess" "Start"
${EndIf}
2011-03-14 20:32:08 +01:00
;need Admin for firewall-config
${IfNot} $0 = "Admin"
IntOp $FirewallServiceStart 3 + 0
${EndIf}
; hide and deselect Firewall if no proper configuration
${If} $FirewallServiceStart > 2
SectionSetText ${Sec_Firewall_id} ""
SectionSetFlags ${Sec_Firewall_id} 0
${EndIf}
2011-03-09 21:19:34 +01:00
FunctionEnd
2008-06-09 09:14:21 +02:00
Function GetJRE
2010-08-26 18:53:20 +02:00
; based on http://nsis.sourceforge.net/Simple_Java_Runtime_Download_Script
2011-03-09 21:19:34 +01:00
${If} ${RunningX64}
2011-03-14 20:32:08 +01:00
StrCpy $3 ${JRE_64}
2011-03-09 21:19:34 +01:00
${Else}
StrCpy $3 ${JRE_32}
${EndIf}
2011-03-14 20:32:08 +01:00
;check if admin before download, advise if non
2008-06-21 10:42:06 +02:00
userInfo::getAccountType
Pop $0
2011-03-09 21:19:34 +01:00
2011-03-14 20:32:08 +01:00
${IfNot} $0 = "Admin"
2009-03-19 19:53:30 +01:00
MessageBox MB_ICONEXCLAMATION "$(noAdminForJava)" /SD IDOK
2011-03-09 21:19:34 +01:00
${EndIf}
2008-06-21 10:42:06 +02:00
SetShellVarContext all
2009-03-19 19:53:30 +01:00
StrCpy $2 "$DOCUMENTS\Java Runtime (install for YaCy).exe"
2008-06-21 10:42:06 +02:00
SetShellVarContext current
2009-03-19 19:53:30 +01:00
nsisdl::download /TIMEOUT=30000 $3 $2
2008-06-09 09:14:21 +02:00
Pop $R0 ;Get the return value
2011-03-09 21:19:34 +01:00
2011-03-14 20:32:08 +01:00
${IfNot} $R0 = "success"
2008-11-10 16:33:54 +01:00
MessageBox MB_OK "Download failed: $R0" /SD IDOK
2008-06-09 09:14:21 +02:00
Return
2011-03-09 21:19:34 +01:00
${EndIf}
2008-06-09 09:14:21 +02:00
2011-03-09 21:19:34 +01:00
${If} $0 == "Admin"
ExecWait "$2 /s"
Delete $2
${Else}
CreateShortCut "$DESKTOP\Install Java for YaCy.lnk" "$2"
2011-01-21 19:09:24 +01:00
${EndIf}
2011-03-08 20:07:22 +01:00
FunctionEnd
Function CheckDriveSpace
var /global RootFolder
var /global TempDriveFree
var /global RootFolderType
2011-03-14 20:32:08 +01:00
; if "\\Folder" it's a Network-Folder
2011-03-08 20:07:22 +01:00
StrCpy $RootFolder $InstDir 2
StrCmp $RootFolder "\\" NetworkFolder Driveletter
Networkfolder:
2011-03-14 20:32:08 +01:00
; prepare String for DriveSpace
2011-03-08 20:07:22 +01:00
${GetRoot} $RootFolder $InstDir
goto NoHDD
2011-03-14 20:32:08 +01:00
; now check drive-letters
2011-03-08 20:07:22 +01:00
Driveletter:
StrCpy $RootFolder $InstDir 3
2011-03-14 20:32:08 +01:00
; prepare for {GetDrives-Loop}
2011-03-08 20:07:22 +01:00
StrCpy $RootFolderType "invalid"
${GetDrives} "ALL" "CheckDriveType"
2011-03-14 20:32:08 +01:00
; jump if error
2011-03-08 20:07:22 +01:00
StrCmp $RootFolderType "invalid" CheckSpace
2011-03-14 20:32:08 +01:00
; jump if HDD
2011-03-08 20:07:22 +01:00
StrCmp $RootFolderType "HDD" CheckSpace
NoHDD:
2011-03-14 20:32:08 +01:00
; stay on folder-selection if user wants to give another folder, else check free space
2011-03-08 20:07:22 +01:00
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$(yacyNoHd)" IDYES NextPage
Abort
CheckSpace:
ClearErrors
${DriveSpace} $RootFolder "/D=F /S=G" $TempDriveFree
2011-03-14 20:32:08 +01:00
; if DriveSpace fails for any reason -> jump ahead
2011-03-08 20:07:22 +01:00
IfErrors NextPage
${If} $TempDriveFree < ${RecommendSpace}
MessageBox MB_ICONEXCLAMATION|MB_YESNO "$(yacyNeedSpace)" IDYES NextPage
Abort
${EndIf}
NextPage:
FunctionEnd
Function CheckDriveType
; based on http://nsis.sourceforge.net/GetDrives
2011-03-09 21:19:34 +01:00
${If} $9 == $RootFolder
StrCpy $RootFolderType $8
StrCpy $0 StopGetDrives
${EndIf}
2011-03-08 20:07:22 +01:00
Push $0
FunctionEnd
2011-03-14 20:32:08 +01:00
Function OpenFirewall
var /global ExecErrorCode
2011-05-09 22:06:05 +02:00
; run netsh
nsExec::ExecToStack '$WinAddFwRulePort'
2011-05-09 08:16:35 +02:00
pop $ExecErrorCode
; if run without error register for uninstall and clear finish page
${If} $ExecErrorCode = "0"
2011-05-09 22:06:05 +02:00
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRulePort" '$WinDelFwRulePort'
2011-03-14 20:32:08 +01:00
IntOp $FirewallServiceStart 0 + 0
${Else}
IntOp $FirewallServiceStart 3 + 0
${EndIf}
FunctionEnd
Function SHOW_PageFinish_custom
; hide and disable firewall info from wiki if firewall is open
${If} $FirewallServiceStart = 0
SendMessage $mui.FinishPage.ShowReadme ${BM_SETCHECK} 0 0
2011-05-09 22:06:05 +02:00
ShowWindow $mui.FinishPage.ShowReadme ${SW_HIDE}
2011-03-14 20:32:08 +01:00
${EndIf}
FunctionEnd
Function un.CloseFirewall
; get string for closing port from registy
2011-05-09 22:06:05 +02:00
ReadRegStr '$WinDelFwRulePort' HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRulePort"
2011-03-14 20:32:08 +01:00
; if found > run netsh to close port
2011-05-09 22:06:05 +02:00
${IfNot} '$WinDelFwRulePort' == ''
nsExec::ExecToStack '$WinDelFwRulePort'
2011-03-14 20:32:08 +01:00
${EndIf}
FunctionEnd