Create outlook addin without need for admin rights - c#

I wrote an outlook addin with some basic functionality to access a webservice and execute methods on it. Everything works like a charm, except that I can't seem to get rid of the fact that users need admin rights to install this add-in. Google doesn't really seem to have the solution or answer for me,.
Is it possible to write an outlook addin (VSTO) which users can install without the need of admin rights?
Thanks a lot in advance!

It depends if you want a Per-User install or a Per-Machine install.
The main difference is where the registry keys are saved, under HKLU or under HKLM:
The other main difference is Per-User is set by default to install in the Users folder and Per-Machine is set by default to Program Files.
As #Aron mentioned certain prerequisites may require admin rights to install. If you know the client has the correct .Net version installed its possible. Otherwise you might need to resort to running the VSTO Add-In without .Net. Note: Microsoft Info path is written entirely in .Net so if users have the full office install, .Net 2.0 (maybe more recent depending on the version) should already be installed.
The easiest way to avoid the UAC prompt is to run the MSI not the setup.exe. Because the setup.exe is responsible for the downloadeding/installing components (such as dotnet). Running the MSI wont ask for admin.
Also note the MSI command line usage to see all the switch's (eg /quiet):
Start > Run > CMD > Enter
c:\Apps\App1\Release\app.MSI /?

I know this is really old, but there still isn't much help available this process.
One possible solution if your only goal is to share your project with someone and not specifically "install". I'm sure there are some issues with this method, but it is really simple, and so far it is working for my teams simple project. Additionally my team is not allowed internet access on their development machines and that complicates the standard publishing process.
Publish the project. (this is for VS2017 yours may be different)
Build the project. I built in release mode, but debug may work.
Publish the project.
Right click on your project in the solution explorer and choose
properties.
Select the publish tab.
make sure publishing folder location is "publish/" (or more generally a relative file path)
click publish now
Next we need to add it directly to someone's office program. You can add it directly by
opening options under the file menu
Go to the Add-Ins tab
Make sure "Com Add-ins" is selected in the drop down and click the "Go..." button
Once the dialog box opens click the "Add..." button
Navigate to "/bin/release/app.publish/" and choose the setup.exe file.
Restart the Office program.
Your vsto add-in should now be added in.

The answer is yes and no. In of itself, it is possible to install a VSTO plug in without admin rights via ClickOnce.
However, certain prerequisites may require admin rights to install (such as dotnet).
So in the general case no. But it maybe possible.

Related

In-use files not updated by MSI-installer (Visual Studio Installer project)

I'm using the Visual Studio Installer Projects extension to build the MSI-installer for my application. However, my application is meant to be running at all times, and if it's open when the user is installing a new version of my software, the open files are not overwritten, and very little to nothing is actually updated (although there are no installer-errors).
I've found that using the installer project's "Custom Actions" to run a script that closes the application doesn't help, as none of the actions are called before the files are replaced.
Is there a good way to make sure the open/locked files gets terminated before the files are supposed to be overwritten?
We had this problem, and the solution we came up with was to create two apps; the user app and an updater app. The MSI installs both. Each app checks if the other needs updating and, if it does, closes the other app, downloads the other app's updater, runs it, then relaunches the other app. Additionally, each app monitors if the other app is running and, if it isn't, launches it.
It would be useful to know more about your application and how you are doing the upgrade because:
You will normally see a FilesInUse dialog saying that files are in use, prompting the user to shut them down, but not if the install is silent.
Visual Studio setups have no built-in support for shutting down and restarting services, so if your app is a service you'll need extra work.
Files that actually do need to be replaced will prompt the user for a reboot (if they are not previously shut down) in order to replace them at reboot time.
So if you're not seeing reboot requests or FilesInUse dialogs in a UI install then something else is going on. So you need to be sure that:
a. You are really doing an upgrade where the version of the setup project has been incremented, the UpgradeCode is the same (and the ProductCode changes when you increment the setup project's version). Your symptoms could be the result of the upgrade not working and you're seeing just a repair.
b. The definition of "new version" is that you have an upgrade as in a., AND, the file versions of the binaries have been incremented. The default overwrite rules for installs require incremented file versions, so if they haven't been incremented you'll see no updates, and Windows will not attempt to show FilesInUse dialogs or reboot because there are no files that need replacing.
This isn't a solution to the problem, but rather another solution; the one requiring the least work in the end.
I ended up not using 'Visual Studio Installer Projects' for my installer. Instead I looked to Advanced Installer, which just works with no issues. Things like this is taken into account, and custom actions allow for more options.
If your project is open source, you can write to them about a free open source "professional" license, equal to their "professional" plan, which is normally $399 (onetime purchase).
REBOOT: How are you installing this MSI? What command line? If you set REBOOT=ReallySuppress on the command line, you will not be prompted for a reboot even if one is required to complete the installation of the product.
msiexec.exe /i MySetup.msi /QN REBOOT=ReallySuppress
If you are using a distribution system I suppose suppressing reboot prompts could be standard behavior. Then your product files should be put in place after a reboot (PendingFileRenameOperations or perhaps some newer mechanism).
It is also possible that Visual Studio Installer Projects do something strange that I am not aware of.
Log: I would try to create a good log file for the install, to determine what is going on:
msiexec.exe /i C:\Path\Your.msi /L*v C:\Your.log
Log All MSIs: Personally I like to enable logging for all MSI installations - as described in the "Globally for all setups on a machine" section in the above link.
Interpreting an MSI log: interpreting a log file can be challenging sometimes. Here is an answer with some links to help with this.
Reboot Manager: Reboot management is a very complex topic, and Windows features functionality - in the form of the restart manager feature - to try to minimize the need for reboots, by instead shutting down and restarting applications as part of an installation in an "auto-magical" fashion (application listens for messages and shuts itself down gracefully when told to, and the system may restart the application after the install - if configured to do so).
Updating your application to comply with the restart manager is the only real fix for such problems that you see, in my opinon.
The section "Restart Manager" in this question tries to summarize how to implement such support (maybe just read the yellow section a bit down the page).
The Advanced Installer guys have a very nice, technical article about this:
How do I add support for Windows Restart Manager to my application? Also linked to in the link directly above - still worth a direct link here I think.
According to below link
https://social.msdn.microsoft.com/Forums/windows/en-US/0b40b367-3341-43d8-b82e-1ace546969f8/how-can-installation-stop-and-restart-existing-service-?forum=winformssetup
"There is no good support in VS installs to stop and start services. During install, the issue is that custom actions run after everything is installed so it's too late to stop a service that you are upgrading or replacing. Yes, they have names like "BeforeInstall" but they really are not before the install."

How to deploy a word ribbon

Hi I inherited a word ribbon project. I need to create an installer but first I would like to manually install it(i.e. copy files and run commands in command prompt).
The problem is that I don't know how to deploy the ribbon onto another PC. All I know is that I created a word ribbon in VS and when I run it, word opens and the ribbon appears.
I need to be able to deploy it on word 2007 onwards, 32 and 64 bit where available.
Thank you
I would recommend to create an MSI for deploying your add-in, this is the most used distribution system from Windows, that has built-in support for silent installation, repair, rollback and uninstall. So you can easily have your clients deploy it through Active Directory/GPO or SCCM if they need to.
When using a MSI to deploy the addin you basically copy your add-in resources/files in the desired installation folder and create the registry entries as mentioned by Patrick.
I recommend installing the addin per user, that is to install the files under APPDATA folder and the registry entries under HKCU. Installing per-machine will require admin privileges from your users (maybe not all will have that privileges) and you will also have to work much more to see where to write the registry entries under HKLM, because here you have the key "Wow6432Node" dedicated to 32 bit applications, so based on the edition of WIndows and that of Office you need to see if you will need to write under "HKLM\Software\Office..." or under "HKLM\Sofware\Wow6432Node\Office...". When you install per user under HKCU this problem is gone as under HKCU\Software there is not registry redirection, so the extension will work for all 32 and 64 bit machines/flavors of Office. Also, installing the extension per-user will automatically give your users the possibility to install different versions of the add-in on different accounts from the same machine, if this will ever be needed.
A very important thing, you should have a launch condition in your MSI for Word 2007, so that the users which don't have installed cannot install your add-in also. All tool authoring tools should be able to set this launch condition quite easily.
Also, you should digitally sign your MSI and addin with a code signing certificate (acquired from a certified vendor, like VeriSign, Thawtee, etc...).
To create the MSI package you have multiple options, but basically you can use any tool that is capable to create MSIs, as long as you create the registry entries correctly. For example Advanced Installer (the tool on which I work on) has a nice wizard that just asks what version of Office you target, asks you the files you want to install and it automatically handles the rest for you. You can have it integrate with VS so you build the MSI directly from your VS solution if desired. As for the launch condition, it is just one click away in the Advanced Installer GUI, no need to do any scripting.
You can create a ClickOnce installer by clicking Publish on your Visual Studio project in the Solution Explorer or by editing the registry.

Problems with ClickOnce deployment (to me, it's so annoying)?

I've just tried ClickOnce for the first time to deploy my SQL Server Compact application. I think this kind of deployment is very unprofessional:
The output setup is a folder including 3 objects, one folder named Application Files, a setup.exe and a .application file which I've never seen in a professional product setup package.
Plus, clicking setup.exe seems to help user install the application so quickly but user has no chance to select what location s/he wants to install the application. It's installed by default at somewhere in the target computer. And even I tried looking for its location after the installation, I couldn't find it.
The last, after the installation, there is a folder named "Microsoft" in All programs menu, and the installed application shortcut is located in there. I wonder why it is always Microsoft? I even tried editing my Company info in Assembly info through Project Properties window. The application shortcut is something strange when I can't find its target executable file in its properties window.
With all the above ClickOnce can bring to me, I consider it as a funny job for testing the application only not for publishing a commercial application.
Could you please correct me if there is any wrong in #1, #2, #3 and please give me a better solution for deployment, I'm interested in SQL server (service-based and file-based) application only?
Your help would be highly appreciated. Thanks.
A ClickOnce install is a per user "sandboxed" install, not a normal install you think about when installing normal applications. The .application file is used by the server as a manifest and to determine if it needs to update the install when clicked.
The reason you can't find setup.exe is because it isn't there. Once the files are installed, it isn't kept. The user isn't supposed to know where the files are, the system manages the location and updating of the app.
So, with all that, it appears you need a more normal install, not a ClickOnce. ClickOnce isn't intended to install services or other per machine files.

Creating a "sure to run" app / installer in VS2010

I need to create a simple installer of sorts for a different application. That other application already has it's own simplistic installer, and I don't want to meddle with it.
The reason for my own installer is to allow the user to install SQL Express if (s)he so chooses, and also to pre-install any other basic requirements for such a procedure.
At the moment, here's where I'm at:
I've created a single Windows form application, with big buttons (this is for a user which likely won't be very good with computers) to install SQL Server Express (using silent install with a predefined set of arguments) or the actual application, along with some helpful text to let the user know what's going on. Something along the lines of Visual Studio autorun window.
I've also added the standard set of pre-requirements to the application (.NET, Windows Installer).
Everything works OK if I run the app by using the executable. HOWEVER, if I publish it to create a ClickOnce application (so the pre-requisites are installed when needed) and run it, it stops running other installers.
EDIT: Apparently the problem with not being able to run other application from a ClickOnce application is only on my end, and probably deserves a new question, not necessarily here on StackOverflow (perhaps on MSDN forums?).
In your program before launching the installer you can check if .NET is installed. Its pretty easy to check if a particular s/w or a version of s/w is installed. Write a program that will check HKEY/LocalMachine/Microsoft/Windows/CurrentVersion/Uninstall and in that there will be list of programs that have been installed on that machine. If you find then go ahead with your install else suggest user that he needs to install pre req.
When you create a setup project you can right click on the setup project, go to properties, and click on pre requisites. In that you can mention which version of .NET framework is needed and then give the location of the framework. In this link look for Huggy Bears response eggheadcafe.com/community/aspnet/2/10131905/setup-project.aspx
I've settled for a "Click Once" application. It can install all required .NET components needed for it to run, thus becoming an "sure-to-run-non-native-C++-code-splash-screen".
Granted, there ARE issues with Click Once, but this is far better than nothing. It's also better than running C++ or unmanaged code applications. ;)

Unattended Install for Setup & Deployment project, VS 2005

I have a setup & deployment project which includes a large C# project that i have created.
I also have some prerequisites that i bootstrapped to the exe, although the MSI file is, as usual, just the project itself.
I would like to create a complete unattended install, not just removing the User interface forms via the UI tab in the Setup project, but to install completely unattended.
In other words the end user will click on the msi and the installation will run by itself (maybe one form for showing progress...)
I read quite a bit about the issue but haven't found anything that suits my needs. I read about IExpress but I havent used it, I also read about commands that you can give the msi, but I would have to insert them into the EXE which is a bit of a problem...
Looking for help on the problem.
Thx in advance

Categories