add test script

This commit is contained in:
Armin Schrenk
2023-09-26 13:42:18 +02:00
parent 625334c6c8
commit 93b4cbfb2c

23
dist/win/signJarDlls.ps1 vendored Normal file
View File

@@ -0,0 +1,23 @@
<#
1. Select jar file
2. extract jar to own directory
3. Sign everything
4. Update dlls in the jar
#>
New-Item -Path ".\extract" -ItemType Directory
Get-ChildItem -Path "." -File *.jar | ForEach-Object {
$jar = Copy-Item $_ -Destination ".\extract" -PassThru
Set-Location -Path ".\extract"
"Extracting jar $($jar.FullName)"
jar --file=$($_.FullName) --extract
Get-ChildItem -Path "." -Recurse -File "*.dll" | ForEach-Object {
<# pipe into signtool, here we are just writing something into the file #>
Set-Content -Path $_ -Value "Hello"
jar --file=$($jar.FullName) --update $(Resolve-Path -Relative -Path $_)
}
Move-Item -Path $($jar.FullName) -Destination $_ -Force
Remove-Item -Path ".\*" -Force -Recurse
Set-Location -Path ".."
}
Remove-Item -Path ".\extract"