Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Self Updating App question 1

Status
Not open for further replies.

Becks25Not

Programmer
Jun 23, 2004
176
US
Hi All,

I read on here a while ago about a developer that wrote an app that check against a newtork copy, and if there is a newer version, copies the new version down and restarts itself ... Does anyone know how this is done?

Thanks,
Becca
 
this is how I do it. I have a table in my database with one field and row in it. Being the current version.

Code:
Dim reaTemp As SqlDataReader
        Dim intQuestion As Integer

        Me.lblMessages.Text = "Begin Check for updates"
        datTime = datTimeLaps
        reaTemp = Docmd.FillDataReader("SELECT versionnumber FROM dbo.[tbl_versionnumber]", Docmd.Databases.General)
        reaTemp.Read()
        strTemp = reaTemp.GetValue(0)
        reaTemp.Close()
        If Me.lblversion.Text.Trim <> strTemp.Trim And strTemp.Length > 0 Then
            Select Case Language.strlanguage
                Case "nl"
                    intQuestion = MessageBox.Show("Er is een nieuwere versie gevonden van de Tex databases, wilt u die nu installeren? alle openstaande databases zullen worden gesloten, vergeet niet te saven.", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                Case "fr"
                    intQuestion = MessageBox.Show("Une version plus récente est disponible, souhaitez-vous l'installer maintenant? Toutes les bases de données ouvertes seront fermées automatiquement, veuillez sauver vos données avant de lancer l'installation!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                Case "en"
                    intQuestion = MessageBox.Show("There is a newer version available, do you want to install it now? All open databases will be closed automatically. Don't forget to save!", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
            End Select
            If intQuestion = 6 Then
                Dim proTemp As New System.Diagnostics.Process
                proTemp.StartInfo.FileName = "s:\setup.exe"
                proTemp.Start()
                proTemp.WaitForExit(100000)
                proTemp.StartInfo.FileName = Application.StartupPath & "\tex databases.exe"
                proTemp.Start()
                Me.Close()
            End If
        End If
        Me.lblMessages.Text = "End Check for Updates"
        Me.Local_Update_Thread = Nothing

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Thanks Chrissie! I thought it was you that posted it. :)
 
Chrissie, question for you, how would you go about dynamicly checking the versions of each .Net reference in the app?

For example, my portal app may not get updated, but I could have a module that has been updated. Know any cool reflection tricks to get the dependency version at runtime?

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
I found it :)

Code:
Dim m_assembly As [Assembly] = Me.GetType.Assembly
Dim an As AssemblyName

For Each an In m_assembly.GetReferencedAssemblies()
  Debug.WriteLine(an.Name.ToString & "  " & an.Version.ToString)
Next

Sooo close, now if I can just beat managment into submission, it would make deployements so much easier.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
or just wait for 2.0 and clickonce.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
I just switched companies and am actually re-working the migration plan from VB6 and Access to .NET (hence all the questions of late). I am trying to make my second deployment methology and framework better then my first!!
 
I hear ya! If I had known 9 months ago, the things I know now... wow, what a different situation I'd be in. But luckily, everything I'm learning is getting applied right back into the next build and projects.

-Rick

VB.Net Forum forum796 forum855 ASP.NET Forum
[monkey]I believe in killer coding ninja monkeys.[monkey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top