Saturday, August 10, 2013

re-sign

I wanted to publish a WPF application such that the application files don't appear under the nested 'Application Files\AppName_Major_Minor_Build_Revision' folder but published flat alongside the xbap file. The Xbap file had references to the files in the nested folder and it carried a digital signature.
Luckily the application (appname.exe.deploy) file and its manifest had no reference to this nested folder.
Since the xbap file is an xml file, I opened it in notepad and removed the reference to the nested folder.
But this invalidates the digital signature. The digital signature comes with the signing tab of the project properties. The publish tab of the same project properties also mentions which files to include and sign. The certificate associated with the project ( this is included as .pfx file in references ) was used to sign and publish. So I used sn.exe to re-sign the file and update its digital signature. The sn.exe is a dot net tool available with the Microsoft SDK. Incidentally, if you wanted to re-sign the manifest, you could edit and re-sign it in Mage.exe or MageUI.exe which also comes with the SDK. 

No comments:

Post a Comment