PC Review


Reply
Thread Tools Rate Thread

How to prevent file from being replaced on startup?

 
 
DonutMan
Guest
Posts: n/a
 
      15th Aug 2007
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

 
Reply With Quote
 
 
 
 
Rob Latour
Guest
Posts: n/a
 
      15th Sep 2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent file from being replaced on startup? DonutMan Microsoft C# .NET 4 16th Oct 2007 08:10 AM
Accidently replaced a spreadsheet that I did not want replaced =?Utf-8?B?VA==?= Microsoft Excel Misc 2 28th Jun 2007 04:52 PM
prevent an image from being deleted or replaced andyc Microsoft Excel Misc 4 8th Apr 2007 06:48 AM
How to prevent double-slashes in URLs from being replaced? =?Utf-8?B?QmVuamFtaW4gSmFuZWNrZQ==?= Microsoft Dot NET 6 10th Oct 2006 05:29 AM
How do I prevent text from being replaced as I type? =?Utf-8?B?dHI=?= Microsoft Word Document Management 3 9th Nov 2004 11:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:38 AM.