Need help with Nikolays Extended Visio Addin Project

Started by Thomas Winkel, January 31, 2021, 08:49:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thomas Winkel

Hi,

I have a Visual Studio Solution with 3 projects: Visio VSTO Addin, Excel VSTO Addin, Solution files
Now I would like to build an installer in order to publish this solution.

I tried Nikolays Extended Visio Addin Project:
https://unmanagedvisio.com/tools/visual-studio-project-templates-to-create-visio-add-ins/
Very cool and simple, if you start a new project from scratch.
But I found two problems with the installer:
1. With "WixUI_Minimal", the Addin, template and stencils are not published to Visio.
2. The same problem with "WixUI_Advanced" and "Install just for you"
Are this bugs in the installer project?

Ok, then I tried to integrate that installer to my solution:
1. Add a fourth project: "Setup Project for WiX v3"
2. Copied "VisioWixExtension.dll" and "VisioWixExtension.xsd" to my setup project
3. Added references to my three projects, "VisioWixExtension.dll", "WixNetFxExtension" and "WixUIExtension"
4. Configured "Product.wxs" after Nikolays example.

First problem:
"The target "GetTargetPath" does not exist in the project."
Google says that could be a problem with multiple project setup.
No idea what to do, need to install files from all three projects.
Ok, I'll take care later and removed two project references and only reference to the Visio Addin Project.

Second problem:
Links to Visio files are not recognized. So I had to copy the files to my Installer project.

Next problem:
"Visio WiX Extension Internal Error. In case you see that please report the issue to support@unmanagedvisio.com."

Any idea how to proceed?

@Nikolay:
As I know that you are active in this forum, I don't contact you via support email.
Maybe this topic is also interesting for other people.

Best regards,
Thomas

Thomas Winkel

I made some more tests with the Extended Visio Addin Project.

Starting point:
* Deinstalled all generated setup projects
* Removed all Visio Addins
* Created two new Extended Visio Addin Projects:
    1. WixUI_Advanced
    2. WixUI_Minimal
* Both with option "Crate new (sample) template and stencil file"
* Did not touch the other options, did not modify the projects.
* Build (Addin)
* Build (Setup)
* Never started debugging, so no addin in debug folder will be registered

Results:
* Installed WixUI_Advanced only for me: Addin registered, Template and stencil file not
* Deinstalled
* Installed WixUI_Advanced for all Users: Addin registered, Template and stencil file registered -> Perfect
* Deinstalled
* Installed WixUI_Minimal: Nothing registered
* Deinstalled

After each deinstall I checked if the addin was unregistered in Visio: All ok

Software versions:
* Visio 2019 Professional 64bit
* Visual Studio Community 2019 Version 16.8.4
* WiX Toolset v3.11.2
* Windows 10 Pro Version 10.0.18363 Build 18363

Nikolay

Dear Thomas,

Sorry for not responding for a while, had some things to pay attention to last week.. :|

"WixUI_Minimal" does not support "per-user install", as of my understanding, only "WixUI_Advanced" does.
But it should register the stencils/templates anyway, if it does not that is a problem.

Would really appreciate if you could create an issue in issue tracker here (also you'll be able to track it):
https://github.com/nbelyh/VisioPanelAddinVSTO/issues

If you could share the add-in project with me to check (support@unmanagedvisio.com) then I'll be able to tell more / fix the issue.

I'll try to reproduce this weekend following the details you provided, thank you for detailed steps!

Thomas Winkel

Hello Nikolay,

don't worry, I have to thank for sharing your installer project!
I created an issue on Github. Meanwhile I also tested WixUI_InstallDir (see issue).

I'll share my project with you on Github.

Nikolay

Finally found some time to look at the issue. Seems like per-user stencil install is simply not working in Visio 2019 and later (at all)?
I man, maybe this functionality has been removed from Visio?

The per-user install problem with "Advanced" install is reproducible in Visio 2019 and later (in Plan 2 as well).
In Visio 2010 and 2007 the per-user installation works fine (with the same installer).
The per-user stencil registration is simply ignored by Visio 2019 (but if you start Visio 2010 on the same machine, you can see the stencil and template).

Was able to reproduce the issue with "Minimal" and "InstallDir" - it's trying to install per-user.
This one can be easily fixed by adding <Property Id="ALLUSERS" Value="1" />, fixed in the project now.

Thomas Winkel

Thanks for your time, Nikolay. Very appreciated!
Unfortunately, Visio seems to get a little worse with each new version, since 2010.
Per-user installation is interesting, because it does not require administrator rights.

In order to understand the basics of stencil / template publishing, I tried to reproduce your instructions here, but without success:
https://unmanagedvisio.com/creating-an-installer-for-visio-with-wix/
Also incrementing ConfigChangeID by hand did not work for me.

If I find the time, I'll try again to integrate your installer next weekend.

Nikolay

#6
Looks like per-user registration of stencils or templates is simply not working in Visio 2019 and above (i.e. not only with my this wix installator, but at all). Maybe I'm wrong but looks like this.
My thought was that maybe it was removed, as Microsoft themselves don't seem to install any templates or stencils per-user.
Not sure how to check it actually. If you have any example of stencils or templates installed per-user (i.e. actually installed and not copied to "my stencils") would appreciate it.

Per-machine installation should now be fine, with any UI type you select. The updated build of the extension available here (as pre-release):
https://github.com/nbelyh/VisioPanelAddinVSTO/releases

Thomas Winkel

Sorry, no example available.
In our company we share templates and stencils with SVN.
Before first use, a VBA script sets the path to their local checkout in: "File -> Options -> Advanced -> File locations"
Not professional, but works good for us. And all without admin rights.  :-X

Is there no contact to Visio developers in this forum?
It would be good to have an official statement, maybe even further instructions.

Do you have an idea how to deal with the other problems, I describe above?
Especially the Error message "Visio WiX Extension Internal Error..."

Thanks for updating the extension.
I will repeat the tests from above and give feedback.

Thomas Winkel

Update:

I tested the pre-release with all user interface options.
All working as desired, except for per-user installation.
Only the addin will be registered in per-user installation.

Another option for per-user installation would be to set the file location as discussed here:
http://visguy.com/vgforum/index.php?topic=4783.0

Thomas Winkel

I made a new attempt to integrate the installer to my solution.

Solution -> Add new project -> "Extended Visio c# Addin"
Build Setup project -> works  :)
Setup project -> removed reference to demo project coming with the "Extended Visio c# Addin" template
Setup project -> add project reference to my Visio Addin project.
Product.wxs -> replace "var.DemoProject" -> "var.MyProject"
Build Setup project -> Visio WiX Extension Internal Error.
Product.wxs -> removed: <visio:PublishAddin />
Build Setup project -> works, but Addin will not be registered

Then I added a new test Visio VSTO project to the solution (just as the not working one) and tried the setup with this one -> works

So, there must be something wrong with my original VSTO project, but no idea what.

I found out that some txt files are missing in "Setup\obj\Debug" when build crashes.
Build crashes on light.exe command.
But txt files are generated with candle.exe

No idea how to proceed.
Next step could be to replace the original project and transfer the old one step by step until build of setup fails.
But this will be very time-consuming and with uncertainly outgoing.

BR,
Thomas

Nikolay

#10
Maybe the name of the reference (or maybe you need to add the reference to the setup project to your VSTO project)?
I mean, the initial was deleted when you deleted the "demo" project. The setup project needs to have a reference to the VSTO project.



It's all just text files so you can try looking for "DemoReference" in the folder. I'll try to reproduce step-by-step, but it could be easier if you could share the link to the project.

Actually, I was planning to have another option that was asked several times already - have "Add Setup Project" ONLY, based on the current (VSTO) project.
Looks like this could be a simple solution for your case as well. I mean, a setup project auto-generated from existing VSTO project.

Thomas Winkel

I think the name is not the problem, because build works fine as soon as I remove the line "<visio:PublishAddin />" from Product.wxs.

Option to add setup project only to an existing solution is a good idea.

Would be nice if you could try to reproduce the issue with my solution.
I was not able to reproduce the issue with other projects.

My project is here:
https://github.com/ThomasWinkel/Geradeaus.Wit
You should already have access when you are logged in.

Nikolay

#12
The problem seems to be is you target you add-in x64 only. If you change that to standard "Any CPU", then it works.
Please check the message on GitHub, I've created PR to show. Not sure why setting X64 breaks it but will check.



https://github.com/ThomasWinkel/Geradeaus.Wit/pull/7/files

Thomas Winkel

That works! Very cool, thank you very much, Nikolay  :)

That issue took me so much time, and the solution is so easy...
I cannot remember that I ever changed the platform target.
As I would like to support any platform, "Any CPU" should be the correct setting for me.

Nikolay

#14
I've created a bug to figure out why X64 breaks it and fix in the future:
https://github.com/nbelyh/VisioPanelAddinVSTO/issues/13

Probably it can be because setup's platform is NOT x64, and it's trying to incorporate X64 add-in. But anyways even if makes sense the message should say something reasonable, and not "internal error" :D