Found this method from another post, not sure if it is a best practice but
works well for us.

In the *.wixproj file add the following just before the closing </Project>
tag:

For signing an MSI:

  <PropertyGroup>
    <PostBuildEvent>"C:\Program Files (x86)\Windows
Kits\8.0\bin\x86\signtool.exe"  sign  /f "$(ProjectDir)yourFile.pfx" /p
yourPrivateKey /d "Your Product Name" /tr
http://timestamp.comodoca.com/rfc3161 /v
"YourSetupFile.msi"</PostBuildEvent>
  </PropertyGroup>

For signing a EXE (bootstrapper)

  <Target Name="UsesSignTool">
    <PropertyGroup>
      <SignToolPath>C:\Program Files (x86)\Windows
Kits\8.0\bin\x86\signtool.exe</SignToolPath>
    </PropertyGroup>
  </Target>
  <Target Name="SignCabs" DependsOnTargets="UsesSignTool">
    <Exec Command="&quot;$(SignToolPath)&quot; sign /f
&quot;$(ProjectDir)yourFile.pfx&quot; /p yourPrivateKey  /d &quot;Your
Product Name&quot; /tr http://timestamp.comodoca.com/rfc3161 /v
&quot;%(SignCabs.FullPath)&quot;" />
  </Target>
  <Target Name="SignMsi">
    <Exec Command="&quot;$(SignToolPath)&quot; sign /f
&quot;$(ProjectDir)yourFile.pfx&quot; /p yourPrivateKey  /d &quot;Your
Product Name&quot; /tr http://timestamp.comodoca.com/rfc3161 /v
&quot;%(SignMsi.FullPath)&quot;" />
  </Target>
  <Target Name="SignBundleEngine" DependsOnTargets="UsesSignTool">
    <Exec Command="&quot;$(SignToolPath)&quot; sign /f
&quot;$(ProjectDir)yourFile.pfx&quot; /p yourPrivateKey  /d &quot;Your
Product Name&quot; /tr http://timestamp.comodoca.com/rfc3161 /v &quot;@
(SignBundleEngine)&quot;" />
  </Target>
  <Target Name="SignBundle" DependsOnTargets="UsesSignTool">
    <Exec Command="&quot;$(SignToolPath)&quot; sign /f
&quot;$(ProjectDir)yourFile.pfx&quot; /p yourPrivateKey  /d &quot;Your
Product Name&quot; /tr http://timestamp.comodoca.com/rfc3161 /v
&quot;@(SignBundle)&quot;"
/>
  </Target>


be sure to rename all the 'your' items.


Brian

If you can't explain it simply, you don't understand it well enough.  -
Albert Einstein


On Fri, Jun 27, 2014 at 6:16 AM, Sam Boman <s...@samb.se> wrote:

> Hello,
>
> I'm looking for some best practices to sign our application with a .pfx
> certificate.
>
> This is what I have:
> * DLL's made by us
> * DLL's signed by others
> * DLL's made by others but not signed
> * EXE's made by us
> Those are packed into a MSI (Msi.wixproj) (<Media> have one .CAB-file
> defined as Embedded), this MSI are included in a Bundle
> (Msi.Bootstrapper.wixproj) to fix .NET installation.
>
> The original Bundle output file have the name:
> app-1.6.5290.20471.exe
>
> I did rename the file to app.exe.
> I did try to use signtool to sign the Bundle output .exe-file. I got the
> signing working. But the installation fails after a prompt to pick a file
> with the following log-message:
>
> [0B28:0B78][]i000: Caching bundle from:
> 'C:\Users\User\AppData\Local\Temp\{uuid}\.be\app-1.6.5290.20471.exe' to:
> 'C:\ProgramData\Package Cache\{uuid}\app-1.6.5290.20471.exe'
> [0B28:0B78][]i320: Registering bundle dependency provider: {uuid}, version:
> 1.6.0.0
> [07D0:0C50][]w341: Prompt for source of container: WixAttachedContainer,
> path: C:\Users\User\Desktop\app-1.6.5290.20471.exe
> [07D0:0C50][]e054: Failed to resolve source for file:
> C:\Users\User\Desktop\app-1.6.5290.20471.exe, error: 0x80070642.
> [07D0:0C50][]e000: Error 0x80070642: Failed while prompting for source
> (original path 'C:\Users\User\Desktop\app-1.6.5290.20471.exe').
> [07D0:0C50][]e311: Failed to acquire container: WixAttachedContainer to
> working path: C:\Users\User\AppData\Local\Temp\{uuid}\uuid, error:
> 0x80070642.
> [07D0:0188][]e000: Error 0x80070642: Failed while caching, aborting
> execution.
>
> Seems like it is looking for the original filename?
> Please advice me how to do this properly (signing exe's dll's msi?)
>
> Regards,
> Sam
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> WiX-users mailing list
> WiX-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wix-users
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to