Skip to content

Commit 5f9a3f4

Browse files
committed
Sign exe in packaging.
1 parent db9ba92 commit 5f9a3f4

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

build.fsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,23 @@ Target "Build" <| fun _ -> buildSolution solution
1919

2020
Target "Package" (fun _ ->
2121
// pack IncrementalCompiler.exe with dependent module dlls to packed one
22-
let ilrepackExe = (getNugetPackage "ILRepack" "2.0.9") @@ "tools" @@ "ILRepack.exe"
22+
let ilrepackExe = (getNugetPackage "ILRepack" "2.0.10") @@ "tools" @@ "ILRepack.exe"
2323
Shell.Exec(ilrepackExe,
2424
"/wildcards /out:IncrementalCompiler.packed.exe IncrementalCompiler.exe *.dll",
2525
"./core/IncrementalCompiler/bin/Release") |> ignore
2626
// fix roslyn compiler to work well with UnityVS
2727
Shell.Exec("./core/RoslynCompilerFix/bin/Release/RoslynCompilerFix.exe",
2828
"IncrementalCompiler.packed.exe IncrementalCompiler.packed.fixed.exe",
2929
"./core/IncrementalCompiler/bin/Release") |> ignore
30+
// code signing
31+
if hasBuildParam "sign" then (
32+
let certFile = getBuildParam "sign"
33+
let timeUrl = "http://timestamp.verisign.com/scripts/timstamp.dll"
34+
let exeFile = "./core/IncrementalCompiler/bin/Release/IncrementalCompiler.packed.fixed.exe"
35+
Shell.Exec(@"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\signtool.exe",
36+
sprintf "sign /v /f %s /t %s %s" certFile timeUrl exeFile,
37+
".") |> ignore
38+
)
3039
// let's make package
3140
for target in ["Unity4"; "Unity5"] do
3241
let targetDir = binDir @@ target
@@ -50,7 +59,7 @@ Target "Package" (fun _ ->
5059

5160
Target "Help" <| fun _ ->
5261
showUsage solution (fun name ->
53-
if name = "package" then Some("Build package", "")
62+
if name = "package" then Some("Build package", "sign")
5463
else None)
5564

5665
"Clean"

0 commit comments

Comments
 (0)