Which Visual Studio Version for Visio 2003/2007 Add-in?

Started by perry59, February 04, 2015, 08:19:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

perry59

#30
Quote from: Paul Herber on March 19, 2015, 11:43:54 PM
Do you mean the Visio Solution Publishing Tool?

Is that still used in VS 2013?
I know I can just right click on my solution and select publish and it creates the "one click" installation folder with the necessary files in it for an install.
does the manifest still need to be edited after the fact?
Perry
what, me worry?

Nikolay

#31
ClickOnce (right-click "publish") generates an installer which is not based on MSI, but "publishing stencils for Visio" (i.e. making them available in the Visio UI like the built-in stencil) basically requires MSI technology. Visio Solution Publishing tool from Visio SDK mentioned by Paul assumes that you have MSI. Aslo, about choosing the folder - with ClickOnce, you are limited to "user" installs (i.e. you can install only in pre-defined user folders, per-machine installs are not allowed). Which might be a good thing, since user does not need to be an admin to install the add-in. Also with ClickOnce, you basically can't customize the installer UI, allow user to choose target path or alike. Which may also be a good thing, since user does not need to think about that.

Basically, you have a few choices here to include stencils/templates:

- Don't add stencils/templates in Visio UI (do not publish), but just include in setup. You can achieve this with ClickOnce installer by simply including your stencils/templates in the project as "Content" (then they will be included in the package) - can set that in "Properties" of the files. So your solution will be able to access them, but they will not be published in Visio user interface.

- Do not use ClickOnce ("Publish") at all, but instead create a MSI installer for installing the add-in, and then add templates/stencils to that installer. Note that my VSTO project template now does not include MSI installer project for VSTO.

AFAIK these options were always there, that is nothing new in 2013...
I.e. the right-click "publish" (ClickOnce installer generation) function was always available with VSTO.

perry59

#32
Quote from: Nikolay on March 20, 2015, 09:04:26 AM

Basically, you have a few choices here to include stencils/templates:

- Don't add stencils/templates in Visio UI (do not publish), but just include in setup. You can achieve this with ClickOnce installer by simply including your stencils/templates in the project as "Content" (then they will be included in the package) - can set that in "Properties" of the files. So your solution will be able to access them, but they will not be published in Visio user interface.


OK, I'm a little confused by that. I included a stencil in my project. In its properties I marked it as content and checked to copy to output if newer. When I publish the solution it looks like the stencil is copied into the publish folder ( and appended with with ".deploy"). So far so good.
When I do an install on a test machine however this stencil is no where to be found!
It looks like publish can do nothing but install and register its code.
So if I want my stencils and templates to be installed on the users machine and show up in the visio UI like a built in object, I have to use an MSI, or WIX project?

By the way Nikolay, I recreated my test project and clicked to add the "panel". The document events then showed up and the disabled command was enabled/disabled when I opened/closed documents.
I am now busy moving my old VBA code into the project!
Thanks!
Perry
what, me worry?

Nikolay

#33
Quote from: perry59 on March 20, 2015, 08:03:00 PM
OK, I'm a little confused by that. I included a stencil in my project. In its properties I marked it as content and checked to copy to output if newer. When I publish the solution it looks like the stencil is copied into the publish folder ( and appended with with ".deploy"). So far so good.
When I do an install on a test machine however this stencil is no where to be found!
It looks like publish can do nothing but install and register its code.

Hm.
ClickOnce should copy all files marked for deployment ("Content") actually, BUT not necessarily to the folder where the dll is installed (AFAIR)
After install, on my computer for example the addin and files are placed in some place like:

C:\Users\Nikolay\AppData\Local\Apps\2.0\J91TK26X.7OZ\POD997OJ.ARA\visi...dll_9ab9f98c82295b4f_0001.0000_none_b98f7340e697455f

Try searching in C:\Users\<username>\AppData\Local\Apps\2.0\ folder (including hidden folders). The files should be there...

Check out also this post about finding the deployed files from within the addin:
https://robindotnet.wordpress.com/2010/07/11/how-do-i-programmatically-find-the-deployed-files-for-a-vsto-add-in/

Quote
So if I want my stencils and templates to be installed on the users machine and show up in the visio UI like a built in object, I have to use an MSI, or WIX project?

As far as I can tell, MSI is a must, WIX is optional. Note that there may be also other way around - you could also for example opt to just copy templates/stencils to "My Shapes" (should also show up in user files) on the first run of the addin.

Quote
By the way Nikolay, I recreated my test project and clicked to add the "panel". The document events then showed up and the disabled command was enabled/disabled when I opened/closed documents.

Thanks!
That basically means that there is a small bug to be fixed in the setup project - when one sets ONLY that "Visio 2007" checkbox, then "enabled/disabled" of the second button gets broken (since update is never called) :)

perry59

#34
Quote from: Nikolay on March 20, 2015, 10:08:31 PM
Try searching in C:\Users\<username>\AppData\Local\Apps\2.0\ folder (including hidden folders). The files should be there...

Yep, the template was there!
Of course, visio never saw it so there is not much point in including it in the VS project.
I see you have a WIX setup on your web page, this looks like it will do just what I want, true? and no MSI?
Although I do love the "auto update" feature of publish, if I didn't have stencils and templates as part of the solution, publish would be perfect.
thanks!
what, me worry?

Nikolay

#35
There is currently no WIX/MSI setup for a VSTO project (M$ does not provide that as "ClickOnce" is the assumed VSTO deployment, which kind of sucks in case of Visio template/stencil installs)

Check out this topic:
http://visguy.com/vgforum/index.php?topic=6368.msg26283#msg26283

There is a link on how to get things working for VSTO (unfortunatelly, needs some xml digging for now),
check out the link to the Chris Hopkins blog in the topic above.

I.e. in principle it can be done "all in one project", it just has not been done for VSTO..

perry59

#36
Thanks again Nikolay ;D

So the WIX project on your website is not designed to do this? That's a bummer :'(
what, me worry?

Nikolay

#37
You can add VSTO addin to this wix setup with template/stencils, it's just not "out of the box", you'll need to add what is written in this blog article:
http://blogs.msdn.com/b/chhopkin/archive/2013/07/08/wix-for-visio-add-ons-and-content-deployment.aspx

perry59

what, me worry?