summaryrefslogtreecommitdiff
path: root/build.nsi
diff options
context:
space:
mode:
authorpca <pca@6c8d7289-2bf4-0310-a012-ef5d649a1542>2011-04-30 19:32:07 +0000
committerpca <pca@6c8d7289-2bf4-0310-a012-ef5d649a1542>2011-04-30 19:32:07 +0000
commit5e2d38ef190a69c49862a3669e0693f422105ebe (patch)
treeb4b300f7dbaad30f28450e7d1b0da82d1efae561 /build.nsi
parent4e8fa03514985e97444d2aef6912928beb787251 (diff)
Windows Installer:
- fix for firewall Vista/Win7 - update to JRE 1.6 u25 - TODO: fix for firewall WinXP and setting for uPnP (Port 1900) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7689 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'build.nsi')
-rwxr-xr-xbuild.nsi33
1 files changed, 17 insertions, 16 deletions
diff --git a/build.nsi b/build.nsi
index 66408e812..5c77fb233 100755
--- a/build.nsi
+++ b/build.nsi
@@ -2,6 +2,7 @@
; ----------------------------------------
;(C) 2004-2006 by Alexander Schier
;(C) 2008-2010 by David Wieditz
+;(C) 2011- by Rene Kluge
/*----------------------------------------
MANUALS
http://nsis.sourceforge.net/Docs/
@@ -41,12 +42,12 @@ InstallDirRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy"
!define RecommendSpace "30"
; some string for Firewall
-!define WinXPAddFwRule 'netsh firewall add portopening protocol=tcp port=8090 name=YaCy mode=enable'
-!define WinXPDelFwRule 'netsh firewall del portopening protocol=tcp port=8090'
-!define WinVistaAddFwRule 'netsh advfirewall firewall add rule name="YaCy" dir=in action=allow protocol=tcp localport=8090'
-!define WinVistaDelFwRule 'netsh advfirewall firewall del rule name="YaCy"'
-var WinAddFwRule
-var WinDelFwRule
+!define WinXPAddFwRulePort 'netsh firewall add portopening protocol=tcp port=8090 name=YaCy mode=enable'
+!define WinXPDelFwRulePort 'netsh firewall del portopening protocol=tcp port=8090'
+!define WinVistaAddFwRulePort 'netsh advfirewall firewall add rule name="YaCy" program="%SystemRoot%\System32\javaw.exe" dir=in action=allow protocol=tcp localport=8090'
+!define WinVistaDelFwRulePort 'netsh advfirewall firewall del rule name="YaCy"'
+var WinAddFwRulePort
+var WinDelFwRulePort
;requested execution level on Vista / 7
@@ -164,7 +165,7 @@ Section "YaCy"
WriteUninstaller "uninstall.exe"
SectionEnd
-Section "Sun Java" Sec_Java_id
+Section "Java (Oracle JRE)" Sec_Java_id
SectionIn 1 RO
SetShellVarContext current
Call GetJRE
@@ -267,15 +268,15 @@ Function .onInit
${If} ${IsWinVista}
${OrIf} ${IsWin7}
- StrCpy $WinAddFwRule '${WinVistaAddFwRule}'
- StrCpy $WinDelFwRule '${WinVistaDelFwRule}'
+ StrCpy $WinAddFwRulePort '${WinVistaAddFwRulePort}'
+ StrCpy $WinDelFwRulePort '${WinVistaDelFwRulePort}'
ReadRegDWORD $FirewallServiceStart HKLM "SYSTEM\CurrentControlSet\services\MpsSvc" "Start"
${EndIf}
${If} ${IsWinXP}
${AndIf} ${AtLeastServicePack} 2
- StrCpy $WinAddFwRule '${WinXPAddFwRule}'
- StrCpy $WinDelFwRule '${WinXPDelFwRule}'
+ StrCpy $WinAddFwRulePort '${WinXPAddFwRulePort}'
+ StrCpy $WinDelFwRulePort '${WinXPDelFwRulePort}'
ReadRegDWORD $FirewallServiceStart HKLM "SYSTEM\CurrentControlSet\services\SharedAccess" "Start"
${EndIf}
@@ -386,11 +387,11 @@ FunctionEnd
Function OpenFirewall
var /global ExecErrorCode
; run netsh
- nsExec::ExecToStack '$WinAddFwRule'
+ nsExec::ExecToStack '$WinAddFwRulePort'
pop $ExecErrorCode
; if run without error register for uninstall and clear finish page
${If} $ExecErrorCode = "0"
- WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRule" '$WinDelFwRule'
+ WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRulePort" '$WinDelFwRulePort'
IntOp $FirewallServiceStart 0 + 0
${Else}
IntOp $FirewallServiceStart 3 + 0
@@ -407,9 +408,9 @@ FunctionEnd
Function un.CloseFirewall
; get string for closing port from registy
- ReadRegStr '$WinDelFwRule' HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRule"
+ ReadRegStr '$WinDelFwRulePort' HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\YaCy" "DelFwRulePort"
; if found > run netsh to close port
- ${IfNot} '$WinDelFwRule' == ''
- nsExec::ExecToStack '$WinDelFwRule'
+ ${IfNot} '$WinDelFwRulePort' == ''
+ nsExec::ExecToStack '$WinDelFwRulePort'
${EndIf}
FunctionEnd