Signing an Outlook plugin remotely

Add-in Express™ Support Service
That's what is more important than anything else

Signing an Outlook plugin remotely
 
Virteom Administrator


Guest


Hello,

We're currently trying to build and release an Outlook plugin remotely through Microsoft's TFS.

Building the installer locally works fine. It uses our *.sign file, and the installer will work. But when we build remotely, it's not signing during the build step. We've tried adding other steps to use signtool.exe to manually sign the adxloader.dll, adxloader64.dll, adxloader.dll.manifest, our plugin dll, and the installer msi file, but it fails when signing the manifest due to not being able to sign the format. We've tried only signing the other files (not the manifest) and it builds successfully, but it doesn't seem to be signing correctly as the plugin isn't activating.

Through everything that we've tried when building remotely, we've consistently gotten the same error in our adxloader.log: Hash verification failed.

We figure that this process shouldn't be as difficult as it has been for us, so we're wondering if there's some config that we're missing? Is there a way to make it use our *.sign file when building remotely?

Thanks
Posted 24 Aug, 2016 10:24:51 Top
Virteom Administrator


Guest


Follow up comment:

We have the adxloader.dll, adxloader64.dll, and adxloader.dll.manifest all in the Loader subdirectory of our plugin project, but have noticed that they are not being copied to the project's output directory when we build the project remotely.

Would this be connected to why signing the files isn't working during the remote build?
Posted 24 Aug, 2016 10:49:38 Top
Virteom Administrator


Guest


Escalating this topic
Posted 24 Aug, 2016 13:32:47 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello,

If you build your project remotely and the certificate is installed in the certificate store on your Windows then you need to install it in the certificate store on that machine.

Could you please provide more details about the environment? I don't understand how you build the project. If you have a screenshot(s) or video(s), you can send it to the support email address; find it address in {Add-in Express installation folder}\readme.txt


Andrei Smolin
Add-in Express Team Leader
Posted 25 Aug, 2016 04:02:18 Top
Virteom Administrator


Guest


Hi Andrei,

Thanks for your response.

We are using Microsoft's Visual Studio Team Services for our remote builds. Since this is a hosted environment, we can't change the server environment nor install the certificate onto the build server. Instead, we can only change our build steps and source code.

A possible option would be for us to download the certificate onto the server during the build, but then we aren't sure what to do once it is downloaded.

Thanks again
Posted 25 Aug, 2016 08:10:37 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Hello,

I create environment to reproduce this scenario. This may take a day or two. I'll let you know about my results.


Andrei Smolin
Add-in Express Team Leader
Posted 25 Aug, 2016 10:16:23 Top
Virteom Administrator


Guest


Thanks Andrei.

We recently got the hosted remote build working, although probably not using the best methods to do so.

Currently, our Visual Studio solution is set up so that the Outlook plugin is one project and the installer is another project. Since the adxloader dlls and manifest are in the plugin's project, we needed the plugin project to build, sign the files, and then build the installer so that the installer used the signed files. We were having an issue building the projects separately since they are in the same solution and couldn't sign the files between the project builds.

What we're currently doing to fix this is have a post-build event command for the Outlook plugin project to manually copy the adxloader dlls and manifest from the project's "Loader" directory to the project's output directory. Then we sign the manifest using adxpatch.exe. This seems to be currently working for us, but it would be nice if the copying and signing was more automated, similar to our local builds.

In hopes of a better solution, we look forward to your results after reproducing our remote hosted environment.
Thanks again for your help.
Posted 25 Aug, 2016 11:17:57 Top
Andrei Smolin


Add-in Express team


Posts: 18817
Joined: 2006-05-11
Thank you for letting me know.

Virteom Administrator writes:
Then we sign the manifest using adxpatch.exe.


Do you do this in the PostBuildEvent?


Andrei Smolin
Add-in Express Team Leader
Posted 26 Aug, 2016 10:01:13 Top
Virteom Administrator


Guest


Yeah, the commands are in the Outlook plugin's csproj file in the PostBuildEvent.
The commands we're running:

cd $(ProjectDir)Loader
copy * ..\$(OutDir)
cd ..\..\lib
adxpatch /Sign="$(ProjectDir)$(OutDir)adxloader.dll.manifest" /CertificateFile="$(ProjectDir){filename}.pfx" /CertificatePassword="{password}"
Posted 26 Aug, 2016 10:51:20 Top