|
I've written an add-in for Internet Explorer and am now writing an installer for it. I need the installer to detect if IE is running. I found the "Detect if IE is running" thread (http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/9fd231bb-5bdb-4383-b591-7b5b47ecffb8) here in this forum. I implemented my own class library and what's odd is that at first, it worked correctly - when I ran the installer, if IE was running a dialog box came up that said something along the lines of "IE is running... please close it first.." and the dialog box had Cancel, Retry, Ignore buttons. But now it doesn't happen at all. Ever. Instead, the installer does its thing and when finished, I then get a dialog box that says: "An exception occurred in the OnBeforeInstall event handler of TestClassLibrary1.TestInstaller2. -> Please close all instances of Internet Explorer before continuing the installation." What's odd is that I didn't change a thing (that I know of), but this was originally working 100%. Does anyone know what could have happened? I've since tried rebooting my machine (several times), removing and then adding my custom installer library, and tried debug vs. release builds but nothing I'm doing is working. The steps I'm performing are: 1) In my setup project, remove the TestClassLibrary1.DLL 2) In the Custom Actions Editor, I select the Install folder, right-click, then select Add custom action 3) Press OK 4) Press Add Assembly 5) Select the Browse tab and then navigate to and select my TestClassLibrary1.DLL 6) Then press the OK button to close the dialog box 7) Rebuild my installer 8) From Project menu I then select Install This was working 100% correctly before but now it's not working at all. Any suggestions? (oh, and this is with Visual Studio 2005 BTW) The last message in the "Detect if IE is running" thread says that custom actions only run at the end of the install after all your files have been installed, but that was not what I was seeing before. Thanks (in advance) for any tips and suggestions on this, Jeff
| | Jeff99999 Wednesday, August 05, 2009 11:21 PM | I got it working now. I combined what Phil wrote along with this article on CodeProject, http://www.codeproject.com/KB/install/msicustomaction.aspx Jeff
- Marked As Answer byJeff99999 Friday, August 07, 2009 5:54 AM
-
| | Jeff99999 Friday, August 07, 2009 5:54 AM | As I said in that thread, the idea that you can detect IE and shut it down before you install something is not going to work. Custom actions run at the END of the install after all the files are installed, even if they do have names like "before install" so if the goal is to shut down IE before your files are installed it ain't gonna work. I don't care what code gets posted.
That message you sawwith Cancel, Retry, Ignore buttons is nothing to do with you. It's a standard MSI FilesInUse dialog when it detects that you're replacing a file being used (by IE in this case).
The code in that thread works - I suppose it could be described in that way - but like I said before, it will run at the end of the install, and yes, it looks to see if IE is running and throws an exception if it is. That's what you're seeing - an InstallException, plus the message in that code, plus the entire install is rolling back I assume. I'm guessing you didn't really expect this custom action to cause your entire install to throw an exception and roll back, but that's what it does. It's there in the code.
So if anyone tells you that you can detect if IE is running before the install with a Visual Studio custom action, now you know better ;=).
Phil Wilson | | PhilWilson Thursday, August 06, 2009 12:24 AM | >That message you sawwith Cancel, Retry, Ignore buttons is nothing to do with you. It's a standard MSI FilesInUse dialog (and the light bulb goes on) Ahh...! Thank You! I spent two hours trying to figure this out. I did read your reply but since I had seen this dialog box I figured it actually did exist and I had somehow changed some subtle setting somewhere, and didn't realize that what I was seeing had nothing to do with my installer control. OK, so your other post said: "Custom actions are no use in this situation unless they can be made to run early in the UI sequence (using Orca or some other tool)" I've installed Orca, but I know nothing about the tool. What should my next approach be? - Can I use Orca to move OnBeforeInstall higher up in the execution order so it gets called before the UI? (and if so, how?) - Or do you have any tips or know of any tutorials on how to execute custom code before the install? Thanks, Jeff
| | Jeff99999 Thursday, August 06, 2009 1:44 AM | I got it working now. I combined what Phil wrote along with this article on CodeProject, http://www.codeproject.com/KB/install/msicustomaction.aspx Jeff
- Marked As Answer byJeff99999 Friday, August 07, 2009 5:54 AM
-
| | Jeff99999 Friday, August 07, 2009 5:54 AM |
|