The Kinetic Jump site navigation header requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

Welcome Guest Search | Active Topics | Log In | Register

Updating a Browser helper object written in NET using applife Options
jorgerubio
#1 Posted : Tuesday, September 18, 2007 7:31:57 AM
Rank: Advanced Member
Groups: Member

Joined: 9/18/2007
Posts: 31
Hi everybody, i'm new to applife and i would like to know the steps to build a succesfull update of a DLL wich was written in NET as a Browser Helper Object (its an IE toolbar), taking in concern that it has to replace the dll, deregistering the a old one from the GAC and register the new one in the GAC, and at last prompt the user to shutdown Internet explorer.

How do i do this ? taking in concern that this kind of application is very different to a standalone EXE because Internet Explorer is the container of my application.

I took the steps showed in http://www.kineticjump.c...te/demos/basicdemo.aspx

and i ended up with this error:
(Reference to object not stablished as an instance of an object)
System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
en Kjs.AppLife.Update.Controller.UpdateController.c(String A_0, String A_1)
en Kjs.AppLife.Update.Controller.UpdateController.ApplyUpdate()
en Kjs.AppLife.Update.Controller.UpdateController.UpdateInteractive(IWin32Window dialogOwner, ErrorDisplayLevel errorDisplayLevel)
en Kjs.AppLife.Update.Controller.UpdateController.UpdateInteractive(IWin32Window dialogOwner)


meaning something NULL was handle. Maybe because my app its not an exe, its an DLL which attached itself to Internet Explorer 7

Thanks in advanced and please i need a reply ¡pronto!

Regards to all from Mexico
brianh
#2 Posted : Tuesday, September 18, 2007 9:50:08 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 405
Location: Minnesota
Hello,

In the situation you describe, I think the null reference occurs when the Update Controller attempts to reference the hosting application. In your case, the managed assembly is hosted through COM interop from Internet Explorer. The Update Controller will not be able to reference the hosting process (Internet explorer) because it is unmanaged.

With AppLife Update, once an update process is initiated, you can do almost anything you need to do during an update process. Keep in mind, the process hosting the Update Controller does not necessarily need to be the assembly that is going to be updated. In your scenario, you might consider using a surrogate process to control the update. This would get you out of the Internet Explorer process while performing the update. To do this, you could create a basic executable with no user interface except for the update process. Call it the surrogate.exe The surrogate hosts the Update Controller. When you want to check for updates from your IE toolbar, you simply launch the surrogate in its own process from your BHO. When launched it performs the update work. The surrogate update process can do all the work necessary to update your BHO. There are GAC actions that you can use here.

http://www.kineticjump.c...lt.aspx?g=posts&t=5

For versioning, you can set the version on the Update Controller in the surrogate.exe programmatically to the assembly version of your BHO dll and not even replace the exe during the update process. Alternatively you could set the version within the surrogate and replace it with each update. There are other options too.

You could prompt the user to restart IE from the surrogate app, or create an AppLife Update custom action to do it for them during the update process.

Also, obviously your users will need elevated privileges to perform these types of update actions. If that is a concern for you, don't forget about the AppLife Update Service.

I think this concept would provide a sound updating solution for a BHO.
Brian Haas
Kinetic Jump Software
jorgerubio
#3 Posted : Tuesday, September 18, 2007 1:29:41 PM
Rank: Advanced Member
Groups: Member

Joined: 9/18/2007
Posts: 31
i get this error when trying to uninstall something from the GAC, what do you think it could be?

System.InvalidOperationException was unhandled
Message="Error trying to reflect the type 'Kjs.AppLife.Update.GacActions.UninstallGacAssemblyAction'."
Source="System.Xml"
StackTrace:
en System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(TypeModel model, String ns, ImportContext context, String dataType, XmlAttributes a, Boolean repeats, Boolean openModel)
en System.Xml.Serialization.XmlReflectionImporter.ImportElement(TypeModel model, XmlRootAttribute root, String defaultNamespace)
en System.Xml.Serialization.XmlReflectionImporter.ImportTypeMapping(Type type, XmlRootAttribute root, String defaultNamespace)
en System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace, String location, Evidence evidence)
en System.Xml.Serialization.XmlSerializer..ctor(Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, String defaultNamespace)
en Kjs.AppLife.Update.Engine.j.a(Type A_0)
en Kjs.AppLife.Update.Engine.j.a(XmlReader A_0, Type A_1, String A_2)
en Kjs.AppLife.Update.Engine.j.a(XmlReader A_0, Boolean A_1, String& A_2)
en Kjs.AppLife.Update.Engine.j.a(XmlReader A_0)
en Kjs.AppLife.Update.Engine.k.a(Byte[] A_0)
en Kjs.AppLife.Update.Engine.k.k()
en Kjs.AppLife.Update.Engine.UI.l.a(Object A_0)
en System.Threading._ThreadPoolWaitCallback.WaitCallback_Context(Object state)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
en System.Threading._ThreadPoolWaitCallback.PerformWaitCallback(Object state)
brianh
#4 Posted : Wednesday, September 19, 2007 8:06:47 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 405
Location: Minnesota
This error was a result of a dependency on version 1.0.0.13 of the update engine within the GAC actions assembly. This dependency prevented proper operation with version 1.0.0.14. The dependency has been removed and the GAC actions reposted. These actions will now operate properly with all released versions of AppLife Update.
Brian Haas
Kinetic Jump Software
jorgerubio
#5 Posted : Wednesday, September 19, 2007 9:11:58 AM
Rank: Advanced Member
Groups: Member

Joined: 9/18/2007
Posts: 31
Thanks mr brian, those new dlls worked great. This is a great application for updating, now i just have one question, could you explain me the ypes of license i could purchase

what are the single user license?
what are the site user licence?

thanks
jorgerubio
#6 Posted : Wednesday, September 19, 2007 3:07:05 PM
Rank: Advanced Member
Groups: Member

Joined: 9/18/2007
Posts: 31
thanks for all the info, i also would like to ask you about how to supress any update dialog, i want to simulate an autoupdate but witout user intervention.

grettings
brianh
#7 Posted : Thursday, September 20, 2007 5:58:12 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 405
Location: Minnesota
jorgerubio,

The featue you need to accomplish a silent update is included in version 1.1. We are on target to release this version by Oct 1st.

When this version is available to you, the ApplyUpdate and UpdateInteractive methods will include an overload that takes an ApplyUpdateOptions parameter that governs the behavior of the update user interface. The options for this flag are:

AutoClose
When the update completes successfully or is canceled, the update window will be automatically closed. This option cannot be specified in combination with NoUpdateWindow, since that option removes the update window entirely. This option only applies to Action List updates.

None
No options are specified; the update window will be shown, the user must click the Close button when the update is complete, and the application will be restarted after the update window is closed.

NoRestart
The application will not be restarted after the update is complete, regardless of whether it succeeded. This option applies to all update types.

NoUpdateWindow
No update window will be shown. This option cannot be specified in combination with AutoClose; since no update window is shown, the update process will end once the update is finished, regardless of whether it succeeded. If the update fails, an entry will be added to the event log describing the failure. This option only applies to Action List updates.

The flag can be OR'd together to combine features.
Brian Haas
Kinetic Jump Software
jorgerubio
#8 Posted : Friday, October 05, 2007 2:35:27 PM
Rank: Advanced Member
Groups: Member

Joined: 9/18/2007
Posts: 31
Hello mr brian, i have another problem that i hope you can help me:

I need to set (in visual studio 2005 installer) two properties for the applife merge module, Path and public key. my situation is, that i have a single program which executes and does all the work for the updating of my BHO, as we discussed, this process does all the work outside of internet explorer.

My problem is that if i want to enable updates of my BHO in a multiuser machine i should place my surrogate executable in a directory where all users have access so they can execute it, i chose c:\program data ( in vista) where all user with a password can access and execute programs.

The problem with this is that there are no visual installer properties that help me out to point to this directory in the target machine

i believe the CommonApplicationData enviroment enum variable in csharp gets the correct path of c:\program data\ but there are no [CommonApplicationData] in visual studio 2005 installer.

I believe my solution would be to put programaticly the PATH in the merge module propertie using custom actions where i could run csharp code, but i don't know how to acomplish this.

Or maybe you could tell me a way i can change the value PATH, once the merge module gets installed correctly in the target machine but with a wrong PATH value, and with a custom action overriding the commit event i could put code to change this value to the correct path of my surrogate exe. Maybe a registry entry? a configuration file?


best regards
brianh
#9 Posted : Saturday, October 06, 2007 5:42:55 AM
Rank: Administration
Groups: Member, Administration

Joined: 5/24/2007
Posts: 405
Location: Minnesota
The variables that are placed in the merge module Path property are actually properties within the MSI database. Within a Visual Studio Setup and Deployment project, determining what property to use in the AppLife Update merge module path is easy enough to find because they are listed as a property of the folders within the project. See the picture below.

So, to set the path to your surogate exe, just select the top most File System Folder in your Setup project and start from that path property to set the merge module path. Add any subdirectories you have defined and end with your hosting executable.

[CommonFilesFolder]Kjs Examples\MyApp.exe

The MSI path properties end with the directory separator, so don't include it or the final path will be wrong.


brianh attached the following image(s):
msmpathproperty.jpg
Brian Haas
Kinetic Jump Software
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.