How to prevent file from being replaced on startup?

Discussion in 'Microsoft Dot NET' started by DonutMan, Aug 15, 2007.

  1. DonutMan

    DonutMan Guest

    I have a setup project that I've created for an application that
    requires a temporary data file to be installed in the root
    installation directory. On application startup, if this data file
    exists in the directory, the application will process the file and
    then rename it so that it does not get processed again the next time
    the application is run. In this manner, data updates are accomplished
    by simply copying a new data file into the installation directory
    instead of having to reinstall the application.

    The problem, of course, is that when the application is launched, the
    Windows Installer mechanism automatically detects that the data file
    is missing and restores the file before actually starting the
    application. Does anyone know the best way to prevent this from
    occurring? Will this happen if I install the data file to a different
    location instead (e.g., the "My Documents" folder?)

    Thanks in advance,
    Mike
     
    DonutMan, Aug 15, 2007
    #1
    1. Advertisements

  2. DonutMan

    Rob Latour Guest

    I don't know what installer you are using; but if your using vs 2005 and the
    default installer try right clicking on the file in the setup project,
    selecting properties and changing vital from true to false.

    Beyond that depending on what your doing once you've processed this file for
    the first time instead of deleting it you can just write a registry entry to
    indicate that you have already processed it. On startup check for the
    registry entry, if its there then your done. This will allow you only do
    whatever your doing once - regardless of the number of installs and
    reinstalls.

    Rob

    "DonutMan" <> wrote in message
    news:...
    >I have a setup project that I've created for an application that
    > requires a temporary data file to be installed in the root
    > installation directory. On application startup, if this data file
    > exists in the directory, the application will process the file and
    > then rename it so that it does not get processed again the next time
    > the application is run. In this manner, data updates are accomplished
    > by simply copying a new data file into the installation directory
    > instead of having to reinstall the application.
    >
    > The problem, of course, is that when the application is launched, the
    > Windows Installer mechanism automatically detects that the data file
    > is missing and restores the file before actually starting the
    > application. Does anyone know the best way to prevent this from
    > occurring? Will this happen if I install the data file to a different
    > location instead (e.g., the "My Documents" folder?)
    >
    > Thanks in advance,
    > Mike
    >
     
    Rob Latour, Sep 15, 2007
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd

    How to prevent some classes from being seen?

    Todd, Oct 10, 2003, in forum: Microsoft Dot NET
    Replies:
    2
    Views:
    120
  2. Ross Pellegrino
    Replies:
    0
    Views:
    220
    Ross Pellegrino
    Jul 24, 2004
  3. Guest
    Replies:
    5
    Views:
    455
    TerryFei
    Feb 10, 2006
  4. Ryan Liu
    Replies:
    3
    Views:
    418
    Cor Ligthert [MVP]
    Mar 6, 2006
  5. Guest
    Replies:
    6
    Views:
    808
    Greg Young
    Oct 10, 2006
Loading...

Share This Page