ProGuide Digitally signed add ins and configurations

2233
8
03-15-2018 06:22 AM
TakahiroKAMIYA
Esri Contributor

When digitally signing with ArcGISSignAddIn.exe of Pro, Although you can sign it, if you install and run the add-in, it will not work properly.


The cause was that the file name was broken in the middle and broken when including the geodatabase in the add-in. Is there a workaround? I want to grant a digital signature without file loss, Is there a way to sign other than using ArcGISSignAddIn.exe?

0 Kudos
8 Replies
UmaHarano
Esri Regular Contributor

Hi Takahiro,

Can you please give me more information as to which file name was broken when you signed the add-in?

Thanks!

Uma

TakahiroKAMIYA
Esri Contributor

Hello Uma,

The file geodatabase included in template is broken.

I made it possible to download the file just in case.

http://firestorage.jp/download/a842e36aaa60b107b79576be0ee56d491d9323ef 

Regards,

Takahiro Kamiya.

0 Kudos
UmaHarano
Esri Regular Contributor

Hi Takahiro

I downloaded your content.  I see two folders, "Before" signing the add-in and "After" signing the add-in.  There is a "Template" folder with gdb files in the "Before" folder and this template folder is missing in the "After" folder.  These folders represent the "Install" folder in your esriAddinX compressed file, correct?

In my signed add-in I did the following to get this to work:

1.  In my .csproj file for the Add-in, I have added the following target:

<Target Name="AfterBuild" DependsOnTargets="PackageArcGISContents">
    <!--Replace the path in the sample command below to your pfx file on disk and use the password that has been assigned to the pfx file.
        Confirm that the path to ArcGIS Pro bin folder matches your installation location.-->
    <Exec Command="&quot;C:\Program Files\ArcGIS\Pro\bin\ArcGISSignAddIn.exe&quot; $(TargetDir)$(TargetName).esriAddInX /c:D:\my.pfx /p:xxxxx /s" />
    <Exec Command="&quot;C:\Program Files\ArcGIS\Pro\bin\RegisterAddin.exe&quot; $(TargetDir)$(TargetName).esriAddInX /s" />  
</Target>‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

2. In Solution explorer set the BuildAction of the gdb folder contents to "Content". It is important to do this for all the files within the .gdb folder. Set the "Copy to Output Directory" option to "Copy Always".  Here are a couple of screenshots of my solution explorer and properties.

Solution ExplorerGDB File properties

Now when I compile my add-in, it gets signed and the GDB folder is correctly copied into my esriAddinX file.

Thanks!

Uma

TakahiroKAMIYA
Esri Contributor

Hello Uma,

Thank you for the information.

The build action was not done.

In this case, can not gdb folder directly?

Also, if there is another executable file such as GDAL, is it OK with the build action setting?

Regards,

Takahiro Kamiya.

0 Kudos
UmaHarano
Esri Regular Contributor

Hi Takahiro,

In Visual Studio, I had to select all the files in the folder and then modify their Build Action.  I don't think you can do it at the file level - I haven't tried that.

Regarding your question about the GDAL resources -  if you need any files to be copied over to your output at build time, you have to set these properties. I think it should work for your GADL files also.

Thank you!

Uma

0 Kudos
TakahiroKAMIYA
Esri Contributor

Hello Uma, 

Thank you for the information.

I will try it from Visual Studio.

Regards,

Takahiro Kamiya.

0 Kudos
TakahiroKAMIYA
Esri Contributor

Hi Uma,

Is it OK to digitally sign using C:\Program Files\ArcGIS\Pro\bin\ArcGISSignAddIn.exe?

0 Kudos
UmaHarano
Esri Regular Contributor

Hi Takahiro

Yes, it is recommend to use C:\Program Files\ArcGIS\Pro\bin\ArcGISSignAddIn.exe to sign your add-in or configuration.

The step by step instructions in this page uses this exe:

https://github.com/Esri/arcgis-pro-sdk/wiki/ProGuide-Digitally-signed-add-ins-and-configurations#app... 

Thanks

Uma