|
|
|
@@ -90,11 +90,11 @@ foreach ($folder in @("public", "core", "app")) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
# Only update db/ if webdata.accdb doesn't exist yet (preserve live data) |
|
|
|
# Only update db/ if webdata.mdb doesn't exist yet (preserve live data) |
|
|
|
$dbSrc = Join-Path $srcPath "db" |
|
|
|
$dbDst = Join-Path $WEBROOT "db" |
|
|
|
if (Test-Path $dbSrc) { |
|
|
|
if (-not (Test-Path "$dbDst\webdata.accdb")) { |
|
|
|
if (-not (Test-Path "$dbDst\webdata.mdb")) { |
|
|
|
if (Test-Path $dbDst) { Remove-Item $dbDst -Recurse -Force } |
|
|
|
Copy-Item $dbSrc $WEBROOT -Recurse -Force |
|
|
|
Log "Copied db/ (first deploy)." |
|
|
|
@@ -112,8 +112,8 @@ if (Test-Path $dbSrc) { |
|
|
|
$webConfigPath = Join-Path $publicDst "web.config" |
|
|
|
if (Test-Path $webConfigPath) { |
|
|
|
$wc = [System.IO.File]::ReadAllText($webConfigPath) |
|
|
|
$newConn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=$WEBROOT\db\webdata.accdb;Persist Security Info=False;" |
|
|
|
$wc = [regex]::Replace($wc, 'Provider=Microsoft\.ACE\.OLEDB[^"]+', $newConn) |
|
|
|
$newConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=$WEBROOT\db\webdata.mdb;Persist Security Info=False;" |
|
|
|
$wc = [regex]::Replace($wc, 'Provider=Microsoft\.(ACE\.OLEDB\.12\.0|Jet\.OLEDB\.4\.0)[^"]+', $newConn) |
|
|
|
if ($wc -notmatch 'enableParentPaths') { |
|
|
|
$wc = $wc -replace '<system.webServer>', '<system.webServer><asp enableParentPaths="true" />' |
|
|
|
} |
|
|
|
|