install.ps1 is not digitally signed

328 views
Skip to first unread message

Kirk Woodhouse

unread,
Sep 22, 2016, 8:12:54 AM9/22/16
to Excel-DNA
Getting the following error: ExcelDna.Integration.0.33.9\tools\install.ps1 is not digitally signed when running Nuget to install.  VS2015, WIN 10

Kirk

Govert van Drimmelen

unread,
Sep 22, 2016, 8:24:11 AM9/22/16
to Excel-DNA
Hi Kirk,

I've not had this reported before, but I guess it has to do with your Powershell execution policy, or some other locked-down settings on your computer.

You might want to try one of these:

* In the NuGet Package Manager Console in Visual Studio, enter the command:

        Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

  and then try to install the ExcelDna.AddIn package again.

* Run Visual Studio "As Administrator"

* If you have the .NET Reflector add-in installed in Visual Studio, disable it and try again


Let us know what you find....

-Govert

Kirk Woodhouse

unread,
Sep 22, 2016, 9:13:31 AM9/22/16
to Excel-DNA
Evening Govert,
  1. PS policy was my guess given the error message.
  2. I had tried setting Execution-Policy to RemoteSigned on the machine level. No success.  I am guessing that PS knows that the script came from the Internet.  
  3. I run VS as admin.
  4. I don't run Reflector
Testing based upon your input:
  • Ran Nuget console to set Execution-Policy as you recommended.  That worked for both an install and uninstall from the same VS2015 session.  Ran the uninstall from the Nuget dialog (window) as opposed to the console just to check.
  • Restarted VS2015 usin the "Restart" command and tried an uninstall from the Nuget Dialog.  It worked. Although, it left a file named "_UNINSTALLED_Spike-AddIn.dna" that I don't recall from past uninstalls.  The contents of which are:
<DnaLibrary Name="Spike Add-In" RuntimeVersion="v4.0">
  <ExternalLibrary Path="Spike.dll" LoadFromBytes="true" Pack="true" />
  
  <!-- 
       The RuntimeVersion attribute above allows two settings:
       * RuntimeVersion="v2.0" - for .NET 2.0, 3.0 and 3.5
       * RuntimeVersion="v4.0" - for .NET 4 and 4.5
 
       Additional referenced assemblies can be specified by adding 'Reference' tags. 
       These libraries will not be examined and registered with Excel as add-in libraries, 
       but will be packed into the -packed.xll file and loaded at runtime as needed.
       For example:
       
       <Reference Path="Another.Library.dll" Pack="true" />
  
       Excel-DNA also allows the xml for ribbon UI extensions to be specified in the .dna file.
       See the main Excel-DNA site at http://excel-dna.net for downloads of the full distribution.
  -->
 
</DnaLibrary>
  • Tried another install after noting the file artifact.  It worked and the file name changed appropriately.
  • Finally, I closed VS2015 completely and then tried an uninstall.  It failed as expected given the ExecutionPolicy was -Scope Process. Obviously, VS2015 Restart command is restarting using the same process. 
Any further thoughts, other than lowering the machines Execution-Policy, as remembering to set the Execution-Policy is a bit of pain.  The error will be obvious, but then remembering/finding the right PS command line . . . <sigh>

Appreciate the fast response.

Kirk

Govert van Drimmelen

unread,
Sep 22, 2016, 9:37:28 AM9/22/16
to Excel-DNA
Hi Kirk,

I found this issue that might indicate it is a VS bug that has been fixed: https://connect.microsoft.com/VisualStudio/feedbackdetail/view/1572078
There are also various links to relevant StackOverflow posts etc. from there.

-----------

The _UNINSTALLED_... file is a copy of the .dna file that the uninstall leaves there. It's a file you are likely to edit for your add-in, and I don't want it to be deleted and the changes lost if you uninstall & reinstall the package.
When installing again, the install.ps1 will look for that file, and use it instead of the package template as your .dna file.
So all of that is normal and expected. 

This PowerShell script only runs during NuGet package install, so shouldn't impact on your development or running of the add-in otherwise.

---------


You can check what the execution policy when you start a fresh Visual Studio by calling "Get-ExecutionPolicy -List" in the package manager console.
On my machine it shows:
PM> Get-ExecutionPolicy -List

        Scope ExecutionPolicy
        ----- ---------------
MachinePolicy       Undefined
   UserPolicy       Undefined
      Process    RemoteSigned
  CurrentUser       Undefined
 LocalMachine       Undefined

I guess there is some global PowerShell setting that relates to this, and is different on your machine.
We're getting far beyond my limited PowerShell knowledge though...

At least the next person running into the problem (or me at some future date) will find this discussion on Google.
Please post back if you find out anything more.

Regards,
Govert
Reply all
Reply to author
Forward
0 new messages