VSTO and Native Addins - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

excel4apps
Posts: 5
Joined: Wed Mar 14, 2012 9:20 am

VSTO and Native Addins

Hi There,

I have a project which installs native addins and if I create a separate project with the addin wizard for a vsto addin that seems to work as well. From what I can see, the wizard just adds some registry keys for the vsto addin project.

I have tried adding the registry keys to my native addin project but the registry key does not get created?

Is there anything else the wizard does that I am missing or am I just not creating the registry entry correctly?

Thanks,
Grant.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: VSTO and Native Addins

Hi Grant,

From what I can see you want to have a single installer for a native an VSTO addin? If so, I recommend you create separate MSI packages for both of them, and in the project of the VSTO addin use the import MSI feature from Advanced installer to import the MSI generated for the Native addin project. Thus you will end up with single project for both of them.

The settings for the addins consist mainly of registry information, but its safer to use the import method, than creating them manually, and faster too.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
excel4apps
Posts: 5
Joined: Wed Mar 14, 2012 9:20 am

Re: VSTO and Native Addins

Hi Bogdan,

Thanks for coming back to me.

I created a project with the wizard for the Excel VSTO addin. I ran the installer which completed and then when I open Excel it runs the VSTO installer to install the addin. You then have two items in the Add/Remove programs, one for the installer project and one for the VSTO addin. Is that correct? I notice then when I re run the installer and choose remove it will only remove the installer project. The VSTO addin remains in Add/Remove programs?

I then tried to import the msi which contains the native addins into this VSTO addin project. It complained about needing to be an Enterprise project type. I tried first leaving it on Professional project as well as changing to an Enterprise project. Both issued a message that I need to check the components as something may not be imported. On both scenarios when I run the new combined project it complains that it cannot be run with .Net framework lower than 2.0. This PC has .Net 4 CP? I separately ran the native addin msi and that all worked perfectly.

I then tried starting with the VSTO addin project only again and then manually add the native addin components to it. The minute I add a Property Based folder and run that installer it complains about not being able to find a network location by the name of my propert based folder? This confuses me as I use the property based folder in the native addin to load a file into it. A custom action script runs before that to populate the session property for that folder.

I also then tried starting with the native addin project. It's easy enough to add all the VSTO addin files to the applciation folder but as I mentioned before, the registry key that I put in the project does not get created. Even if I create the registry key manually after installing the native addins, the VSTO installer does not run when I open Excel so either the key is wrong or there is something else that needs to be done. The key I am talking about for clarity is Microsoft->Excel->Addins->[Manufacturer].[Product] which has Description, FriendlyName, Manifest and LoadBehaviour values.

Let me know what else I should do.

Thanks,
Grant.
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: VSTO and Native Addins

Hi Grant,
You then have two items in the Add/Remove programs, one for the installer project and one for the VSTO addin. Is that correct?
Actually this is caused by a small bug from Advanced Installer. Normally the first install, the one created with Advanced Installer should handle all the settings,
including the ones done by the second installer, the one that runs when you start the Office app. A fix has been implemented and will be available with the next version of Advanced Installer. Until than you can apply the solution explained by me here: http://www.advancedinstaller.com/forums ... 212#p50212
This confuses me as I use the property based folder in the native addin to load a file into it. A custom action script runs before that to populate the session property for that folder.
Probably the custom action is not scheduled correctly. Have you tried executing it before the costing operations?

The keys you've enumerated are the correct ones for the current version of Office, however for older versions like 2003 additional keys are required. This why I recommended you simply use the "Import MSI" feature from Advanced Installer in your native addin project, to get the contents of the MSI created for the VSTO addin. Have you tried that?

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
excel4apps
Posts: 5
Joined: Wed Mar 14, 2012 9:20 am

Re: VSTO and Native Addins

Ok, I will try out your workaround as soon as I can get a single installer working.

Actually the custom action that populates the session property is run in the Begin phase so should be ok.

So I tried it that way around now. Importing the VSTO addin msi into the native addin project. It adds all the files and adds the registry entries into the project nicely. Still get the warning about Enterprise project which I ignored?

However when I run the installer it installs the native addins correctly but not the VSTO addin. The VSTO addin files are in the install folder but again, no registry key is created during the installation process so I guess that is why the VSTO install does not kick off when opening the Office app.

When the VSTO addin is imported into the project the items are added under the Main Feature and I ensured that it is installed by default, locally and disabled advertise.

So I am not sure why the registry entries are not being created? Interestingly I just changed the project to a per user only (with administrator rights required) from per machine if user is an administrator and the registry keys were then created but with a load beahviour of 2! if I manually changed that to a 3 the VSTO addin installs on opening Excel. Unfortunately it broke the native addin install though.

The VSTO addin we've created won't be supported on Office 2003 so no concerns there.

Thanks,
Grant.
excel4apps
Posts: 5
Joined: Wed Mar 14, 2012 9:20 am

Re: VSTO and Native Addins

But if I change the project to per machine only (fails if user is not administrator) (the user has to be admin for one of the components for our native addins) and if I move the registry enitres down from the Current user/Local machine section to the HKEY_CURRENT_USER section the keys are created, but the LoadBehaviour keeps changing to 2?

Getting closer!

Thanks,
Grant.
excel4apps
Posts: 5
Joined: Wed Mar 14, 2012 9:20 am

Re: VSTO and Native Addins

And I just decided to go back and try the workaround with the |vstolocal and now it keeps the LoadBehaiour set at 3!

Looking good so far. Thanks for your help.

I just need to check that I can enforce a pre-requisite for the VSTO runtime only if a user selects the VSTO addin feature but I think I saw that somewhere.

Cheers,
Grant.

Return to “Common Problems”