I am using "GeckoFx-29.0-0.6" for having a firefox web browser control in Windows Form application.
When I run my Windows form application which have GeckoFX browser control everyting is working fine.
I use the following code in my application,
Gecko.Xpcom.Initialize("xulrunner/");
and I use xcopy to load the bin folder with xulrunner folder. So in this scenario the xul runner is loaded from the same loaction where the application .exe is found.
When I make wix setup of my application, I am doing the same process, I have xulrunner folder in the same location as application .exe. But the application is not able to invoke the windows form. Its showing the message "unable to load DLL 'xul'".
I resolved this issue by changing my setup such that the xulrunner folder is copied to the c:/windows/system32 folder location. When I do so, the application works successfully in some machines but do not work in someother.
Is there any way to resolve this? such that I don't need to put the xulrunner in the system32 folder ?
You can try giving the full path to the xulrunner directory. Do something like:
var programDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
Gecko.XpCom.Initialize(Path.Combine(programDirectory, "xulrunner");
That will work when the app is installed, and if you've placed xulrunner in your output directory. If you don't want to bother copying it in there, then you will want to make the above code a bit smarter so that when you're just running from Visual Studio, it can locate xulrunner where you have placed it.
Our class for smartly finding files under a number of conditions, FileLocator, is open source, you can grab it and use it.