Working with an ActiveX control installed by msi installer - c#

I created ActiveX control and it's .msi installer in a way described in this tutorial http://haseebakhtar.wordpress.com/2011/05/31/creating-an-activex-control-in-net-using-c/.
Then I installed that ActiveX control using this installer and tried to execute it in IE9. Installation went fine. And after that I got an excellent work of my component in a web browser.
Next time I ran the installer once more to uninstall the component. It seemed that everything was fine since I didn't have any errors while uninstalling the component and the folder of installation was removed from the disc. But then I could see that the activeX control continue to execute anytime I reload the page in IE. At first I thought that the IE had buffered it and then I decided to clear all browsing history. But it didn't help. I also restarted IE and my web server but that didn't give any changes. ActiveX control is still working.
My questions:
1) How can I uninstall it in proper way?
2) Should I uninstall and install my activeX component anytime I want to see any changes I did? Is there any easier way to see results of my work in IE?

After your have uninstalled your control, search the file system for its DLL and the registry for its GUID. If the GUID is still registered, that'd mean the uninstaller did not do its work properly. The DLL still could be there, if you had your web page open during the uninstall pass (as the web page would keep the DLL loaded). It should be gone upon reboot, though; if it is not, that would be again a problem of the MSI script.
Note, you could have your control installed automatically by IE without MSI, provided the control only uses HKEY_CURRENT_USER hive for its registration, here is how. Although, you would need to digitally sign your control package for this to happen, which is always a good idea anyway.

Related

Setup.exe not working or slow to open install dialog for a ClickOnce application

I am trying to use ClickOnce to automatically update a C# software.
I can publish my application, the setup.exe is created, but when I download/run it, windows tells me that application can be dangerous, the publisher cannot be verified. And if I choose to run it anyway, or as administrator, the install dialog sometimes appear after 10 min but in general nothing happen.
I tried to find a way to make my application trustful but even if :
I enable ClickOnce security settings
Select "This is a full trust application" in "Security"
Add a certificate in "Signing"
It is still not working, so I have no more idea about how to fix this.
I can install it with the ".application" file but I think that is not the correct way to do it.
Thanks by advance !
You are pretty close. Much of the slowness is probably because of anti-virus. Signing it will make things better. The client machines will complain about how trustworthy the app is, unless you install your key (the one used for signing) on each of their machines.
Installing with the ".application" is just fine, especially if you are installing from a network share (instead of a web site or intranet site). That should put an app (icon) in the users' start menu.

Create outlook addin without need for admin rights

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.

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

Embedding Mappoint 2010 Control in C# WinForm Creates Registry Error In Win7 (64-bit)

I have a WinForms application with an embedded MapPoint control that I've been maintaining for about 5 years now.
The application originally used MapPoint 2004, then 2006, and now we're upgrading to 2010.
Within my development environment (VS2008/.NET 2.0 for the project) the application runs fine.
Once I create an installer and install the app and try to run that, I start encountering problems. First the application prompts the UAC in Windows 2007 64 bit, though I don't have any code that modifies the filesystem or other protected systems.
If I choose "Yes" to allow the program to run, as soon as I try to create a new instance of a map to use within my map control
this._activeMap = this._mapCtrl.NewMap(MapPoint.GeoMapRegion.geoMapNorthAmerica);
I get a messagebox from MapPoint with the following error:
Your registry settings were not copied correctly. To correct these settings, run setup again for this application.
I'm aware of the KB article (http://support.microsoft.com/kb/314590) regarding this error in Streets & Tips, but MapPoint 2010 runs fine on its own, and as I said, the app runs fine from within VS or when run from a non-protected folder (e.g. if I do an x-copy of the files to my user's directory, it runs fine).
We received the same MapPoint error (along with others) on our install. We use NSIS for our install packages; once we ran it with elevated permissions the errors disappeared. I wish I could give you more details but I was not me who coded our installer. I was simply told how we got passed the MapPoint issue. I hope it at least points you in the right direction and helps you narrow your research.
Yes elevated install permissions are typically required anyway. My experience is more for MapPoint add-ins rather than apps that use the ActiveX control. There, I use the Visual Studio installed and Add-in Express, which has special settings for UAC handling. I don't think they have anything for using Office/MapPoint ActiveX controls, but it might be worth looking.

How do you deploy an ActiveX control for ie from a VS2008 project?

What are the steps to deploying a project created in VS2008 (windows forms and c#) as a ActiveX control hosted in ie? I have a file uploader project that I want to be hosted on a webpage that users can navigate to, click 'trust this active x control' and the application runs on the page in the browser, just like a java application.
To be clear, I'm not looking for ClickOnce (that is an installer) and I don't want the user to have to modify their .Net security or add a trusted site (so just putting the .dll file in a OBJECT tag doesn't work). Do I need some digital signature, some certificate something? I've found references to this but no step-by-step guide to it (like I got for java).
Any suggestions? This seemed like it'd be the easiest part of the project but its turning out to be by far the hardest, I can't make any headway on it.
Thanks,
Sam
And the answer is, sadly, that .net "activeX controls" aren't like COM activeX controls (VB6), even if you make the .net control com-visible you can't register it with the OS the same way. What you have to do is:
1) Create your .net dll file
2) Create an installer exe (I did it with InstallShield, looks like it can also be done in VS)
3) Package that installer into a cab file
4) Point to that cab file in IE.
What this results in is in IE the little 'activeX' confirm drops down, then the 'do you trust this app' comes up, then UAC (vista/w7) and then you get to run through the normal application install process: installer window comes up, confirm, pick install dir. After thats done, your control appears on the page in IE.
The way it used to work in COM was once you did the little activeX confirm drop down (and UAC) the app would just run
Now, the above is only if you need/want it to be .Net 2.0 compatible. If you don't mind only being compatible with 3.0 or higher you can do an XBAP application:
What is Microsoft's roadmap for in browser applications? Silverlight, ClickOnce, ActiveX, dlls
And you can even just take your .Net dll you spent the last 3 weeks learning how to make (frick) and jam it into the WPF application:
How to put a custom windows forms control in a WPF application?
Hope this helps others.
Sam
We deploy AX control in two forms:
CAB file. Installation process as you described in question. You need sign control, pack it into CAB and sign the CAB file. More details you can find here: Packaging ActiveX Controls.
Standalone installer. MSI file for users without admin privileges for manual installation.

Categories