Welcome to The Mindjet Labs Sign in | Join | Help
MindManager SP2 PIA and Windows Vista... Part 2

MindManager SP2 was launched few days back. We are in process of releasing a new PIA for SP2(6.2.399).

While working on the issue where the current PIA installer and redistributable sometimes errors out on Vista: I have found that it is not the PIA that was creating the trouble on Vista, the problem is that we used .MSI file to install it.

Now the resolution to the problem: When you create your addins you would need to package the Setup.exe as well, and the installation needs to be started with this Setup.exe(specially on Vista). This is because this Setup.exe verifies its internal resources required for the installation.

How and where to get the Setup.exe: When you build your project's installer using Visual Studio it creates this file Setup.exe apart from the .msi file.

Summary: To summarize I would say that the current PIA is good for Vista provided your addins are installed using the bootstrapper Setup.exe. We are in process of releasing a new PIA installer, for SP2, that is now going to be an .EXE file instead of an .MSI file. (This exe file would internally call the Setup.exe file which in turn (internally) would invoke the msi file)

Please let me know if you have any Questions.

MindManager PIA on Windows Vista

Microsoft Windows Vista is going to be launched soon and so will be a new MindManager Primary Interop Assembly that will be compatible for Vista (besides the existing windows OS).

In case you are not aware: the existing PIA and redistributable installations will not work correctly on Windows Vista if User Access control is enabled. This is the enhanced security feature of Windows Vista.

We are currently working on creating a new PIA compatible with .net framework 1.1 to Vista’s 3.0 (WinFX).  We are going to update all Mindjet Labs addins to use this new PIA, to make them compatible with any version of .net framework (1.1 to 3.0).

 

Partners will be informed in advance for these changes for Vista.

So keep tuned in for more.

More about MindManager PIA (Primary Interop Assembly) Add-ins and .Net Framework 2.0 & Visual Studio 2005

MYTH

MindManager Primary Interop Assembly (PIA) is not compatible with .Net Framework 2.0 and Visual Studio 2005

OR

MindManager Add-ins built using MindManager Primary Interop Assembly (PIA) with .Net Framework 2.0 does not work.

SYMPTOMS

MindManager Add-in developed using MindManager PIA on Visual Studio 2005 fails to load or does not installs on user’s machine.

REASON

The user’s machine may not have extensibility.dll in the GAC (Global assembly cache) or in the Add-in’s Application folder.

MORE INFORMATION

When an add-in is built using MS Visual Studio 2005, VS does not automatically add the dependency for Extensibility.dll. Since this extensibility.dll is available on the developers machine the addin works fine but once this addin is installed on a user’s machine it fails to load. This can happen if the users have the most current Windows update or .Net framework 2.0.

RESOLUTION

You can get more information from http://support.microsoft.com/default.aspx?scid=kb;en-us;908002.   You will have to rebuild your MindManager add-in after installing this patch.

OR

Add the Extensibility.dll in the Add-ins application folder using your Add-in’s setup project.

On a Separate note:

I want to point out that all the add-ins that we develop in Mindjet Labs and all the existing labs add-ins ARE  comaptible with .Net framework 2.0 and have been tested on .Net Framework 2.0. Also any add-in that was built with previous version of MindManager PIA is compatible with the latest addins and does not needs to be rebuilt with any any newer future versions of MindManager PIA.

Need more information or have question(s), email us at labs@mindjet.com  

Building Upgrade-Safe Add-ins for MindManager

In this article I have tried to answer the need for PIA, the problem it causes, how to create addins in MindManager referencing PIA and how to update the addins to use PIA.

You can download Mindjet signed MindManager PIA from http://www.mindjet.com/us/devzone/6/PIA

What is PIA and why do we need PIA (Primary Interop Assembly)
MSDN has explained it on http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/whypriinterop.asp

How all this works, currently, and what is the problem?

How the COM and .NET communicates:
.NET CLR creates something called as Runtime callable wrapper (RCW) and this is what is used by .NET code to communicate with COM server, its primary function is to marshal calls between a .NET client and a COM object. In our case .net client is our Addin and COM object is MindManager.

In current scenario:
When you create an addin using Visual Studio and add a reference to MindManager Type Library, VS creates an Interop assembly (IA) (if PIA is not registered). So let us say that you created an addin with an older version of MindManager and then you installed a newer version of MindManager and built another addin. At this time there are two different versions of IA that each of these addins use when they load in MindManager. Now when you start MindManager it loads an addin and tries to load another one, since both the addins were NOT built using PIA they load their respective IA’s from their application folder.

Now the problem:
Here is what we need to know, when the first addin loads it creates a RCW (let us name it RCW1) for itself and when the second addin loads (and since this also does not uses a PIA) it creates another RCW (alias RCW2) for itself. So we get two RCWs whereas, at any time, there should NOT be more than one RCW for one application. The reason why we need only one RCW is: once you modify a COM object in first RCW the updated metadata would not be visible to second RCW.
For e.g. you modify the applications (MindManager’s) commands object collection in first addin (or using the RCW1) and then in your second addin you loop over the commands collection at this time the RCW will know that there is something changed in the commands object but what has changed it (RCW2) wont not know because the metadata for the modified object is not visible to RCW2 at this time, therefore CLR throws an invalid cast exception (“Specified cast is not valid”) or “Query Interface for .. failed

How to build new addins?
We need to make sure that we have only one RCW at any given time for all the addins that we load. To achieve this you need to make sure that you have only Mindjet signed (strong named) MindManager Interop (Mindjet.MindManager.Interop.dll) in the GAC (global assembly cache) and is registered.
It is strongly recommended that you use
Mindjet MindManager PIA redistributable merge module with all your addins so as to make sure that the Interop is available in the GAC and if a newer version is required the installer for your addin automatically installs it.
Once you have the required files in the GAC and registered, you do not need to do anything different from what you have been doing. Open VS and create an addin and add a reference to MindManager type library at this time VS silently use the registered PIA instead of re-importing the type library.

To create an addin you can use
Mindjet’s Visual Studio Project Template for C# and VB Add-Ins that takes care of these things automatically but you would still need to

Click here to download the
Mindjet MindManager PIA redistributable. This installer installs MindManager PIA (Mindjet.MindManager.Interop.dll) in the GAC and installs a merge module in your %Programfiles%/Common Files/Merge Modules/ MindManagerredist_>version<.msm While building new addins make sure that there is no local copy of PIA. If Addin setup project has Mindjet.MindManager.Interop.dll as the dependent file, make sure that it is excluded.


Will it affect the current addins?
Yes, it might affect you current addins.

How to update current addins?
--> Get the latest installer for Mindjet MindManager PIA redistributable from Mindjet’s devzone website. Install it.
--> Open your addin project. Remove existing reference to MindManager. Now add the reference to MindManager again.
--> Now compile your project you will get the namespace errors. You need to change the namespace from “MindManager” to “Mindjet.MindManager.Interop”
--> Build your project again. At this time, in your setup project, you might see that there is an added dependency for “mindmanagerredist_>version<.msm”. This is a Mindjet’s redistributable merge module, to ensure that when you distribute your addin if the user has an older version of PIA it updates the older version with the version that you used to build the addin. If they have a newer version of the PIA installed the merge module does not change anything. If you don’t see this added then right click on your setup project (in solution explorer in VS) and then select Add Merge Module and select from %Programfiles%/Common Files/Merge Modules/ MindManagerredist_>version<.msm

Remember:
--> Make sure that you have installed the latest PIA Redistributable on your computer. It will make sure that you have the latest PIA and the merge module for backward compatibility.
--> While building addins make sure that Mindjet.MindManager.Interop.dll is not copied locally.
--> Make sure that you include the MindManagerredist_>version<.msm in your addin’s setup.

Vivek's Mind

I am certainly not close to "Mind of Mencia" (If anyone who is not aware of Mencia live it or google it). But yes going with his spirits of being creative in Mind-Mangling I think in terms of Mind-Mapping and creating new software solutions using Mindjet MindManager.

When I joined Mindjet I was nowhere around the word Mind-Mapping. It sounded exciting to me and I got on to Mind-Mapping world along with others to explore this new part of technology globe. As a Solutions Engineer, I was new to this world and started working with Michael Scherotter I learned the first basic concepts and then there was no stopping. And it was soon that I realised that I was not wrong with exploring this part of technology and I this is what I wanted and this is what I got. Now here I am using my mind to develop Mind-Mapping solutions on MindManager.

I will keep posting new solutions and articles to support and help everyone to build solutions using MindManager. 

Keep Mind-Mapping.

Good Luck.

Welcome to Mindjet Labs.

Mindjet labs showcases the possible extent  that MindManager can be used to build software solutions that gather information, organize and share it using MindManager Maps.

For all those who have browsed through the older version of Mindjet Labs, they all would know how powerful MindManager is. Why?, because that entire website was developed using MindManager Maps, XSLT and Java script. 

Now as we step forward to a more extensible and widely acclaimed platform (community server) we want to help developers build technology centric powerful MindManager software solutions. This new website will be a single platform for developers interested in creating MindManager based software solutions. 

I along with all others here welcome you this new world of MindMapping on labs.

Happy Mapping !!