epmoyer
Joined: 12 Oct 2007 Posts: 1
|
Vista file inconsistency/install woes, and how to fix them |
Posted: Fri Oct 12, 2007 2:49 pm |
|
|
In its current implementation the CCS compiler suite, running on Vista, can (and generally will) exhibit behavior where the .c / .h source files you edit within the IDE do not appear when you browse to C:/Program Files/PICC/Examples (or …/Drivers, or whatever). This happens because under Windows Vista, the OS protects access to the C:/Program Files directory. By default applications (like Ccsc.exe) do not run in administrative mode, even though you may be logging into (or have installed using) an account with administrative privileges. When the app tries to edit a file in C:/Program Files/PICC/Examples (for example), Vista “Protects” the access by creating the new (changed) file in C:\Users\<YOUR_USER_NAME>\AppData\Local\VirtualStore\Program Files\PICC\Examples\...<whatever> instead.
This can result in some rather dreadful consequences such as:
1) You can browse to a file in C:\Program Files\PICC within the IDE’s file explorer and the file you open WILL NOT MATCH the one you see if you browse to the same location using Windows Explorer (presuming you have edited the file in the IDE).
2) You can totally uninstall the compiler, delete the C:\Program Files\PICC directory, reinstall the compiler, and have “ghost” old copies of your files override the new ones whenever the compiler goes looking for them.
3) You can upgrade to a new version of the compiler and files which should have been overwritten by the installer may be superseded at runtime by old copies in the Virtual Store.
The root problem is that under Vista applications simply should not be storing user content under C:\Program Files, and the CCS tools violate that paradigm.
I experimented with several fixes. If you are very diligent and want to do a whole lot of manual clicking you can install the tools to C:\Program Files\PICC as usual and then (before running them) manually open the “Properties” dialog on each .exe, go to the “Compatibility” tab, and check the “Run this program as an administrator” box. If you accidentally miss one you’ll open the door for madness, because files will be created in the Virtual Store even if you start the compiler and close it without doing work.
A better fix (in my opinion) is to
1) Archive your old files if you have any, making sure to note that some of them may be in C:\Users\<YOUR_USER_NAME>\AppData\Local\VirtualStore\Program Files\PICC\...
2) Run uninstall.
3) Delete C:/Program Files/PICC and delete C:\Users\<YOUR_USER_NAME>\AppData\Local\VirtualStore\Program Files\PICC
4) Create a C:\Program Files (Unmanaged)\PICC directory.
5) Reinstall the tools, and when prompted for the install directory use C:\Program Files (Unmanaged)\PICC.
Yes, this method does fly in the face of the “security” Vista is trying so hard to provide (the new C:\Program Files (Unmanaged)\... directory will not be treated specially by Vista, and any application can write to it without having admin privileges), BUT when faced with apps that do not yet adhere to the new Vista paradigm this method provides a way to temporarily avoid some pretty frustrating pitfalls until a newer Vista-friendlier version is released. |
|