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

Differentiate between Microsoft Office 2016 and 2019 with VSTO #7

Open
7coil opened this issue Oct 13, 2019 · 9 comments
Open

Differentiate between Microsoft Office 2016 and 2019 with VSTO #7

7coil opened this issue Oct 13, 2019 · 9 comments
Labels
enhancement New feature or request

Comments

@7coil
Copy link
Owner

7coil commented Oct 13, 2019

Microsoft in their infinite wisdom decided to make the Office version of 2019 "16.0" - The exact same as 2016.

The function getVersion() at /Shared/Shared.cs needs to return the string "2013", "2016" or "2019", depending on what version of Microsoft Office they are using.

(bonus points for detecting Office 365)

@7coil 7coil added the Hacktoberfest Who doesn't love happy hacking time? label Oct 13, 2019
@7coil 7coil changed the title Differentiate between Microsoft Office 2016 and 2019 Differentiate between Microsoft Office 2016 and 2019 with VSTO Oct 13, 2019
@DannyAllegrezza
Copy link

Hey @7coil,

I'm trying to work on this issue for #hacktoberfest, however, I can't seem to get the project building.

To reproduce:

  1. Clone the repo
  2. Open in VS2019
  3. Attempt to build project
  • I've attempted to disable the ClickOnce signing but this doesn't work. Is there a temp certificate that needs to be included?

image

@7coil
Copy link
Owner Author

7coil commented Oct 27, 2019

Yeah, try a temporary certificate

@RedTahr
Copy link

RedTahr commented Oct 27, 2019

@DannyAllegrezza good luck, i had a go with this the other day, I'm interested to see how/if you solve it.
I've posted a question to one of the microsoft forums, MSDN docs indicate that a few of the versions will report the same version numbers, and I hadn't found a nice way to reliably differentiate the app versions via alternate means, so admitted defeat for the time being.

@DannyAllegrezza
Copy link

Yeah, try a temporary certificate

Can you provide some reference on how to generate one/getting project compiling? I'm glad to open a PR to update the docs but as of right now I don't know how to get it building.

@DannyAllegrezza
Copy link

Nevermind, I figured it out. Was right in front of me earlier but had never run into this problem. You may want to consider removing the .pfx files from the repository, or actually adding them to the project.

@7coil
Copy link
Owner Author

7coil commented Oct 27, 2019

Sorry, I don't usually work with C# projects, so I haven't really made it easy to work with properly
Thanks

@Justin-Lloyd
Copy link

I couldn't see an obvious way to do this. However, Microsoft have a rather complex vbs script available which purports to reliably differentiate between office products, might be worth a look:
https://gallery.technet.microsoft.com/office/68b80aba-130d-4ad4-aa45-832b1ee49602

@7coil 7coil added enhancement New feature or request and removed Hacktoberfest Who doesn't love happy hacking time? labels Mar 5, 2020
@7coil
Copy link
Owner Author

7coil commented Jun 6, 2022

I've been poking around in the registry and found something that might help...

[HKEY_USERS\S-1-5-21-369044061-3658407648-47840922-1001\Software\Microsoft\Office\16.0\Common\Licensing\BootTimeSkuOverride]
"{C4ACE6DB-AA99-401F-8BE6-8784BD09F003}"="{149DBCE7-A48E-44DB-8364-A53386CD4580}"
"{3CFF5AB2-9B16-4A31-BC3F-FAD761D92780}"="{149DBCE7-A48E-44DB-8364-A53386CD4580}"
"{7C6D92EF-7B45-46E5-8670-819663220E4E}"="{149DBCE7-A48E-44DB-8364-A53386CD4580}"
"{7ECBF2AA-14AA-4F89-B9A5-C064274CFA83}"="{149DBCE7-A48E-44DB-8364-A53386CD4580}"
"{DC5CCACD-A7AC-4FD3-9F70-9454B5DE5161}"="{149DBCE7-A48E-44DB-8364-A53386CD4580}"
"{E0A76492-0FD5-4EC2-8570-AE1BAA61DC88}"="{149DBCE7-A48E-44DB-8364-A53386CD4580}"

It seems like the product SKU of office is being overwritten with another SKU, that being 149DBCE7-A48E-44DB-8364-A53386CD4580

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Microsoft\Office\16.0\Registration\{149DBCE7-A48E-44DB-8364-A53386CD4580}]
"ProductName"="Microsoft 365 Apps for enterprise"
"ProductNameBrand"="Microsoft 365 Apps for enterprise"
"SuiteName"="Part of Microsoft 365 Apps for enterprise"

The name is just there to be used by DiscordForOffice yum yum

@7coil
Copy link
Owner Author

7coil commented Jun 6, 2022

image

Looks like it's (kinda) working, but I don't have standalone versions of 2016 and 2019 to help try this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants