I'm trying to build and sign an add-in on a build server, which means everything has to run without a GUI. Unfortunately, I can't seem to get the ESRISignAddIn.exe tool to run without popping up a window. Even when I use the /r, /c, and /p options and the signing is successful, it still feels the need to pop up a message box to let me know everything is okay, which then causes it to throw an InvalidOperationException. (The message is "Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.")
Is there a workaround for this? Perhaps an undocumented argument? Some fancy Windows trick to beat this dialog into submission?
Solved! Go to Solution.
It seems I answered my own question! Using the top secret argument "/s" makes it do what I want. If only that had been included in the /? output... *sigh*
It seems I answered my own question! Using the top secret argument "/s" makes it do what I want. If only that had been included in the /? output... *sigh*
I'm hoping that someone is still watching this thread... Mark Rubelmann was there any trick to getting the silent flag to work on your build machine? I'm finding if I call ESRISignAddIn in a command prompt with /s (IE... ESRISignAddIn <ADDIN_PATH> /s /c:<CERT> /p:<PASS>) no UI is shown. However when the exact same command is given on our jenkins build server, I'm still getting the InvalidOperationException.
Deidre,
I don't recall there being any special tricks other than /s, but here are a few things that I might be doing differently than you:
If it's helpful, here's the batch file that I use:
@echo off REM Print some help if the user is clueless. if "%~1"=="" ( echo Usage: esriSignAddIn.bat ^<input.esriaddin^> ^<output.esriaddin^> [password] [certificate] goto :eof ) REM Prompt for password cls echo Signing %1 echo. if "%~3"=="" ( set /p password="Password: " ) else ( set password=%3 ) REM Clear the displayed password cls echo Signing %1 echo. echo Password: echo. REM Set up the certificate path set thisDirectory=%~dp0% if "%~4"=="" ( set certificatePath=%thisDirectory%certificate.pfx ) else ( set certificatePath=%4 ) REM Sign the binary set ESRISignAddInExe=%thisDirectory%ESRISignAddIn.exe %ESRISignAddInExe% %1 /r:%2 /c:"%certificatePath%" /p:%password% /s
Good luck! Let me know if you get it working!
It turns out the trick was the batch script... for whatever reason calling it directly was ignoring the /s flag.
Thanks for the help!
Awesome, I'm glad it worked for you!