ソースを参照

Avoid the D12 requirement.

Martijn Laan 5 ヶ月 前
コミット
d83727b05b
2 ファイル変更11 行追加15 行削除
  1. 10 14
      Components/TrustFunc.AllowedPublicKeys.inc
  2. 1 1
      issig.bat

+ 10 - 14
Components/TrustFunc.AllowedPublicKeys.inc

@@ -6,18 +6,14 @@
   Other builds: if you need only one key you can set AllowedPublicKey2Text To
   Other builds: if you need only one key you can set AllowedPublicKey2Text To
   an empty string and remove the '//end' marker. }
   an empty string and remove the '//end' marker. }
 
 
-AllowedPublicKey1Text := '''
-format issig-public-key
-key-id def0147c3bbc17ab99bf7b7a9c2de1390283f38972152418d7c2a4a7d7131a38
-public-x e3e943066aff8f28d2219fd71c9ffff4c8d1aa26bc4225434be67180ab5e242d
-public-y e419041c3f54551e86a1c47f387005cd535dfc9d64339b30d37f9a4f7866b650
+AllowedPublicKey1Text :=
+'format issig-public-key' + #13#10 +
+'key-id def0147c3bbc17ab99bf7b7a9c2de1390283f38972152418d7c2a4a7d7131a38' + #13#10 +
+'public-x e3e943066aff8f28d2219fd71c9ffff4c8d1aa26bc4225434be67180ab5e242d' + #13#10 +
+'public-y e419041c3f54551e86a1c47f387005cd535dfc9d64339b30d37f9a4f7866b650' + #13#10;
 
 
-''';
-
-AllowedPublicKey2Text := '''
-format issig-public-key
-key-id def020edee3c4835fd54d85eff8b66d4d899b22a777353ca4a114b652e5e7a28
-public-x 515dc7d6c16d4a46272ceb3d158c5630a96466ab4d948e72c2029d737c823097
-public-y f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61
-
-''';//end
+AllowedPublicKey2Text :=
+'format issig-public-key' + #13#10 +
+'key-id def020edee3c4835fd54d85eff8b66d4d899b22a777353ca4a114b652e5e7a28' + #13#10 +
+'public-x 515dc7d6c16d4a46272ceb3d158c5630a96466ab4d948e72c2029d737c823097' + #13#10 +
+'public-y f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61' + #13#10;//end

+ 1 - 1
issig.bat

@@ -49,7 +49,7 @@ set publickeyfile=_temp.ispublickey
 ISSigTool.exe export-public-key "%publickeyfile%"
 ISSigTool.exe export-public-key "%publickeyfile%"
 if errorlevel 1 goto failed
 if errorlevel 1 goto failed
 if not exist "%publickeyfile%" goto failed
 if not exist "%publickeyfile%" goto failed
-powershell.exe -NoProfile -Command "$filePath = '%targetfile%'; $replacementFilePath = '%publickeyfile%'; $startMarker = \"AllowedPublicKey2Text := '''\"; $endMarker = \"''';//end\"; try { $content = Get-Content -Raw -Path $filePath; $replacementText = Get-Content -Raw -Path $replacementFilePath; [string] $pattern = '(?s)' + [regex]::Escape($startMarker) + '.*?' + [regex]::Escape($endMarker); if ($content -match $pattern) { $replacement = $startMarker + \"`r`n\" + $replacementText + \"`r`n\" + $endMarker; $newContent = $content -replace $pattern, $replacement; $utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($false); [System.IO.File]::WriteAllText($filePath, $newContent, $utf8NoBomEncoding); Write-Host 'Embedded key.'; } else { Write-Host 'Markers not found.'; exit 1; } } catch { Write-Error ('Error: ' + $_.Exception.Message); exit 1; }"
+powershell.exe -NoProfile -Command "$filePath = '%targetfile%'; $replacementFilePath = '%publickeyfile%'; $startMarker = 'AllowedPublicKey2Text :='; $endMarker = ';//end'; try { $content = Get-Content -Raw -Path $filePath; $replacementText = Get-Content -Raw -Path $replacementFilePath; $replacementText = $replacementText -replace \"`r`n\", \"' + #13#10 +`r`n'\"; $replacementText = \"'\" + $replacementText + \"'\"; $replacementText = $replacementText -replace \" \+`r`n''\", \"\"; [string] $pattern = '(?s)' + [regex]::Escape($startMarker) + '.*?' + [regex]::Escape($endMarker); if ($content -match $pattern) { $replacement = $startMarker + \"`r`n\" + $replacementText  + $endMarker; $newContent = $content -replace $pattern, $replacement; $utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($false); [System.IO.File]::WriteAllText($filePath, $newContent, $utf8NoBomEncoding); Write-Host 'Embedded key.'; } else { Write-Host 'Markers not found.'; exit 1; } } catch { Write-Error ('Error: ' + $_.Exception.Message); exit 1; }"
 if errorlevel 1 goto failed
 if errorlevel 1 goto failed
 del "%publickeyfile%"
 del "%publickeyfile%"
 if errorlevel 1 goto failed
 if errorlevel 1 goto failed