Skip to content

Commit ed67bc2

Browse files
authored
Merge pull request #1301 from tygor/patch-1
Added Visual Studio packaging advice for "
2 parents ec45835 + 24e357f commit ed67bc2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/using/application-signing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,24 @@ An example invocation including both of these features would be something like:
1616
PM> Squirrel --releasify MyApp.1.0.0.nupkg -n "/a /f CodeCert.pfx /p MySecretCertPassword /fd sha256 /tr http://timestamp.digicert.com /td sha256"
1717
~~~
1818

19+
If you are using the [Visual Studio Build Packaging](visual-studio-packaging.md) process be careful how you escape your quotation marks in the `XML` of your `.csproj` file for the -n, --signWithParams argument. The wrapping quotation marks must be defined in `XML` safe ampersand escape strings or `"`. Within this command you will likely need quotation marks around your certificate password. Since this is already within a quoted string you will need to double quote the password: `/p ""PASSWORD""`.
20+
21+
~~~xml
22+
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release'">
23+
<GetAssemblyIdentity AssemblyFiles="$(TargetPath)">
24+
<Output TaskParameter="Assemblies" ItemName="myAssemblyInfo" />
25+
</GetAssemblyIdentity>
26+
<Exec Command="nuget pack MyApp.nuspec -Version %(myAssemblyInfo.Version) -Properties Configuration=Release -OutputDirectory $(OutDir) -BasePath $(OutDir)" />
27+
<!-- Notice the use of &quot; rather than " after the \n flag. For the password to contain spaces we need to double-&quot; the string. -->
28+
<Exec Command="squirrel --releasify $(OutDir)MyApp.$([System.Version]::Parse(%(myAssemblyInfo.Version)).ToString(3)).nupkg -n &quot;/a /f .\CertificateInProjectFolder.pfx /p &quot;&quot;CERTIFICATE PASSWORD&quot;&quot; /fd sha256 /tr http://timestamp.digicert.com /td sha256&quot;" />
29+
</Target>
30+
~~~
31+
1932

2033

2134
## See Also
2235
* [Squirrel Command Line](squirrel-command-line.md) - command line options for `Squirrel --releasify`
36+
* [Visual Studio Build Packaging](visual-studio-packaging.md) - integrating Squirrel packaging into your build process
2337

2438

2539
---

0 commit comments

Comments
 (0)