what's wrong

  • Thread starter Thread starter arjen
  • Start date Start date
A

arjen

Hi,

As a try-out I've made a simple Form application that reads times from a xml
file and appends the time of closing to that file. This works fine. The xml
file updates de file-time after using the program. The program and the xml
file have been installed on my computer (Program Files, folder). Still the
application works, but, the file time of the xml file is no longer updated.
I'm using VS 2005 and Windows 7 with Windows Installer. Should this work as
expected or is there something wrong (VS 2005/Windows Installer/Windows
7/me). I've tried to programmatically update the file time, but this does
not work at all. Is there anybody who can give me a hint to come out?

Arjen
 
Hi,

As a try-out I've made a simple Form application that reads times from a
xml file and appends the time of closing to that file. This works fine.
The xml file updates de file-time after using the program. The program and
the xml file have been installed on my computer (Program Files, folder).
Still the application works, but, the file time of the xml file is no
longer updated. I'm using VS 2005 and Windows 7 with Windows Installer.
Should this work as expected or is there something wrong (VS 2005/Windows
Installer/Windows 7/me). I've tried to programmatically update the file
time, but this does not work at all. Is there anybody who can give me a
hint to come out?

Arjen

You have broken MSFT's rules!
You can't write to Program Files in Win7 (or Vista I think), you need to
find a more appropriate place to keep the file - look at
Environment.GetFolderPath in the help file.
 
arjen wrote on 8/2/2010 :
Hi,

As a try-out I've made a simple Form application that reads times from a xml
file and appends the time of closing to that file. This works fine. The xml
file updates de file-time after using the program. The program and the xml
file have been installed on my computer (Program Files, folder). Still the
application works, but, the file time of the xml file is no longer updated.
I'm using VS 2005 and Windows 7 with Windows Installer. Should this work as
expected or is there something wrong (VS 2005/Windows Installer/Windows
7/me). I've tried to programmatically update the file time, but this does not
work at all. Is there anybody who can give me a hint to come out?

Arjen

You can not write to files in the Programs File folder under windows
vista or windows 7. You should be installing your file in the one of
the application data folders -
Environment.SpecialFolder.ApplicationData,
Environment.SpecialFolder.LocalApplicationData, or
Environment.SpecialFolder.CommonApplicationData - depending on how the
data is to be used by your application/users.
 
Back
Top