我正在尝试使用clickonce安装程序部署Outlook加载项.我有一个几乎可以工作的批处理文件,但是,当我尝试在Windows XP上安装时,我收到错误"xml signature无效".众所周知,XP以SHA256证书为例失败.众所周知,Visual Studio 2013的Update 3修复了使用Visual Studio界面发布时的问题.我想知道如何在命令行上使用signtool或mage完成相同的修复.这是我当前的批处理文件,适用于除Windows XP之外的所有内容:
:: Build and publish
msbuild /target:clean,publish /property:MapFileExtensions=false /property:Configuration="Release" /property:ApplicationVersion="1.0.0.0" /property:InstallUrl="https://example.com" /property:UpdateEnabled="true" /property:UpdateMode="Foreground" /property:UpdateInterval="0" /property:UpdateIntervalUnits="days" /property:PublisherName="Example" /property:ProductName="Example Outlook Add-In" /property:FriendlyName="Example Outlook Add-In" /property:LoadBehavior="3" /property:BootstrapperEnabled="true" /property:IsWebBootstrapper="true"
:: Sign the exe
signtool sign /fd SHA1 /f "certificate.pfx" "publish\setup.exe"
:: Sign the application manifest
mage -sign "publish\Application Files\Example_1_0_0_0\Example.dll.manifest" -CertFile "certificate.pfx"
mage -update "publish\Application Files\Example_1_0_0_0\Example.dll.manifest" -CertFile "certificate.pfx" -algorithm sha1RSA
:: Sign the deployment manifests (there are 2 locations)
mage -update "publish\Application Files\Example_1_0_0_0\Example.vsto" -appmanifest "publish\Application Files\Example_1_0_0_0\Example.dll.manifest" …Run Code Online (Sandbox Code Playgroud)