[AccessD] Automatic Update Function
Janet Erbach
jerbach.db at gmail.com
Tue Mar 10 11:58:03 CDT 2015
Ok. Thank you. I'm side tracked again by corruption issues, so will
re-visit the FE Update issue again when I have time to study.
On Tue, Mar 10, 2015 at 11:53 AM, David McAfee <davidmcafee at gmail.com>
wrote:
> I didn't see the VB script that was provided.
>
> The two are different languages.
>
> It's kind of like comparing Javascript to Java.
>
> VB script isn't a software that you install, like javascript it is a script
> that you write in something like notepad, it isn't compiled.
>
> VB.Net will require Visual Studio to compile the code into an executable
> that you can run.
>
> D
>
> On Tue, Mar 10, 2015 at 7:24 AM, Janet Erbach <jerbach.db at gmail.com>
> wrote:
>
> > David -
> >
> > I'm re-visiting your code because I'm having some problems with the vb
> > script I downloaded from ThatllDoIt.com. I know VERY little about vb - I
> > can understand the code, but that's about it. Your script is VB.Net -
> what
> > is the difference between that and a vbs script?
> >
> > Thanks.
> >
> > Janet
> >
> > On Tue, Mar 3, 2015 at 12:31 PM, David McAfee <davidmcafee at gmail.com>
> > wrote:
> >
> > > Here's the old, VB.net version that I used for years (I also have a C#
> > > version if you prefer that)
> > >
> > > I basically name an .mdb/.adp something like MyDatabase126.mdb
> > > I create a text file and save it as the appName.ini (not .txt)
> > >
> > > I create two lines in the ini file:
> > >
> > > LatestVersion:MyDatabase126.mdb
> > > DeleteVersion:MyDatabase11*.mdb
> > >
> > >
> > > They launch the exe, which cecks to see if they already have the latest
> > > version on their computer, if not, copy it over.
> > > I use the wild card * on the delete version (rather than
> > MyDatabase125.mdb)
> > > because a user might be out for a week or two and maybe you had several
> > > versions released.
> > >
> > > If you always want to copy the file over rather than check if the file
> is
> > > different, comment the third IF statement.
> > >
> > > It makes it real nice at work to deploy an adp/mdb to a user, even a
> new
> > > user.
> > > Just copy the .exe to their desktop and let them run it.
> > >
> > > It also keeps the honest people honest. They are launching an exe, not
> an
> > > mdb, so there isn't an mdb they can copy.
> > > If you have an icon for the exe, a splash screen for the mdb and do the
> > > shift start prevention, they might not even know that they are running
> an
> > > access mdb.
> > > It copies the mdb over to their local app data folder, so unless they
> > know
> > > where to look, they won't find it.
> > > As long as they have rights to the shared folder and don't have to have
> > it
> > > mapped, they wont know where the source files are.
> > > They would need to have Access already installed.
> > >
> > > Anyway, here is my launcher:
> > >
> > >
> > >
> > >
> > > Imports System.IO
> > > Imports System.Environment
> > >
> > > Module Module1
> > > Sub Main()
> > > Dim OldVersion As String = ""
> > > Dim NewVersion As String = ""
> > > Dim AppName As String = ""
> > > Dim NetPath As String =
> > > "\\YourServerNameHere\YourSharedFolderHere$\" + AppName + "\"
> > > Dim iniFileName As String = AppName + ".ini"
> > > Dim LocPath As String =
> > >
> > >
> >
> System.Environment.GetFolderPath(SpecialFolder.LocalApplicationData).ToString
> > > + "\YourCompanyNameHere\" + AppName + "\"
> > > 'Open ini file and read it, to get new version name:
> > > Dim oRead As System.IO.StreamReader
> > > Dim LineIn As String
> > > oRead = File.OpenText(NetPath + iniFileName)
> > > While oRead.Peek <> -1
> > > LineIn = oRead.ReadLine()
> > > If Left(LineIn, 14) = "LatestVersion:" Then
> > > NewVersion = Right(LineIn, LineIn.Length - 14)
> > > ElseIf Left(LineIn, 14) = "DeleteVersion:" Then
> > > OldVersion = Right(LineIn, LineIn.Length - 14)
> > > Else
> > > LineIn = ""
> > > End If
> > > End While
> > > oRead.Close()
> > >
> > > If Directory.Exists(NetPath) Then 'If the network path exists,
> > > continue with the local path checks
> > > If Directory.Exists(LocPath) Then 'if the local path exists
> > > then check for the actual file
> > > If Not File.Exists(LocPath + NewVersion) Then 'Check to
> > see
> > > if the new file is already installed
> > > File.Copy(NetPath + NewVersion, LocPath +
> NewVersion)
> > > 'If NOT, copy the file :)
> > > End If
> > > Else 'Directory did not exist, so create it and copy new
> file
> > > over
> > > Directory.CreateDirectory(LocPath)
> > > File.Copy(NetPath + NewVersion, LocPath + NewVersion)
> > > End If
> > >
> > > 'If the new file exists on local computer, start the new
> > > version on the local PC
> > > 'The IF statement is just added security, there really
> > > shouldn't be a reason for it not to exist at this point
> > > If File.Exists(LocPath + NewVersion) Then
> > > System.Diagnostics.Process.Start(LocPath + NewVersion)
> > > 'Start the file
> > >
> > > If OldVersion <> "" Then 'Delete old file(s)
> > > For Each FileFound As String In
> > > Directory.GetFiles(LocPath, OldVersion)
> > > File.Delete(FileFound)
> > > Next
> > > End If
> > > Else
> > > 'If not found, alert the user
> > > MsgBox("Cannot find " & LocPath & NewVersion & ".",
> > > vbOKOnly, "unable to start " + AppName)
> > > End If
> > >
> > >
> > > Else 'The network path was unavailable, so alert the user
> > > MsgBox("Network path: " + NetPath + " is unavailable", ,
> > > "Unable to start " + AppName)
> > > End If
> > > End Sub
> > > End Module
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > http://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list