|
4 | 4 | <Project>
|
5 | 5 | <PropertyGroup>
|
6 | 6 | <SigningToolFolder>$(ToolsFolder)</SigningToolFolder>
|
7 |
| - <SigningToolExe>$(SigningToolFolder)\SignClient.exe</SigningToolExe> |
8 |
| - <SigningFilelist>$(SigningToolFolder)\empty-filelist.txt</SigningFilelist> |
9 |
| - <SigningConfiguration>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), signing.json))\signing.json</SigningConfiguration> |
| 7 | + <SigningToolExe>$(SigningToolFolder)\sign.exe</SigningToolExe> |
| 8 | + <SigningFilelist>$(MSBuildThisFileDirectory)signing-empty-file-list.txt</SigningFilelist> |
| 9 | + <SigningConfiguration>--description "WiX Toolset" --description-url "https://wixtoolset.org/" --timestamp-url "http://timestamp.digicert.com" --file-list "$(SigningFilelist)" --azure-key-vault-managed-identity true --azure-key-vault-url "$(SigningVaultUri)" --azure-key-vault-certificate "$(SigningCertName)"</SigningConfiguration> |
10 | 10 | </PropertyGroup>
|
11 | 11 |
|
12 | 12 | <PropertyGroup Condition=" '$(IsWixTestSupportProject)'=='true' ">
|
|
113 | 113 | </ItemGroup>
|
114 | 114 | </Target>
|
115 | 115 |
|
116 |
| - <Target Name="_GetSignClient" |
117 |
| - Condition=" !Exists('$(SigningToolExe)') "> |
118 |
| - |
119 |
| - <WriteLinesToFile File='$(SigningFilelist)' Lines='do-not-sign-files-in-nupkg' Overwrite='true' /> |
120 |
| - |
121 |
| - <Exec Command='dotnet.exe tool install --tool-path "$(SigningToolFolder)" SignClient' IgnoreExitCode='true' /> |
122 |
| - </Target> |
123 |
| - |
124 |
| - <Target Name="SignOutput" DependsOnTargets="_GetSignClient" AfterTargets="AfterBuild" |
125 |
| - Condition=" '$(SigningUser)'!='' and '$(SignOutput)'!='false' and |
| 116 | + <Target Name="SignOutput" AfterTargets="AfterBuild" |
| 117 | + Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' and |
126 | 118 | ('$(MSBuildProjectExtension)'=='.csproj' or ('$(MSBuildProjectExtension)'=='.vcxproj' and '$(ConfigurationType)'!='StaticLibrary'))">
|
127 | 119 |
|
128 |
| - <Message Importance="high" Text="Signing file: $(TargetPath) using configuration from: $(SigningConfiguration)" /> |
| 120 | + <Message Importance="high" Text="Signing file: $(TargetPath)" /> |
129 | 121 |
|
130 |
| - <Exec Command='"$(SigningToolExe)" sign -i $(TargetPath) -c "$(SigningConfiguration)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"' |
| 122 | + <Exec Command='"$(SigningToolExe)" code azure-key-vault $(TargetPath) $(SigningConfiguration)' |
131 | 123 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
|
132 | 124 | </Target>
|
133 | 125 |
|
134 |
| - <Target Name="SignNupkg" DependsOnTargets="_GetSignClient" AfterTargets="Pack;PackNative" |
135 |
| - Condition=" '$(SigningUser)'!='' and '@(NuGetPackOutput)'!='' and '$(SignNupkg)'!='false' "> |
| 126 | + <Target Name="SignNupkg" AfterTargets="Pack;PackNative" |
| 127 | + Condition=" '$(SigningCertName)'!='' and '@(NuGetPackOutput)'!='' and '$(SignNupkg)'!='false' "> |
136 | 128 | <ItemGroup>
|
137 | 129 | <SigningNupkgs Include="@(NuGetPackOutput)" Condition=" '%(Extension)'=='.nupkg' " />
|
138 | 130 | </ItemGroup>
|
139 | 131 |
|
140 |
| - <Message Importance="high" Text="Signing nupkg: @(SigningNupkgs->'%(Identity)') using configuration from: $(SigningConfiguration)" /> |
| 132 | + <Message Importance="high" Text="Signing nupkg: @(SigningNupkgs->'%(Identity)')" /> |
141 | 133 |
|
142 |
| - <Exec Command='"$(SigningToolExe)" sign -i "@(SigningNupkgs->'%(Identity)')" -c "$(SigningConfiguration)" -f "$(SigningFilelist)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"' |
| 134 | + <Exec Command='"$(SigningToolExe)" code azure-key-vault "@(SigningNupkgs->'%(Identity)')" $(SigningConfiguration)' |
143 | 135 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
|
144 | 136 | </Target>
|
145 | 137 |
|
146 |
| - <Target Name="SignBundleEngine" DependsOnTargets="_GetSignClient" Condition=" '$(SigningUser)'!='' and '$(SignOutput)'!='false' "> |
147 |
| - <Message Importance="high" Text="Signing bundle engine: @(SignBundleEngine->'%(Identity)') using configuration from: $(SigningConfiguration)" /> |
| 138 | + <Target Name="SignBundleEngine" Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' "> |
| 139 | + <Message Importance="high" Text="Signing bundle engine: @(SignBundleEngine->'%(Identity)')" /> |
148 | 140 |
|
149 |
| - <Exec Command='"$(SigningToolExe)" sign -i "@(SignBundleEngine->'%(Identity)')" -c "$(SigningConfiguration)" -f "$(SigningFilelist)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"' |
| 141 | + <Exec Command='"$(SigningToolExe)" code azure-key-vault "@(SignBundleEngine->'%(Identity)')" $(SigningConfiguration)' |
150 | 142 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
|
151 | 143 | </Target>
|
152 | 144 |
|
153 |
| - <Target Name="SignBundle" DependsOnTargets="_GetSignClient" Condition=" '$(SigningUser)'!='' and '$(SignOutput)'!='false' "> |
154 |
| - <Message Importance="high" Text="Signing bundle: @(SignBundle->'%(Identity)') using configuration from: $(SigningConfiguration)" /> |
| 145 | + <Target Name="SignBundle" Condition=" '$(SigningCertName)'!='' and '$(SignOutput)'!='false' "> |
| 146 | + <Message Importance="high" Text="Signing bundle: @(SignBundle->'%(Identity)')" /> |
155 | 147 |
|
156 |
| - <Exec Command='"$(SigningToolExe)" sign -i "@(SignBundle->'%(Identity)')" -c "$(SigningConfiguration)" -f "$(SigningFilelist)" -n "WiX Toolset" -d "WiX Toolset" -u https://wixtoolset.org/ -r "$(SigningUser)" -s "$(SigningSecret)"' |
| 148 | + <Exec Command='"$(SigningToolExe)" code azure-key-vault "@(SignBundle->'%(Identity)')" $(SigningConfiguration)' |
157 | 149 | WorkingDirectory="$(MSBuildProjectDirectory)" EchoOff="true" />
|
158 | 150 | </Target>
|
159 | 151 |
|
|
0 commit comments