Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building in Windows 7 - CA Certificate Installation Issue #168

Closed
smozgur opened this issue Jun 25, 2019 · 9 comments
Closed

Building in Windows 7 - CA Certificate Installation Issue #168

smozgur opened this issue Jun 25, 2019 · 9 comments

Comments

@smozgur
Copy link

smozgur commented Jun 25, 2019

Building works without problems in Windows 10, however there is a certificate installation issue in Windows 7 Home Premium.

"The term Import-Certificate is not recognized as the name of a cmdlet..."
image

I do understand Import-Certificate is not a Windows 7 powershell cmdlet.

I tried to install the generated CA certificate manually, however build script still regenerates it and tries to install with powershell, and cannot pass that step that avoids testing Excel Custom Functions in Windows 7.

image

I disabled certificate installation in node_modules\office-addin-dev-certs\lib\install.js, and yes it skipped the installation, but add-in loading failed, likely due to missing certification.

Can't we use Windows 7 for testing Excel Custom Functions with Node.js (other than Trusted Add-in Catalog), or is there a workaround that I am probably missing?

@asachin96
Copy link

Hi,

Can you please let me know what is your PowerShell version. You can use the following command
$PSVersionTable.PSVersion.Major

@smozgur
Copy link
Author

smozgur commented Jun 25, 2019

@asachin96, thanks for your reply.

Windows 7 - PS version is 2.
If we somehow update PS to 4, then cmdlet will be also available?

@asachin96
Copy link

Import-Certificate is available from PowerShell 3. Yes, upgrading PowerShell should solve this issue.
Here's a doc to upgrade PS https://docs.microsoft.com/en-us/powershell/scripting/install/installing-windows-powershell?view=powershell-6.
Let me know how it goes. I'm going to add PowerShell version 3 requirement to certificate package.

@smozgur
Copy link
Author

smozgur commented Jun 25, 2019

I actually didn't try to upgrade when I saw this earlier, and it made sense:
https://superuser.com/questions/1353868/powershell-is-missing-import-certificate

But I will try now. I'll let you know. Thank you.

@smozgur
Copy link
Author

smozgur commented Jun 25, 2019

I tried version 3, then 4. No luck.
Used Get-Module -ListAvailable .... to list available modules. There is no PKI with Import-Certificate in Windows 7 which actually shows up in Windows 10.

"Module tied to the OS version instead WMF" in the link above makes more sense now.

@asachin96
Copy link

I see. I'll check and get back to you.

@smozgur
Copy link
Author

smozgur commented Jun 26, 2019

Ok, I have solved this by installing the CA certificate (%userprofile%/.office-addin-dev-certs/ca.crt) into the Trusted Root Certificate Authorities store.
It didn't work initially as I said in my initial question above, because I let it to install the certificate into the default cert store. I searched for the cert and it was not located in this store, so I installed it again by specifying the cert store.

I don't think PowerShell will help for Windows 7, unless the install.js script is perhaps updated to use certutil in Windows 7. Not sure, but I wanted to send this workaround for users trying to use Excel Custom Functions in Windows 7.

@akrantz
Copy link
Contributor

akrantz commented Jun 27, 2019

I'm glad you were able to manually install the CA certificate.

@asachin96 is looking into a way to use an alternate Powershell script on Windows 7 to that it will work in the future.

@akrantz
Copy link
Contributor

akrantz commented Jun 27, 2019

This issue will be tracked here: OfficeDev/Office-Addin-Scripts#151

@akrantz akrantz closed this as completed Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants