Re: VB.NET Deployment - Checking for user-modified files

From: David Guyer [MS] (davguy_at_online.microsoft.com)
Date: 02/26/04


Date: Thu, 26 Feb 2004 20:50:38 GMT

Look at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/f
ile_versioning_rules.asp

I think your MDB file would be an unversioned file and so:

Nonversioned Files are User Data—If the Modified date is later than the
Create date for the file on the computer, do not install the file because
user customizations would be deleted. If the Modified and Create dates are
the same, install the file. If the Create date is later than the Modified
date, the file is considered unmodified, install the file.

So, I think you probably get the desired behavior for free. As always test
this stuff carefully before shipping so you don't accidentally clobber a
customer's business data.

---
David Guyer - VBQA Deployment Testing
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "SStory" <TheStorys@TAKEOUTTHISSPAMBUSTERsofthome.net>
>References:  <FECA2F8F-B95D-4808-88DC-D40C1624AFA9@microsoft.com> 
<OhA2Byv#DHA.2040@TK2MSFTNGP12.phx.gbl> 
<4FEB069A-B662-4543-9150-7ECFDBAE3157@microsoft.com> 
<#xfXvGw#DHA.2308@tk2msftngp13.phx.gbl> 
<#E3CBO0#DHA.2072@TK2MSFTNGP11.phx.gbl> 
<618533F6-E898-4503-B1C0-AE781942C35A@microsoft.com>
>Subject: Re: VB.NET Deployment - Checking for user-modified files
>Date: Wed, 25 Feb 2004 19:57:40 -0600
>Lines: 143
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <#Zq$w1A$DHA.3712@tk2msftngp13.phx.gbl>
>Newsgroups: microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: 0-1pool99-60.nas16.nashville1.tn.us.da.qwest.net 
65.144.99.60
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:184806
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb
>
>There may be... I haven't been using it enough to do formal updates yet.
>Simple updates are send them the new exe and they copy over the old one.
>Pretty neat, but...
>
>Maybe if there is a way someone at Microsoft or some other guru will 
respond
>and tell us both.
>Sorry I don't know more.
>
>Shane
>
>"Juggler" <anonymous@discussions.microsoft.com> wrote in message
>news:618533F6-E898-4503-B1C0-AE781942C35A@microsoft.com...
>> I think I'm going to try including the .mdb file with the program, but in
>a sub-folder. The program will check to see if the .mdb file exists where 
it
>should during normal operation, and if it isn't there (i.e. they just
>installed the program), it will copy the .mdb file from the sub-directory
>and put it in the proper place before it calls it for the first time.
>>
>> Hopefully, it will all work out. It still seems silly that there isn't a
>simple setting in vb.net that checks whether or not a file has been 
modified
>since the last version update, and to leave it alone if the user has
>modified it.
>>
>> Juggler
>>
>>      ----- SStory wrote: -----
>>
>>      I like this idea best.
>>
>>      Throw it on the CD... Require them to insert CD first time or
>whatever and
>>      your program checks to see if it is there using
>>      the fileinfo class and then if not copies it from CD to disk..
>>
>>      Seems the easiest although setup may have a way.. I don't know
>>
>>      Shane
>>
>>      "Ot" <uraza@tds.invalid (use net)> wrote in message
>>      news:%23xfXvGw%23DHA.2308@tk2msftngp13.phx.gbl...
>>      > In a similar situation, I did not deliver the default data as part
>of the
>>      > application, but instead built it from the application itself when
>it did
>>      > not exist.  That is, the application itself checks for data
>existing and
>>      > builds the default template that way.  You could include the
>default data
>>      > as an embedded resource and create it where you want when you 
want.
>>      >>> "Juggler" <anonymous@discussions.microsoft.com> wrote in message
>>      > news:4FEB069A-B662-4543-9150-7ECFDBAE3157@microsoft.com...
>>      >> I'm using vb.net 2002.
>>      >>>> When I go to the File System Editor, highlight the file and
>select
>>      > properties, I have the option to adjust:
>>      >>>> - Condition (seems to only check version/processor info on the
>computer
>>      > being installed on)
>>      >> - Exclude (blanket exclude from installation)
>>      >> - Folder (where to install it)
>>      >> - Hidden (is it a hidden file)
>>      >> - PackageAs (not sure what this is for)
>>      >> - Permenent (whether or not to leave it during uninstallation)
>>      >> - ReadOnly (read only)
>>      >> - SharedLegacyFile (this might be it, but I don't really know 
what
>the
>>      > help text is talking about)
>>      >> - SourcePath (file location)
>>      >> - System (is it a system file?)
>>      >> - TargetName (name of file)
>>      >> - Transitive (whether or not the installer should reevaluate the
>>      > Condition property each installation)
>>      >> - Vital (whether a file is vital for installation or not)
>>      >>>> There must be an answer out there. It's like saving a user's
>preferences
>>      > from version to version. Each time I release a new version of the
>program,
>>      > I don't want the users to have to re-enter their info. I can work
>around
>>      > the installation problem with preferences by using a text file for
>the
>>      > user's preferences. When the program loads the splash screen, I
>check for
>>      > the existance of the preferences text file. If it's not there, I
>can
>>      > display a window to the user that asks for their preferences
>information
>>      > (name, whether they want to print in color, etc.), and then write 
a
>text
>>      > file.
>>      >>>> Thanks for any help that can be provided!
>>      >>>> Juggler (@)at sonic (.) net
>>      >>>>      ----- SStory wrote: -----
>>      >>>>      Well, I assume you are upgrading using a setup in vb.net
>2003?
>>      >>>>      If so isn't there a property for the file whatever.mdb to
>not
>>      > overwrite?
>>      >>>>      Of course from within VB.NET you have the
>system.io.fileinfo class
>>      > to get
>>      >>      information on files... but that doesn't seem that it would
>do much
>>      > good as
>>      >>      far as setup goes.
>>      >>>>      Check to see if you can't highlight the .MDB file in the
>setup and
>>      > click
>>      >>      properties and set to not overwrite.  don't have the IDE 
open
>at
>>      > present but
>>      >>      that is where I would look.
>>      >>>>      HTH,
>>      >>>>      Shane
>>      >>>>      "Juggler" <anonymous@discussions.microsoft.com> wrote in
>message
>>      >>      news:FECA2F8F-B95D-4808-88DC-D40C1624AFA9@microsoft.com...
>>      >>> Hi all,
>>      >>>> I've written a program in VB.NET that allows the user to build
>>      > quotes for
>>      >>      installing shower enclosures. As part of the program, I've
>included
>>      > a blank
>>      >>      Access database. I've provided them with an interface where
>they
>>      can
>>      > add
>>      >>      their own clients to the database.
>>      >>>> When the user upgrades to a newer version of my program, I 
don't
>>      > want the
>>      >>      installer to overwrite the Access database file with my 
blank
>one
>>      > again. How
>>      >>      can I tell VB.NET to check to see if the file has been
>modified,
>>      and
>>      > if so,
>>      >>      not to overwrite it?
>>      >>>> Many thanks,
>>      >>>> Juggler at(@) sonic dot(.) net
>>      >>>>>>>>
>
>
>


Relevant Pages

  • Re: Method ~ of object ~ failed error while opening ADODB connection in vb6
    ... the MDAC or Jet installation is "corrupt" (anything from incorrect ... if using Vista - you can't install the MDAC as it already comes ... ActiveX Data Objects 2.7 library", ... Perhaps the mdb file is corrupt. ...
    (microsoft.public.vb.database)
  • Re: How to get table names from ms access(mdb file) by using odbc library.
    ... engine installed by default (thus you don't need to install anything on a ... windows computer to read mdb files. ... Set dbeng = CreateObject ... So there is a table collection available after you open the mdb file as per ...
    (comp.databases.ms-access)
  • Re: Error created linked tables from one .mdb to another .mdb
    ... > tables to SQL Server tables in my .mdb file. ... > the strConnect parameter to connect to the other .mdb file that it would ... > link properly but it fails with this messagebox message popping up: ... Sounds like you may need to install the Jet OLE DB provider on the target ...
    (microsoft.public.vb.general.discussion)
  • Re: vba problem
    ... Sounds like you got some problem with your computer (setup, or install), or ... some damage has occurred to your mdb file. ... Edmonton, Alberta Canada ...
    (microsoft.public.access.formscoding)
  • Re: Overwrite the O/S ?
    ... > Can I overwrite O/S, AIX 4.3.3 using the preservation option when I do a ... 'preservation install' is misleading. ... You might fake the pad string to make the install ...
    (comp.unix.aix)