How to publish templates and stencils?

Started by Thomas Winkel, December 11, 2016, 06:27:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thomas Winkel

Hi,

how can I do this without any external tool or installer?
I guess this is done in the registry?
Where can I find more information?
I would like to integrate this in my project (GUI for the user) because the simple way with file locations is broken since Visio 2013:
http://visguy.com/vgforum/index.php?topic=4783.0

Regards,
Thomas

Nikolay

#1
It depends on what you mean by "publish"...

You can pretty much do it the "simple way" by copying files to the proper locations.
It does not seem that it is "broken" in 2013, just the defaults were changed for metric/us stencils/templates.
It should be fine, just add _M and _U versions, and you should be all good. Also, you don't need to worry about that unless you have international customers.

If you want to publish to Office Store, Visio content support not quite there yet, as far as I know. But it's in progress.

If you want a MSI installer you could give a try to this site i've build awhile ago to demo the addin project template
Here is the discussion on this forum

If you want to deploy in company, you could give a try to the group policies, like these:
http://visguy.com/vgforum/index.php?topic=6053.0

If you refer to the "publishing" Visio (or "publishing tool") does to deploy it's own stencils - it's is not really setting a registry key, you'll have to dig a bit into what MSI component publishing is.
if you curious about the details on how Visio deploys it's own stencils then you can probably start over here: visio component publishing  It's still like that in Visio 2016, just the guids are different.

Thomas Winkel

Thanks for the detailed answer, Nikolay.

Basically I would like the same result that your Extended Visio Addin Project can do.
But without installer, MSI, etc.
I think about a settings menu where the user can specify a path for stencils and another path for templates.
If there is a sub-directory its name will appear as category in "More Shapes".
Stencils will be listed without .vss.
An update button will parse the folders and register all stencils / templates.
I don't like the _M / _U to appear in the more shapes menu because this looks cryptic and thus is poor usability.
This was possible in Visio up to 2010.
And I would like to provide our users a similar easy way for newer Visio versions.
So, it would not be a solution to publish our stencils, only for user stencils.

As you mention your Extended Visio Addin Project:
I will use it to transfer our VBA project to C#.
Many thanks for sharing, this is really helpful!!
I'm still in the experiment phase, but I already managed to:
* Catching ShapeSheet events / actions using RUNADDONWARGS
* Run Add-Ins methods from VBA

But I have three questions:
* Is it possible to modify code during a debug session as it is with VBA. All the restarts is really time-consuming... :-\
* I'd like to support Visio / Excel in any version from 2010 with one installer. In VBA this means late binding. Is there something to consider with your template?
* With the installer I deliver some Excel templates that can be filled with data. How can I identify the location where the user installed the addin?

Nikolay

Hi Thomas,

Quote from: Thomas Winkel on December 11, 2016, 10:16:21 PM
But I have three questions:

* Is it possible to modify code during a debug session as it is with VBA. All the restarts is really time-consuming... :-\

If you are talking about possibility to edit code in Visual Studio during debugging (?), the setting is called "Edit and Continue",
you can google the location of the checkbox, I believe it's under "Debug" tab.

Quote
* I'd like to support Visio / Excel in any version from 2010 with one installer. In VBA this means late binding. Is there something to consider with your template?

The template supports Visio 2007 SP3 - 2016 in one installer. Excel is not part of the picture; you need to take care about supporting different versions Excel yourself.
If we are talking about Visual Studio, this can be done by e.g. adding Excel reference and setting the checkbox "Embed Interop Types", and ensuring you don't require specific version.
This should be good enough for 2010 and above at least.

Alternatively, there is always late binding (check "dynamic" keyword).

Quote
* With the installer I deliver some Excel templates that can be filled with data. How can I identify the location where the user installed the addin?

That's not part of the template. So you are on your own here.
One way is to add setting in the registry (installation path) in the installer, and read it from the code.
Alternatively, you can get the application's folder, and use it as a base.

Thomas Winkel

Hi Nikolay,

thanks again for your prompt help.

* "Edit and Continue":
Ok, this is working now.
The only problem was, that the code must be in break mode (i.e. set a break point or press pause).
Otherwise there will be an error message that no code modification is allowed while running.
Very helpful, this makes really a difference!

* "Excel in any version from 2010":
Thanks, I'll check this.

* "application's folder":
Thanks for this link.
AppDomain.CurrentDomain.BaseDirectory makes what I want.


Browser ID: smf (is_webkit)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 243 (show)
Files included: 32 - 1216KB. (show)
Memory used: 1137KB.
Tokens: post-login.
Cache hits: 13: 0.00253s for 26,582 bytes (show)
Cache misses: 2: (show)
Queries used: 17.

[Show Queries]