1

I'm running Visual Studio 2017 Community on Windows 10, and have created a VSTO Excel extension. I have admin on the sandboxed windows 10 machine, but only user access on the Windows 7 box. The Windows 7 box runs .Net 4 and I cannot change that.

From the start of the project I have set the target to .Net Frameworks 4 Client and the Installer project Launch condition also set to Net 4 Client. The extension is for Office Excel 2010. It compiles and works in my Windows 10 box.

I also successfully ran it, when I manually installed the excel extension to a windows 7 box running .Net 4. ( i.e. directly copying the .dll files, vsto files, etc, and then using regedit to set up the addin reg settings.). It works flawlessy on the Win 7 box.

When I run the msi installer file, it installs fine on my win 10 box, and fails to install on Win 7 box (it reports a successful install but the install directory is empty, and I have to run the msi again to remove the "non-existant" installation) .

Setup.exe works on Win 10 box, but on the Windows 7 box insists on installing Net 4.6.1 and when I cannot (I'm not admin), the installation fails.

I then wrote another excel extension that did nothing but messagebox "Hello World" on excel startup. It showed exactly the same problem.

Why does setup insist on installing .Net 4.6.1 when I have set the target to Net 4 Client, the launch condition to the same and the extension works perfectly on Win 7 Net 4 when I manually install?

What am I missing?

Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

0

Solution by OP.

I've found the solution.

What I did (WRONG)

1:) Created working Excel extension for Excel 2010.

2:) Set target to .NET 4

3:) Tested extension and it worked:

**********THIS BIT IS WHERE I WENT WRONG*************

4:) Added new setup/install project to solution.

5:) Configged setup project to .net 4 , edited registry settings, add output files etc...

6:) Built and worked.

******************END OF WRONGNESS**********************************

What I SHOULD have done

1:) Created working Excel extension for Excel 2010.

2:) Set target to .NET 4

3:) Tested extension and it worked:


4:) Setup to Publish working extension to a local directory

5:) Change publish properties to remove prerequistes for .NET 4.6.1 etc


6:) Publish. Which automatically produces setup executable to run on .Net 4

7:) Don't bother adding setup project to solution.

Cœur
  • 37,241
  • 25
  • 195
  • 267