Shell Folder handling in a RES PowerFuse session
Introduction
The way in which users’s Desktop, Start menu and Quick Launch folders are handled has been redesigned in RES PowerFuse 2008 SR5.
Users’ Desktop, Start menu and Quick Launch folders require careful handling by RES PowerFuse in sessions using the Windows shell. RES PowerFuse must take into account that these folders can contain items that were created prior to the RES PowerFuse session, and which should not be made visible in the RES PowerFuse session.
Before SR5, RES PowerFuse copied such items to special folders when the session started, and when the session logged off this action was reversed. However, this method had some drawbacks.
This article explains the old design, the reasons why it had to change, and the new design introduced in RES PowerFuse 2008 SR5. It also explains what happens when you upgrade from a previous release to SR5.
The old design: how Shell folders were handled before RES PowerFuse 2008 SR5, and why this had to change
At the start of a RES PowerFuse session
When a RES PowerFuse session was started with the Windows shell, the RES PowerFuse Workspace Manager automatically set up the the \startmenu, \desktop and \quicklaunch folders by:
- creating 3 new folders with the extension .org (for example \startmenu.org).
- copying all existing items in the main folder to the matching .org folder.
- deleting the contents of the main folders.
- copying the contents of any existing .res folder to the main folder and then deleting the .res folders (only for desktop and quick launch items).
- creating 3 new folders with the extension .tmp.
The .tmp folders were used to prepare the contents of the folders based on all the user’s settings in RES PowerFuse. When this was ready, the contents of the .tmp folder was copied to the original folder, thus providing the user with a start menu, desktop and quick launch that contained all the items managed by RES PowerFuse.
Note: by “main folder” I mean the original \startmenu, \desktop or \quicklaunch folder.
At the end of a RES PowerFuse session
At logoff (or shutdown), the actions were reversed. RES PowerFuse also had to handle any items that the user placed on his \desktop in his \quicklaunch folder during the session, such as documents or shortcuts.
At the end of the session, the RES PowerFuse Workspace Manager:
- deleted the .tmp folders.
- created a folder with the extension .res for \desktop and \quicklaunch.
- copied all non-RES PowerFuse items (such as documents posted on the desktop by the User) to the .res folder.
- deleted the contents of the main folders.
- copied all items in the .org folders back to the main folder
- deleted the .org folders.
This method resulted in a correct environment for the user after the session was logged off correctly. New or managed desktop or quicklaunch items were not visible when the user logged on to the desktop without RES PowerFuse (because they were saved in the .res folder).
Issues with the old design
There were a number of flaws in the old approach to Shell folders:
- Copying took a long time if there were large files.
- Users could run out of diskquota during the copy operation.
- If a user preference was defined which placed files on the desktop, these files ended up in the .org folder and were therefore not visible in the session.
- If a session was not logged off properly, for example due to a system crash or a session reset, non-RES PowerFuse items were lost and the user’s folders left in an undefined state.
- The fact that items could be lost was a particular concern, but the performance impact of large files also needed to be solved.
The new design introduced in RES PowerFuse 2008 SR5, and why this is better
RES PowerFuse 2008 SR5 solves the issues by:
moving files instead of copying them.
improving the integration of the contents of the user’s main folders which exists outside
the RES PowerFuse session with the RES PowerFuse session.
improving the way in which information is recovered if a session was not logged off
properly, so that no action is required from the user.
At the start of a RES PowerFuse session
When a RES PowerFuse session is started with the Windows shell, the RES PowerFuse Workspace Manager first checks for the existence of .mslinks folders for each of the 3 main folders.
A normal, correct log off does not leave any.mslinks folders behind, so if no .mslinks folders are found the Workspace Manager follows the regular procedure. This consists of:
create the .mslinks folders (for example \desktop.mslinks)
move the contents of the start menu folder to the startmenu.mslinks folder
move shortcuts (.lnk files) that point to executables (.exe or .com) from the desktop and
quick launch folders to the .mslinks folders. NB: Shortcuts that point to pwrgate.exe are
not moved.
An incorrect logoff will leave .mslinks folders behind, so if it finds any .mslinks folders when the session starts the Workspace Manager executes a different procedure:
instead of creating new .mslinks folders, only move the contents of the start menu folder to the startmenu.mslinks folder.
move shortcuts (.lnk files) that point to executables (.exe or .com) from the desktop and quick launch folders to the .mslinks folders. NB: Shortcuts that point to pwrgate.exe are not moved.
remove any existing shortcuts to pwrgate.exe, because these were left by a session that
did not end properly.
create .tmp folders from which to prepare the user’s Desktop, Start menu and Quick Launch in the same way as was done pre-SR5
delete the above-mentioned .tmp folders.
At the end of a RES PowerFuse session
At the end of the session, the RES PowerFuse Workspace Manager:
removes all shortcuts (.lnk files) that point to pwrgate.exe from the main folders
moves the contents of the .mslinks folders back to the main folders
deletes the .mslinks folders.
Why this is better
The new design is a major improvement, first of all because it moves files instead of copying them. This prevents the performance impact and the disk quota issues. Also, this method has a much better integration between non-RES PowerFuse items and RES PowerFuse items. For instance, if a user copies a document to the desktop, it will remains visible within and outside of the RES PowerFuse session.
Also, the way the .mslinks folder are handled ensures that the user can recover from a session which was not logged off properly. Any remaining RES PowerFuse shortcuts are removed automatically when a new RES PowerFuse session starts, and any content left in the .mslinks folder will be restored once the user logs on and off again. No files are ever lost.
What happens during an upgrade: the lost+found folders
Under normal conditions, no special actions are needed after installing RES PowerFuse 2008 SR5. New sessions will automatically use the new method for the shell folders.
However, in situations where .res folders from the ‘old’ method still exist and contain items, these are preserved in a manner that allows their recovery. If the RES PowerFuse Workspace Manager finds such folders when a session is started, then RES PowerFuse:
If the old .res folder contained files that users wish to recover after the upgrade, then the files can be found in the lost+found folder and should be restored to the main folder.
This only applies only to the desktop and quick launch folders. The Start menu folder never has a .res folder.
Summary
The new method of handling the user’s shell folders is a major improvement, and solves quite a few long standing problems of data integrity and performance. The behavior of non-RES PowerFuse items is a little bit different, so please be aware that users may have a desktop or quicklaunch which differs slightly from previous RES PowerFuse versions.
thanks to Ton and Alex for the technical input and the review of the blog