clickonce auto update issue - excel

I have an excel vsto add-in. I am distributing this add-in by sharing the clickonce installer file. Later, I tried to make this application auto update. for auto updating my application, I created a c# console application, which
downloads the latest clickonce installer
closes the excel
uninstalls previous version of addin
opens the clickonce installer
the first 3 steps are working fine.
for the fourth step I used Porcess.start('file_location to clickonce setup.exe)
if the user account is admin, there would be no problem, otherwise it would ask for admin password, if the admin password is given, the addin gets installed in the admin account and not in the user account.
I am struggling to actually understand how to auto update vsto addins if clickonce is used and distributed manually.

I think you may have misunderstood how ClickOnce is intended to be used with VSTO.
Basically all you have to do is deploy your addin using ClickOnce see
here which it sounds like you're already doing and then under Project Properties - Publish look for:
Install Settings - Updates - Set to your update interval (e.g. every time the customization runs)
This will then cause your VSTO addin to update automatically every time Excel starts (or based on your interval). There's no need to manually fire off the installer, close Excel, etc. it's all handled by ClickOnce.
That being said, according to this and that MSDN link, ClickOnce is not suitable for multiple users, but I assume that your use case is to have the same user both install and use the Addin.

Related

Installation of VSTO by adding registry in end user computers

I've developed a VSTO addin for excel with VS2019. In my company execution of exe files are controlled by privilege management software (https://www.beyondtrust.com). For this reason, I don’t want to crate window installation file or setup.exe file. For this reason, I am traying to install VSTO by adding registry. My steps are as follow,
I have run VSTO addin from VS2019.
I have copy all registry from
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Excel\Addins
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO\Security\Inclusion
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSTO\SolutionMetadata
Deleted all above-mentioned registry.
Moved all files (dll, manifest, VSTO etc) generated by VS2019 in new folder.
Re added all registry with old GUID and RSA key but only modification of path for new path of VSTO files.
After that whenever I launch excel, my addin do not load and load behaver changed from 3 to 2. No matter even I change to 3, it got changed as 2. It always shown me my addin in inactive addin my option of excel.
Can anyone guide me?
Thanks
Best way is to create COM-AddIn using IExtensibility instead of VSTO addin.
It is similar to VSTO. Only change is u need to do everything by yourself including
user/machine registry

VSTO Addin Creates 2 items in Add/Remove programs

I have created a vsto addin in VS2012. I have added an installation project to the solution using Installsheild LE. After installing the exe that I get, I get the expected item added to my add/remove programs. However when I open Word, I get prompted with a Microsoft Office Customization Installer prompt which says the publisher is unknown. I click OK to this and it adds my addin as expected, which all works fine but I also get a second item appear in my add/remove programs.
Can anyone tell me why I am getting the second item in add/remove programs and offer any advice about what I should do to avoid this?
You have to add "|vstolocal" to the addin registry value that points to your addin file. This tells ClickOnce to run it directly and not install it per-user.
You also want to digitally sign the addin using a certificate issued by someone in the users trusted root. This could be VeriSign or others. If you create your own certificate you have to use custom actions to install the root certificate in the certificate store and to register the publisher cert as a trusted publisher.
I've created about a dozen of these installers over the last 8 years and it's tricky at first but gets easier over time. Several of my customers are using InstallShield LE to get the prereqs installed but then I factor all the components out into a WiX merge module where I can use things like the Util extension to install certificates.
It looks like you use ClickOnce and MSI installers to deploy the add-in. You need to remove any of them. Both kind of installers are described in the following articles in MSDN:
Deploying an Office Solution by Using ClickOnce
Deploying an Office Solution by Using Windows Installer
Is that your dev machine and got Visual Studio in it? I have seen this happened with Windows 7 during development the addin is added in to add/remove programs. This has gone later when I updated my Windows 7 machine. Some updates from Microsoft has removed this later.

Does installing VSTO addin with ClickOnce edit the registry?

I currently have a VSTO Excel addin which is installed via Installshield but was looking at using the ClickOnce installer (on the publishing tab) instead.
I've tested building it through ClickOnce and it does load in Excel. I'm slightly confused however as I have not specified the registry keys in order for excel to load the add in.
Is ClickOnce editing the registry or is it using a different mechanism to load the addin?
Secondly, does installing an add in via ClickOnce require admin privileges?
No ClickOnce does not require admin rights. HOWEVER, if you specify a dependency in your setup program such as .NET framework or Visual Studio Tools for Office, then the ClickOnce program WILL prompt for admin credentials to install those prerequisite components if they are not already installed. Also, if you need to install for all users on the computer, then I'm pretty sure ClickOnce won't be able to do that since installing for all users requires writing the HKLM registry, which is a privileged operation.

Does Excel Add-In VSTO 2005SE Need Manifest Files?

We developed application level Excel Add-In in Visual Studio 2005 using VSTO 2005SE. The add-in installs and works fine on Excel 2003, 2007 and 2010 (32-bit) on the most of computers. However, in some cases Excel does not load it, despite the fact the registry LoadBehaviour (LB) value is set to 3 during the installation. When the user un-installs the add-in the LB is still set to 3, so I assume there is no error happens during initialization and loading, otherwise LB will be 2 or even 1.
We use MSI installation and deploy the add-in on application level with Local Machine registry keys.
When we build the add-in in Visual Studio 2005 there is no manifest files generated, so we don’t include these files in our MSI installation and there is no registry key entry for the manifest. So, we assumed the manifest is not essential part.
Even more, according to http://msdn.microsoft.com/en-us/a3swb498(v=vs.80) the application manifest provides information that is used by an Office solution to locate and update its assemblies. Since we have only one assembly that is a solution, we don’t need any manifest.
Our MSI file, add-in assembly and setup.exe files are signed with the COMODO certificate.
Does anyone know if we need an application and deployment manifests and if so how can we generate ones?

Deploying Com Interop into sharepoint server

I have a com interop dll (zkemkeeper.dll) that i have to register and use, i wonder how can i deploy that to the SharePoint server using SharePoint package?
You cannot deploy COM or COM Interop DLL to SP farm by SP solution. You need to install the component on every SP server in the farm by other means.
Create an MSI installer to be executed on every machine. MSI can be rolled out automatically too.
Provide a PowerShell script to be executed on every machine. PowerShell can be run remotely too.
Deploy a timer job with your solution that would be executed after the installation automatically or manually and would write to the registry the necessary COM stuff.
The first two options are my favourite because they shouldn't cause technical problems at the customer. The third one appears to promise installation without visiting every machine but the Timer Service user identity would need permission to write to the local registry which may not always be granted; and you'd have to resort to 1. or 2. anyway.
You should think about switching over to ASP.NET or .NET components on the long term. There are many components available in pure .NET that can be deployed by SP solutions. You can also consider pure HTML/JavaScript controls. I would probably go for the option 1. and invest the saved time to other architecture without the COM Interop.
--- Ferda
If you are using Sharepoint 2010, see How to: Add and Remove Additional Assemblies.
See also:
Deploying custom dll's in SharePoint 2010
Visual Studio - SharePoint 2010 - Include Assembly > Quick Question
Include 3rd party dll in the Sharepoint project while packaging the wsp
visual studio does not copy assembly into gac
How to install a WSP that has dependant assemblies?
Interop.zkemkeeper.dll regsvr32 error or InitializeComponent
Then you need done the step following:
Go to the website: http://www.zktechnology.com
Download ->Software Download->ZK Access for C3 panels
Extract files
Install
Open visual studio -> Solution Project->references-> Add Interop.zkemkeeper.dll
Good luck

Resources