RBS Interferes with AppLifeUpdate

Author Message
 Posted 5/5/2014 11:48:28 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807

I thought I’d post this just in case someone else runs thesame issue. Our shop uses AppLifeUpdate with a custom login form to update ourWindows applications. We had been doing so for a long time but recently updateson our Windows XP machines began to abort with an unhandled exception.  Debug showed that AppLifeUpdatehad failed to close the host application. After some more trouble shooting Ifound that StrataFrame sessionlock is somehow interfering with AppLifeUpdate’sability to close the host application. I’m not sure if it started with SF1.7.7.1 or some Windows update. In any event stopping session monitoring priorto performing an update fixes the problem and session monitoring can then berestarted after the update. On Windows 7 machines leaving session monitoringactive during an update sometimes results in application terminated abnormally messages,but the update continues after closing the error message windows. Turing offsession monitoring eliminates the error messages. I didn’t do any additionaltrouble shooting to try and find the root cause but the environment was VS2010,VB .Net targeting the 4.0 framework, SF1.7.7.1, and AppLifeUpdate 5.0, Windows XP SP3 32-Bit and Windows 7 SP1 64-Bit.

-Larry



Tags:
Post #32536
Add to Twitter Add to Facebook
 Posted 5/5/2014 2:49:01 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 9/16/2020 2:34:25 AM
Posts: 2,433, Visits: 24,073
Hi Larry,

Thanks for sharing this information.  I have been having sort of the same issue but only with my applications being updated on Windows Server 2012R2.  I don't think I have any customer using Windows XP, so did not worry too much.

I use .Net 4.5, VB and SF 1.7.7.1 with VS2013.  I will try your suggestion in the next week or so which I need to release an update and see if that fix the issue on Windows Server 2012 R2.

Thanks again!!!


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)
Post #32537
Add to Twitter Add to Facebook
 Posted 5/7/2014 3:46:30 AM
StrataFrame Developer

StrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame DeveloperStrataFrame Developer

Group: StrataFrame Developers
Last Login: 5/16/2018 3:20:37 AM
Posts: 2,982, Visits: 2,482
Good info, Larry, thanks.  We add a low-level windows message hook into the application to detect any mouse movement or keyboard input in order to reset the session inactivity timer.  It's possible that there was some sort of message we handled incorrectly or something else about that hook that's killing the application when you try to update it.
Post #32542
Add to Twitter Add to Facebook
 Posted 10/18/2014 1:45:02 PM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 9/16/2020 2:34:25 AM
Posts: 2,433, Visits: 24,073
Hi Larry,

I tried your solution, but still on some Windows 2012R2 I keep getting issues with the application not shutting down properly.

Where specifically are you putting that code? 

I have 2 places where an AppLifeUpdate can be done in my applications:
  1. In my main form, I have an UpdateController instance and I am stopping the session monitoring in the Updatestarting() event.
  2. In AppMain.vb I have a method that will instantiate a new UpdateController and if an update is found I am stopping the session monitoring.


Code in AppMain.vb:

'-------------------------------------------------------------------------------
'-- Check if there is an update available for the application.
'-------------------------------------------------------------------------------
With UpdateController
Try
frmSplashScreen.SetMessage("Please wait, checking for updates...")
      If .CheckForUpdate() Then
         '-- 5/6/2014: There is an issue reported by Larry Caylor at the SF forum in which he discovered that AppLifeUpdate could not closed
         '   the application properly before applying an update.
         '   http://forum.strataframe.net/FindPost32536.aspx
         SessionLock.StopSessionMonitoring()
         frmSplashScreen.HideSplash()
         UpdateController.UpdateInteractive()
    Else
        Basics.DisplayMessage("Application Version Error""Sorry no update was found, please contact Progytech at www.progytech.com")
    End If
    Catch DownloadEx As Kjs.AppLife.Update.Controller.DownloadException
        SendErrorMessageViaEmail(DownloadEx)
    Catch ex As Exception
        SendErrorMessageViaEmail(ex)
    End Try
End With




Private Sub UpdateController1_UpdateStarting(sender As Object, e As Kjs.AppLife.Update.Controller.UpdateStartingEventArgsHandles UpdateController1.UpdateStarting
     If (Not e.IsInitiatingController) Then
         '-- 5/6/2014: There is an issue reported by Larry Caylor at the SF forum in which he discovered that AppLifeUpdate could not closed
         '   the application properly before applying an update.
         '   http://forum.strataframe.net/FindPost32536.aspx
         SessionLock.StopSessionMonitoring()
    End If
End Sub



Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)
Post #32717
Add to Twitter Add to Facebook
 Posted 10/19/2014 12:40:51 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Hi Edhy.

See if this one has anything to do with it:

http://forum.strataframe.net/FindPost31637.aspx

Abraços.

Ivan
Post #32718
Add to Twitter Add to Facebook
 Posted 10/19/2014 11:19:53 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 9/16/2020 2:34:25 AM
Posts: 2,433, Visits: 24,073
Hi Ivan,

Thanks a lot for sharing this, definitely this solved my issue.
Adding this code to stop the Session Monitoring right after the RunApplication line in your AppMain.vb / Program.cs fixed.

        '-- Run the application
        StrataFrameApplication.RunApplication()

        '-- stop SessionLock Monitoring to avoid error on exit on Windows 8
        SessionLock.StopSessionMonitoring()


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)
Post #32719
Add to Twitter Add to Facebook
 Posted 10/20/2014 1:03:58 AM
Strategic Support Team Member

Strategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team MemberStrategic Support Team Member

Group: StrataFrame MVPs
Last Login: 6/15/2019 1:08:46 AM
Posts: 1,920, Visits: 21,109
Glad it helped, Edhy! Cool
Post #32720
Add to Twitter Add to Facebook
 Posted 10/20/2014 2:42:41 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
Hi Edhy

Just saw your post and glad you got it working. My applications use a custom login form where I've added the AppLife code.  I shut down session lock before displaying the login form and start it back up in the load event of my main form.  


-Larry

 


Edited: 10/20/2014 2:45:51 AM by Larry Caylor
Post #32721
Add to Twitter Add to Facebook
 Posted 10/20/2014 2:56:59 AM
StrataFrame VIP

StrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIPStrataFrame VIP

Group: StrataFrame Users
Last Login: 9/16/2020 2:34:25 AM
Posts: 2,433, Visits: 24,073
Hi Larry,

Larry Caylor (10/20/2014)
My applications use a custom login form where I've added the AppLife code.  I shut down session lock before displaying the login form and start it back up in the load event of my main form.


Thanks for the explanation.  I also use a custom login, but I handle updates in 2 places:
  1. In the AppMain.vb which has logic to check for update prior to allow anybody to login, this way if one workstation has updated, then all other must be updated to the same version to avoid issues with data structure changes, etc.
  2. In the Main form where it will allow users to check for update and install the update at will.
In any case stopping the session monitoring in the AppMain.vb as suggested by Ivan fix the issue.  I only seen this issue in Windows Server 2012R2 not in Windows 8.1, but at any rate, I am glad it is fixed.


Edhy Rijo
(Using VB.Net 2019/SQL Server 2017)
Post #32722
Add to Twitter Add to Facebook
 Posted 10/20/2014 3:28:32 AM
Advanced StrataFrame User

Advanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame UserAdvanced StrataFrame User

Group: Awaiting Activation
Last Login: 3/2/2020 12:19:05 PM
Posts: 595, Visits: 3,807
Edhy,

It's funny, the post Ivan referred you to didn't solve my AppLife issue. I've had that piece of code in place for years since I had run into a similar issue http://forum.strataframe.net/Topic4465.aspx?Keywords=exit#bm4570. In my environment I had to shut down session lock prior to executing the AppLife code that shuts down the application.

 -Larry
Post #32723
Add to Twitter Add to Facebook


Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.