-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.ps1
27 lines (22 loc) · 786 Bytes
/
sign.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
param(
[string]$version
)
# Import developer command prompt commands
pushd 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools'
cmd /c "vsvars32.bat&set" |
foreach {
if ($_ -match "=") {
$v = $_.split("="); set-item -force -path "ENV:\$($v[0])" -value "$($v[1])"
}
}
popd
# Create paths if they are missing
New-Item -ItemType Directory -Force -Path temp
New-Item -ItemType Directory -Force -Path out
# Sign the assembly
ildasm PlayerIOClient.dll /out:temp/PlayerIOClient.il
ilasm temp/PlayerIOClient.il /dll /resource=temp/PlayerIOClient.res /key=KeyPair.snk /out:temp/PlayerIOClient.dll
# Create the NuGet package
.\NuGet.exe pack PlayerIOClient-Signed.nuspec -OutputDirectory out -Properties version=$version
# Remote temp
Remove-Item -Recurse -Force temp