]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Windows work.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 10 Mar 2009 16:14:09 +0000 (16:14 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 10 Mar 2009 16:14:09 +0000 (16:14 +0000)
git-svn-id: file:///svn/unbound/trunk@1516 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
makedist.sh
util/config_file.c
winrc/setup.nsi

index 12fc73aa05f9d8eb28acbae11d016b0566132e6b..836febb16cf3e95f37d06e89b517ac1f865a8063 100644 (file)
@@ -1,6 +1,7 @@
 10 March 2009: Wouter
        - makedist -w strips out old rc.. and snapshot info from version.
        - setup.exe starts and stops unbound after install, before uninstall.
+       - unbound-checkconf recognizes absolute pathnames on windows (C:...).
 
 9 March 2009: Wouter
        - Nullsoft NSIS installer creation script.
index 861c94d737b43cc94fcebc82f2b52ada4d02559f..80e9229b79f908f18df1ee61e19a4fbc48bff9ac 100755 (executable)
@@ -149,7 +149,7 @@ done
 if [ "$DOWIN" = "yes" ]; then
     version=`./configure --version | head -1 | awk '{ print $3 }'` \
        || error_cleanup "Cannot determine version number."
-    version=`echo $version | sed -e 's/rc.*//' -e 's/_20.*//'`
+    version=`echo $version | sed -e 's/rc.*$//' -e 's/_20.*$//'`
     if [ "$RC" != "no" -o "$SNAPSHOT" != "no" ]; then
        if [ "$RC" != "no" ]; then
                version2=`echo $version | sed -e 's/rc.*//'`"rc$RC"
@@ -167,10 +167,11 @@ if [ "$DOWIN" = "yes" ]; then
     # procedure for making unbound installer on mingw. 
     info "Creating windows dist unbound $version"
     info "Calling configure"
-    echo './configure --enable-debug --enable-static-exe "--with-conf-file=C:\Program Files\Unbound\service.conf" --with-run-dir="" '"$*"
+    echo './configure --enable-debug --enable-static-exe "--with-conf-file=C:\Program Files\Unbound\service.conf" --with-run-dir="" --with-pidfile="" --with-chroot-dir="" '"$*"
     ./configure --enable-debug --enable-static-exe \
        "--with-conf-file=C:\Program Files\Unbound\service.conf" \
-       "--with-run-dir=C:\Program Files\Unbound" $* \
+       "--with-run-dir=C:\Program Files\Unbound" --with-pidfile="" \
+       --with-chroot-dir="" $* \
        || error_cleanup "Could not configure"
     info "Calling make"
     make || error_cleanup "Could not make"
index 98f02110d20ebeb4f15f8de16e9f87f69b7b5e03..400011968dddaf6c6313bbc169c9e95c498287a7 100644 (file)
@@ -835,6 +835,11 @@ strlen_after_chroot(const char* fname, struct config_file* cfg, int use_chdir)
                slashit = 1;
        }
        /* chdir */
+#ifdef UB_ON_WINDOWS
+       if(fname[0] != 0 && fname[1] == ':') {
+               /* full path, no chdir */
+       } else
+#endif
        if(fname[0] == '/' || !use_chdir) {
                /* full path, no chdir */
        } else if(cfg->directory && cfg->directory[0]) {
@@ -878,6 +883,11 @@ fname_after_chroot(const char* fname, struct config_file* cfg, int use_chdir)
                strncpy(buf, cfg->chrootdir, len);
                slashit = 1;
        }
+#ifdef UB_ON_WINDOWS
+       if(fname[0] != 0 && fname[1] == ':') {
+               /* full path, no chdir */
+       } else
+#endif
        /* chdir */
        if(fname[0] == '/' || !use_chdir) {
                /* full path, no chdir */
index f9e4a4e5786c39546f60e75f2d0595d5d87130ec..7de5c72cb9e7d3ff12b5e8135214df2b5beefa15 100644 (file)
@@ -28,22 +28,11 @@ VIProductVersion "${QUADVERSION}"
 # Global Variables
 Var StartMenuFolder
 
-# user interface pages to show
-# for the plain UI (using MUI2 now)
-#Page license
-#Page directory
-#Page instfiles
-#UninstPage uninstConfirm
-#UninstPage instfiles
-
 # use ReserveFile for files required before actual installation
 # makes the installer start faster
 #ReserveFile "System.dll"
 #ReserveFile "NsExec.dll"
-ReserveFile "..\LICENSE"
 
-#!define MUI_ICON "combined.ico"
-#!define MUI_UNICON "combined.ico"
 !define MUI_ICON "${NSISDIR}\contrib\graphics\icons\orange-install-nsis.ico"
 !define MUI_UNICON "${NSISDIR}\contrib\graphics\icons\orange-uninstall-nsis.ico"
 
@@ -52,10 +41,11 @@ ReserveFile "..\LICENSE"
 !define MUI_HEADERIMAGE_BITMAP "setup_top.bmp"
 !define MUI_WELCOMEFINISHPAGE_BITMAP "setup_left.bmp"
 !define MUI_ABORTWARNING
+#!define MUI_FINISHPAGE_NOAUTOCLOSE  # so we can inspect install log.
 
 !insertmacro MUI_PAGE_WELCOME
 !insertmacro MUI_PAGE_LICENSE "..\LICENSE"
-#!insertmacro MUI_PAGE_COMPONENTS
+!insertmacro MUI_PAGE_COMPONENTS
 !insertmacro MUI_PAGE_DIRECTORY
 
 !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
@@ -75,7 +65,26 @@ ReserveFile "..\LICENSE"
 !insertmacro MUI_LANGUAGE "English" 
 
 # default section, one per component, we have one component.
-section "Unbound section"
+section "Unbound" SectionUnbound
+       SectionIn RO  # cannot unselect this one
+       # real work in postinstall
+sectionEnd
+
+section "DLV - dlv.isc.org" SectionDLV
+       # add estimated size for key (Kb)
+       AddSize 2
+       SetOutPath $INSTDIR
+       NSISdl::download "http://ftp.isc.org/www/dlv/dlv.isc.org.key" "$INSTDIR\dlv.isc.org.key"
+       Pop $R0 # result from Inetc::get
+       ${If} $R0 != "success"
+               MessageBox MB_OK|MB_ICONEXCLAMATION "Download error (ftp.isc.org: $R0), click OK to abort installation" /SD IDOK
+               SetOutPath "C:\"
+               RMDir "$INSTDIR"  # doesnt work directory in use by us ...
+               Abort
+       ${EndIf}
+sectionEnd
+
+section "-hidden.postinstall"
        # copy files
        setOutPath $INSTDIR
        File "..\LICENSE"
@@ -89,6 +98,19 @@ section "Unbound section"
        File "service.conf"
        File "..\doc\example.conf"
 
+       # Store DLV choice
+       SectionGetFlags ${SectionDLV} $R0
+       IntOp $R0 $R0 & ${SF_SELECTED}
+       ${If} $R0 == ${SF_SELECTED}
+               ClearErrors
+               FileOpen $R1 "$INSTDIR\service.conf" a
+               IfErrors done
+               FileSeek $R1 0 END
+               FileWrite $R1 "$\nserver: dlv-anchor-file: $\"$INSTDIR\dlv.isc.org.key$\"$\n"
+               FileClose $R1
+         done:
+       ${EndIf}
+
        # store installation folder
        WriteRegStr HKLM "Software\Unbound" "InstallLocation" $INSTDIR
 
@@ -113,17 +135,25 @@ section "Unbound section"
 
        # install service entry
        nsExec::ExecToLog '"$INSTDIR\unbound-service-install.exe"'
-
        # start unbound service
        !insertmacro SERVICE "start" "unbound" ""
 sectionEnd
 
+# set section descriptions
+LangString DESC_unbound ${LANG_ENGLISH} "The base unbound DNS(SEC) validating caching resolver. $\r$\n$\r$\nIt can be found in the Services control panel, and a config file is in the Program Files folder."
+LangString DESC_dlv ${LANG_ENGLISH} "Set up to use DLV with dlv.isc.org. Downloads the key with a leap of faith. $\r$\n$\r$\nThis provides public keys that are used for security verification."
+
+!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
+  !insertmacro MUI_DESCRIPTION_TEXT ${SectionUnbound} $(DESC_unbound)
+  !insertmacro MUI_DESCRIPTION_TEXT ${SectionDLV} $(DESC_dlv)
+!insertmacro MUI_FUNCTION_DESCRIPTION_END
+
 # setup macros for uninstall functions.
 !undef UN
 !define UN "un."
 
 # uninstaller section
-section "un.Unbound section"
+section "un.Unbound"
        # stop unbound service
        !insertmacro SERVICE "stop" "unbound" ""
        # uninstall service entry
@@ -141,7 +171,8 @@ section "un.Unbound section"
        Delete "$INSTDIR\unbound-website.url"
        Delete "$INSTDIR\service.conf"
        Delete "$INSTDIR\example.conf"
-       RmDir "$INSTDIR"
+       Delete "$INSTDIR\dlv.isc.org.key"
+       RMDir "$INSTDIR"
 
        # start menu items
        !insertmacro MUI_STARTMENU_GETFOLDER UnboundStartMenu $StartMenuFolder