Writing Your Own Settings Packages
Kaseya's User State Management solution is made up of two parts: an engine for capturing user states, and a large set of settings packages that define what state to move. There is a settings package for power management settings, another for Word settings, another for mouse settings, and so on. Each of these settings packages tells the engine what to capture, and lets the engine take care of the details of how to do it.
Setting packages use a declarative language to specify what settings they contain. This language is an XML dialect, and is easy to edit using whatever text editor you favor.
A basic settings package looks like this:
<Package Category="Examples" Name="Pinball"
Type="Application" Platforms="Windows" Version="1">
<Description>
Migrates the music setting in the Pinball game.
</Description>
<Find>
<Name>pinball.exe</Name>
<Location Type="file" File="%programfiles%\Windows NT\Pinball\PINBALL.EXE" />
</Find>
<Component>
<Setting Name="Music" Type="boolean">
<Location Type="registry" DataType="dword">
HKCU\Software\Microsoft\Plus!\Pinball\Music
</Location>
</Setting>
</Component>
</Package>
Finding the Settings
In order for you to migrate anything, you need to know where the settings are stored. Here are a few of the tools we us to accomplish this and how we use them.
- Regedit - This is a great tool because it's shipped with the OS, so there's nothing to install. It lets you explore the registry and see how exactly the application modifies the values there. You can export registry keys that you're interested in, make the appropriate changes, and then compare the exported file to the current values. Note that many applications only write changes to the registry when they're shutting down.
- RegMon - When you want to monitor a single setting in the registry, try Microsoft's RegMon. This allows you to see live registry events as they happen, but it can be very noisy. Use filtersthe little funnel at the topto cut down on the volume of information.
- FileMon - What RegMon does for the registry, FileMon does for files. It has a lot of the same issues with noise, so you should use a very similar filtering technique: only show access from the application you're working with.
Variables
There are myriad ways to install and configure the user states of an OS, so you should use variables for common directories. This makes your settings package more robust in changing environments: if Microsoft changes where something is storedwhich Vista, for example, did for a number of thingsthe variable will properly locate the appropriate directory.
All variables are used with the Windows-style surrounding percents: %MyVariable% . These are not case-sensitive.
|
|
Variable Name
|
Description
|
User Information
|
%appdata%, %applicationdata%
|
The user-specific AppData directory.
|
%cookies%
|
The user's Internet Explorer Cookies directory.
|
%desktop%
|
The user-specific Desktop directory.
|
%favorites%
|
The user's favorites are stored in this directory.
|
%history%
|
The user's Internet Explorer browser history directory.
|
%internetcache%
|
The Internet Explorer cache directory.
|
%localapplicationdata%
|
The user-specific Local AppData directory. These settings are not moved in a roaming profile.
|
%mymusic%
|
The user's My Music directory.
|
%mypictures%
|
The user's My Pictures directory.
|
%personal%
|
The user's My Documents directory.
|
%profile%, %userprofile%
|
The user's Profile or Home directory.
|
%programs%
|
The user's Start Menu programs directory.
|
%quicklaunch%
|
The user's Quick Launch programs directory.
|
%recent%
|
The user's recent items directory.
|
%sendto%
|
The user's Send To programs directory.
|
%startmenu%
|
The user-specific Start Menu items directory.
|
%startup%
|
The user-specific Startup items directory.
|
%tempdirectory%
|
The user-specific Temp directory.
|
%templates%
|
The user's template directory.
|
%username%
|
The user's login name (not their full name).
|
Common Files
|
%commonapplicationdata%
|
The All User's AppData directory.
|
%commondesktop%
|
The All User's Desktop directory.
|
%commondocuments%
|
The All User's Document directory.
|
%commonprogramfiles%
|
The All User's Common Files directory.
|
%commonstartmenu%
|
The All User's Start Menu items directory.
|
%fonts%
|
Where the system keeps its fonts.
|
%profiles%
|
Where the system keeps user directories.
|
%programfiles%
|
Where the system keeps its programs.
|
%os%
|
Where the OS is installed.
|
%system%
|
Where the system files are installed.
|
%windir%
|
Where Windows is installed.
|
Computer Information
|
%computername%
|
The name of this computer. Must be qualified on a domain.
|
Where to Put Your Files
Once your package is ready, put it on your KServer in %KSERVER_ROOT%\WebPages\ManagedFiles\VSAHiddenFiles\KUSM\ClientApp\SettingsPackages . You may have to create that folder.
Permissions
The settings package must be read-accessible by users with user access. It is generally easiest to give the Everyone group read access.
|