We have two applications.
- Main.exe – which is the main application being updated
- Update.exe – the program that runs to update Main.exe
My problem is preventing users from getting into the main.exe while updating.
Right now, I am checking for a flag file and if the flag file exists, application.exe immediately.
This is fine except it doesn’t tell the user anything, just kicks them out.
I were to issue a message, the time that it takes for them to respond to the message, the main.exe is in use and cannot be updated.
Any suggestions how I can professionally display a message that the update is in progress, application closing?
btw, I thought about using:
Private Function IsUpdatingPropane() As Boolean
Try
Dim UpdateInprocess As String = My.Computer.FileSystem.GetParentPath(Application.StartupPath) & "\update.inprocess"
If File.Exists(UpdateInprocess) Then
'Dim Proc As Process
'Dim ProcInfo As New ProcessStartInfo(Configuration.DataFileLocations & Configuration.GasLibrary & "\vbmsg.exe")
'ProcInfo.Arguments = String.Format("vbmsg.txt,{0},{1},NIL,NIL,NIL,OK,9996,9997", Configuration.UserId, Configuration.WorkstationId)
'ProcInfo.WindowStyle = ProcessWindowStyle.Normal
'ProcInfo.WorkingDirectory = Configuration.DataFileLocations & Configuration.GasLibrary
'ProcInfo.UseShellExecute = False
'Proc = Process.Start(ProcInfo)
Application.Exit()
Return True
End If
Return False
Catch ex As Exception
WriteException(ex)
WriteDebugInfo("VerifyNotUpdatingPropane", "An error occurred while checking for update.inprocess file. Please contact SSS for assistance.", True, ex)
Return True
End Try
End Function
but what do I call to display the message?
Thanks in advance!
Considering the data we have
On update request from
Main.exetheMain.exelaunchesUpdater.exeend kills itself.Updater.exedoes it stuff. To resolving notification problem in case when user clicks onMain.exeagain you can, for example, launch the second instance ofUpdater.exewith some special parameter, which actualy diplays a message and exit fromMain.exe. In this case even if user will not close the notification dialog box for a while (cofee pause), you will have contemporary in memory 2 instances ofUpdater.exe. One is updating, the second simply shows the message and one time message closed leaves the memory.In short, move message visualization inside
Updater.exeitself, which appears only in case of presence of special command line parameter.Hope this helps.