App_Remediation is a console application designed to be used with App-V 5 (and above) to save and restore application related data (ARD) between locations that normally do not roam and those that do.

App-V now isolates ARD changes and redirects the saved file changes to locations that either roam or not, based on whether those changes would have roamed if the application was natively installed. This is quite different from the versions of App-V before version 5, where these changes would have been isolated and redirected to a location that always roamed. This remediation of badly constructed apps is very important to customers in a roaming environment, including not only those using "roaming profiles", but also if using folder redirection, home drives, or other methods.

NOTE: ALL command parameters (except for the GUID) must be in lower case only.

This program can be used in scripts to remediate virtual applications in two different ways:

PER APP BASIS
Quite possibly, you only have a few apps in production today that require this kind of remediation. A simple solution would be to add this program as the script file for both "StartVirtualEnvironment" and "TerminateVirtualEnvironment" of the given package. In both cases you should not add the "RunInVirtualEnvironment" attribute.

For the TerminateVirtualEnvironment script, use the parameter "/save", or "/cleansave", followed by a space, and then followed by the Package Id GUID.

For the StartVirtualEnvironment script, you use the parameter "/restore", "/cleanrestore" followed by a space, and then followed by the Package Id GUID (not the package version guid, and not inclosed in { } characters). You would mark the script to start outside the virtual environment with rollback=false.

By including the clean syntax, you ask the tool to first remove the destination folder of the action before copy.  This insures that there is no old data hanging around.

The per-app version of the command also allows you to add a "/debug" parameter as either the first or second argument (the GUID must always be the last argument of the command).  Normally, the tool silently ignores errors, but if you are troubleshooting you can add this parameter to get popup messages with the windows error code of the issue if something goes wrong.

PER USER SESSION BASIS
The app may also be run as part of user logon / logoff scripts, using the "/saveall" and "/restoreall" parameters (and now "/cleansaveall" and "/cleanrestoreall").  No GUIDs required as it will save or restore all packages found.

 

HOW IT WORKS

When saving changes, it will copy the folders and files (preserving the attributes, ACLs, and timestamps) from the users AppData/Local redirection repositories into a similar location under the users AppData/roaming location. The tool uses robocopy to preserve file metadata.

For example:
    C:\Users\Tim\AppData\local\Microsoft\AppV\Client\VFS\7EA4C0C9-2099-E743-AAEA-A1C03D11138E
is saved to:
    C:\Users\Tim\AppData\remote\Microsoft\AppV\Client\VFS\SavedFromLocal\7EA4C0C9-2099-E743-AAEA-A1C03D11138E

The program does not touch isolated registry information, as those are properly handled for standard users when apps do not require elevation. Administrators, and apps the elevate to run-as-administrator will not have some registry data remediated.

Example Script

Below is an example of use of App_Remediation solving the problem of Paint.Net saving user settings into AppData/Local based files. The Package Id GUID is conveniently found at the top of the Deployment or User config file as PackageId=...


<UserScripts>

    <StartVirtualEnvironment RunInVirtualEnvironment="false">
        <Path>C:\Windows\App_Remediation.exe</Path>
        <Arguments>/restore 26ceb0bc-1e69-4de1-a444-70b6f1e0dfc3</Arguments>
        <Wait RollbackOnError="false" Timeout="30"/>
    </StartVirtualEnvironment>

    <TerminateVirtualEnvironment>
        <Path>C:\Windows\App_Remediation.exe</Path>
        <Arguments>/save 26ceb0bc-1e69-4de1-a444-70b6f1e0dfc3</Arguments>
        <Wait RollbackOnError="false" Timeout="30"/>
    </TerminateVirtualEnvironment>

</UserScripts>
 

You can also solve this problem with some User Environment Management products, although ironically not Microsoft's UE-V product. This tool should prove to be easier to use, since you don't need to worry about the app-specific details of what to capture or not. Just use this and it grabs everything that App-V isolates.

INSTALLATION

No installation. Unzip and copy the exe file somewhere convenient.

 

RELEASE HISTORY

1.3.0.0 - Oct 1 2017 - Added debug option.

1.2.0.0 - June, 2016. Added clean options.

1.1.0.0 - July 1, 2013. Use the effective user name and not the environment variables provided by App-V.

1.0.0.0 - June 16, 2013. Initial release

 

What does App_Remediation cost?

TMurgent believes in giving back to the community.   App_Remediation is free for for use by consultants and enterprises when downloaded directly from the TMurgent site. Re-posting the binaries to other websites is not permitted.

What OSs will it run on?

The tool will run on OS's supported by the App-V 5 client. It is a 32-bit app and works on both the 32bit and x64 operating systems.

Are there more free tools?

TMurgent has a bunch of tools on this page.

 

Here is the Latest ZIP package:    App_Remediation V 1.3.0.0 (6KB )

Here is the prior version:    App_Remediation V 1.1.0.0 (6KB )