]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that windows install will not overwrite existing service.conf
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 9 Jun 2016 14:51:42 +0000 (14:51 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 9 Jun 2016 14:51:42 +0000 (14:51 +0000)
  file (and ignore gui config choices if it exists).

git-svn-id: file:///svn/unbound/trunk@3772 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
winrc/setup.nsi

index 7c9c10ae9f5d76ba944817206fc6bb86a0290074..5a05ac372fc47e30bdbb8ebcb5428f4b01f33344 100644 (file)
@@ -3,6 +3,8 @@
          june).
        - Revert fix for NetworkService account on windows due to breakage
          it causes.
+       - Fix that windows install will not overwrite existing service.conf
+         file (and ignore gui config choices if it exists).
 
 7 June 2016: Ralph
        - Lookup localzones by taglist from acl.
index 513b30015b85a6ffc19cb86bca99bfc9377994d0..3a4388e135f3fb48ddb6664a0d6ec14170b97b13 100644 (file)
@@ -92,10 +92,18 @@ section "-hidden.postinstall"
        File "..\anchor-update.exe"
        File "unbound-control-setup.cmd"
        File "unbound-website.url"
-       File "service.conf"
        File "..\doc\example.conf"
        File "..\doc\Changelog"
 
+       # Does service.conf already exist?
+       IfFileExists "$INSTDIR\service.conf" 0 service_conf_not_found
+       # if so, leave it be and place the shipped file under another name
+       File "service.conf" /oname="service.conf.shipped"
+       goto end_service_conf_not_found
+       # or, it is not there, place it and fill it.
+       service_conf_not_found:
+       File "service.conf"
+
        # Store Root Key choice
        SectionGetFlags ${SectionRootKey} $R0
        IntOp $R0 $R0 & ${SF_SELECTED}
@@ -111,6 +119,7 @@ section "-hidden.postinstall"
        ${Else}
                WriteRegStr HKLM "Software\Unbound" "RootAnchor" ""
        ${EndIf}
+       end_service_conf_not_found:
 
        # store installation folder
        WriteRegStr HKLM "Software\Unbound" "InstallLocation" "$INSTDIR"