@@ -14,56 +14,80 @@ $MakePriPath = "${env:ProgramFiles(x86)}\Windows Kits\10\bin\10.0.22621.0\x64\ma
1414
1515$CertPasswordPlain = ConvertFrom-SecureString - SecureString $CertPassword - AsPlainText
1616
17- try {
17+ try
18+ {
1819 ((Get-Content - path .\dist\AppxManifest.xml - Raw) -replace ' 0.0.0.0-placeholder' , " $ ( $Version ) .0" ) | Set-Content - Path .\dist\AppxManifest.xml
1920 $MsixPath = " ecsact_sdk_$ ( $Version ) _windows_x64.msix"
2021
22+ Write-Output " Creating $MsixPath " * > CreateMsix.log
23+
2124 Copy-Item " .\dist\images\ecsact-color44.png" " .\dist\images\ecsact-color44.targetsize-44_altform-unplated.png" - Force
2225 Copy-Item " .\dist\images\ecsact-color150.png" " .\dist\images\ecsact-color150.targetsize-150_altform-unplated.png" - Force
2326
2427 & $MakePriPath createconfig / cf .\dist\priconfig.xml / dq en- US / o
25- if (-not $? ) {
28+ if (-not $? )
29+ {
2630 throw " $MakePriPath createconfig failed with exit code ${LastExitCode} "
2731 }
2832
29- & $MakePriPath new / pr .\dist / cf .\dist\priconfig.xml / dq en- US / o / OutputFile " .\dist\resources.pri"
30- if (-not $? ) {
33+ & $MakePriPath new / pr .\dist / cf .\dist\priconfig.xml / dq en- US / o / OutputFile " .\dist\resources.pri" * >> CopyMsix.log
34+ if (-not $? )
35+ {
3136 throw " $MakePriPath new failed with exit code ${LastExitCode} "
3237 }
3338
34- Set-ItemProperty - Path .\dist\bin\ecsact.exe - Name IsReadOnly - Value $false
35- Set-ItemProperty - Path .\dist\bin\ecsact_lsp_server.exe - Name IsReadOnly - Value $false
39+ $ExecutablesToSign = @ (
40+ ' .\dist\bin\ecsact.exe' ,
41+ ' .\dist\bin\ecsact_lsp_server.exe'
42+ )
3643
37- & $SignToolPath sign `
38- / debug / fd SHA384 `
39- / f $CertPath `
40- / p $CertPasswordPlain `
41- / tr http:// timestamp.sectigo.com / td SHA256 `
42- .\dist\bin\ecsact.exe `
43- .\dist\bin\ecsact_lsp_server.exe
44+ foreach ($Executable in $ExecutablesToSign )
45+ {
46+ Set-ItemProperty - Path $Executable - Name IsReadOnly - Value $false
47+ }
48+
49+ foreach ($Executable in $ExecutablesToSign )
50+ {
51+ Write-Progress - Status " Signing distribution files" - Activity " $Executable "
52+
53+ & $SignToolPath sign `
54+ / debug / fd SHA384 `
55+ / f $CertPath `
56+ / p $CertPasswordPlain `
57+ / tr http:// timestamp.sectigo.com / td SHA256 `
58+ $Executable * >> CopyMsix.log
4459
45- if (-not $? ) {
46- throw " Signing dist binaries failed with exit code ${LastExitCode} "
60+ if (-not $? )
61+ {
62+ throw " Signing dist binaries failed with exit code ${LastExitCode} "
63+ }
4764 }
4865
49- Set-ItemProperty - Path .\dist\bin\ecsact.exe - Name IsReadOnly - Value $true
50- Set-ItemProperty - Path .\dist\bin\ecsact_lsp_server.exe - Name IsReadOnly - Value $true
66+ foreach ($Executable in $ExecutablesToSign )
67+ {
68+ Set-ItemProperty - Path $Executable - Name IsReadOnly - Value $true
69+ }
5170
52- & $MakeAppxPath pack / v / o / h SHA384 / d .\dist\ / p $MsixPath
71+ & $MakeAppxPath pack / v / o / h SHA384 / d .\dist\ / p $MsixPath * >> CopyMsix.log
5372
54- if (-not $? ) {
73+ if (-not $? )
74+ {
5575 throw " $MakeAppxPath exited with ${LastExitCode} "
5676 }
5777
78+ Write-Progress - Status " Signing distribution files" - Activity " $MsixPath "
79+
5880 & $SignToolPath sign `
5981 / debug / fd SHA384 `
6082 / f $CertPath `
6183 / p $CertPasswordPlain `
6284 / tr http:// timestamp.sectigo.com / td SHA256 `
63- $MsixPath
64- if (-not $? ) {
85+ $MsixPath * >> CopyMsix.log
86+ if (-not $? )
87+ {
6588 throw " Signing ${MsixPath} failed with exit code ${LastExitCode} "
6689 }
67- } finally {
68- git checkout .\dist\AppxManifest.xml
90+ } finally
91+ {
92+ git checkout .\dist\AppxManifest.xml * >> CopyMsix.log
6993}
0 commit comments