Windows 7 and Keystone: Difference between revisions

From KeystoneIntranet
Jump to navigation Jump to search
Intra>Chanson
 
m (1 revision imported)
 
(No difference)

Latest revision as of 13:00, 14 July 2023

Windows 7 (and Vista/2008) System File Protection

Windows 7 (and Vista/2008) implemented a new feature called “System File Protection.” This is supposed to prevent an application from writing to any file in the C:\Program Files directory or below. It also comes with a workaround which is meant to accommodate older Windows applications that need to write to this folder. If an older Windows application (which Windows sees Keystone as) writes to a file in C:\Program Files, Windows 7 creates a “virtual” folder under C:\Users\<username>\AppData\Local\VirtualStore\Program Files and stores the changed version of the file there. If the older application opens the file, Windows knows to redirect the file request to the “virtual” folder and the application works normally. So far, so good.

Now suppose that we use an older Windows program (such as Craig's IB2CDS utility which allows direct editing of the new CDS files in the BIN\RESOURCES folder) to change a file under C:\Program Files\GivenHansco\CC. When we save the file, it gets saved into the “virtual” folder, leaving the original version of the file (under C:\Program Files\GivenHansco\CC) intact. Keystone will see the virtual folder version of the file. So far, so good. (Note that Windows NOTEPAD understands system file protection and will simply not allow the file to be saved back under C:\Program Files unless it was run as administrator.)

Now a week later we install a new Keystone update. This update happens to include a new version of the file that we manually changed, and we expect this new version to overwrite our changes. Windows 7 has the ability to detect that the Keystone update is a “setup” type program, and will turn off the “virtual” folder logic. Thus the update installs the new version of the file into the original folder under C:\Program Files\GivenHansco\CC. The version with our manual changes still exists in the “virtual” folder. The next time we run Keystone, it will see the “virtual” folder version of the file, not the updated one that the update installed. And therein lies the problem.

Most of the time, the files that we have to manually edit are under the C:\Program Files\GivenHansco\CC\Cust directory. Since the installer never puts any files into this folder, the problem above does not occur. Recently we added a new folder under the BIN directory called RESOURCES to store some files needed by the Payroll Year End Modifications program. There are cases where these files may need to be manually edited on a customer’s system to accommodate their specific payroll configuration. Since the installer writes to this folder and we may have to manually edit these files, we will encounter the Windows 7 file protection issue.

There is another potential issue that also affects certain files in the C:\Program Files\GivenHansco\CC\Cust directory. If a user has multiple Windows logins setup on their PC (perhaps the PC is shared by two people who work different schedules) only one user (the one logged in at the time the Keystone databases were created) will have access to these configuration files. When the other user logs in, Keystone will not see the files and may display the Product Activation dialog.

A temporary workaround procedure is as follows:

  • On Windows Vista/7, when running Keystone for the first time (product activation), right click the Keystone icon and choose Run As Administrator. This will ensure that Keystone places all its configuration files into the real C:\Program Files directory.
  • When editing any file in the C:\Program Files\GivenHansco\CC folder or below, always right-click the application that will be used to edit the file and select Run As Administrator. This will ensure that the changes are saved back to the real C:\Program Files directory.

A permanent solution to this issue involves changing the folder where Keystone configuration and data files are stored. This is being investigated for inclusion in a future release.

(Here is a link to a Wikipedia entry that describes this behavior in the second paragraph of the Features section.)


Here is an old page with Windows Vista notes that are obsolete:

Windows Vista and CompuCrete Notes