How to prevent file from being replaced on startup?

  • Thread starter Thread starter DonutMan
  • Start date Start date
D

DonutMan

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
 
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
 
Back
Top