Ok, for the record and for anyone else who might search for this in the
archives, here's how I wired this into wix.targets. Note that you could also
just put this directly in your project file, with the SignInstaller target
renamed to AfterBuild. With the below changes you add these two properties to
your .wixproj file to turn on signing of the output file:
<SignInstaller>true</SignInstaller>
<ManifestKeyFile>mytestcert.pfx</ManifestKeyFile>
Here are the two targets I added to do the grunt work:
<Target
Name="ResolveKeySource" Condition="'$(SignInstaller)' == 'true'">
<ResolveKeySource CertificateFile="$(ManifestKeyFile)" >
<Output TaskParameter="ResolvedThumbprint"
PropertyName="_DeploymentResolvedManifestCertificateThumbprint"/>
</ResolveKeySource>
</Target>
<!-- Actually signs the installer -->
<Target
Name="SignInstaller" Condition="'$(SignInstaller)' == 'true'"
DependsOnTargets="ResolveKeySource">
<Exec Command='signtool.exe sign /sha1
$(_DeploymentResolvedManifestCertificateThumbprint) "$(TargetPath)"' />
</Target>
And here's how I wired it into the build process:
<PropertyGroup>
<CoreBuildDependsOn>
BuildOnlySettings;
PrepareForBuild;
PreBuildEvent;
ResolveReferences;
AddCompilerDefineConstants;
CompileAndLink;
GetTargetPath;
SignInstaller;
IncrementalClean;
PostBuildEvent
</CoreBuildDependsOn>
</PropertyGroup>
Hopefully someone finds this useful.
Neil
From: Neil Enns
Sent: May-07-08 3:06 PM
To: 'John Vottero'; Rob Mensching; [email protected]
Subject: RE: [WiX-users] Signing built MSIs?
SignFile can only sign exes, unfortunately (unless this changed in MSBuild 3.5).
I'm not asking for wix to add a new option, I'm asking for the wix build
process to add support for signing to the wix.targets file. In my .wixproj file
I want to be able to add a property called <CertificateFile> or something like
that, and have that trigger signing of the resulting MSI at the end of the
build process.
Neil
From: John Vottero [mailto:[EMAIL PROTECTED]
Sent: May-07-08 3:02 PM
To: Rob Mensching; Neil Enns; [email protected]
Subject: RE: [WiX-users] Signing built MSIs?
MSBuild does come with a signing task, it's the SignFile task.
You can sign your msi files with signtool.exe, MSBuild <SignFile> or
PowerShell's Set-AuthenticodeSignature. I don't know why WiX should add
another option.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rob Mensching
Sent: Wednesday, May 07, 2008 5:33 PM
To: Neil Enns; [email protected]
Subject: Re: [WiX-users] Signing built MSIs?
Write a task that signs files? <smile/>
Seriously, some people have suggested that WiX should sign files. I'm a little
skeptical because it doesn't seem like something the compiler/linker should be
doing. Others have noted that signing is done by csc.exe to create strong
named assemblies. I've argued that is a little different because the
signatures are for different reasons... but it isn't a good argument. <grin/>
So, we've waffled on this a little bit. One thing I *do not* think WiX should
be doing is signing all the installed files. That should be handled before you
get to the binding process.
However, I'm open to discussion...
PS: Why doesn't MSBuild come with a signing task? <shrug/> I want C++ tasks
first in any case.
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Neil Enns
Sent: Wednesday, May 07, 2008 13:36
To: [email protected]
Subject: [WiX-users] Signing built MSIs?
Does WiX 3.0 currently have any support for signing the generated MSI at the
end of the build process? I took a quick peek at the wix.targets file and
didn't see anything obvious. Is there a recommended way of doing this?
Thanks,
Neil
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users