Поделиться через


Folder Redirection und App-V– schon immer eine Story wert

Hallo zusammen,

nachdem es in App-V 4 immer mal Probleme im Zusammenhang mit Folder Redirection gibt, hat man sich gedacht man lässt das in App-V 5 erst mal ganz weg (den support dafür) – das war auch nicht so gut – also kam der support mit SP2 für App-V 5 wieder, und damit auch wieder ein paar Problemchen.

OK, bevor wir hier gleich etwas abtauchen ganz wichtig: Wer App-V 5 betriebt, Folder Redirection nutzt der muss auch Roaming Profiles benutzen oder eine Profil Lösung im einstaz haben die Registry Informationen mitnimmt. Alles andere ist nicht supported

Anwendungen schreiben Ihre Einstellung oft oder meistens in die Registry – darum fällt das folgende Problem gar nicht auf oder erst sehr spät.

Ein Beispiel:

Man startet als Benutzer (Folder Redirection für Appdata Roaming & Roaming Profile) Notepad ++

Nun stellt man die Sprache von Deutsch auf Englisch um:

image

Im Localappdata des Benutzers wird nun auch die XML von Notepad++ geschrieben

image

Wenn Notepad++ nun geschlossen wird, wird die ZIP Datei übertragen:

image

Wenn man sich den Inhalt ansieht sieht man das die Einstellung Englisch gewählt wurde.

image

Wenn der Benutzer sich nun wieder anmeldet würde man erwarten das Notepad++ mit einem Englischen UI aufgeht, tut es aber nicht.

Der Grund liegt darin dass Profil nach dem abmelden gelöscht wurde, in der Registry speichern wir einen Timestamp im Benutzerprofil:

HKEY_CURRENT_USER\Software\Microsoft\AppV\Client\Packages\<GUID>\AppDataTime

Dieser ist in diesem Scenario “älter” als das erstellungsdatum von LocalAppdata und somit wird nicht übertragen.

Eigendöich sollte das Löschen dieses Keys alleine helfen das Problem zu vermeiden, doch es gibt Situationen in denen das nicht genug ist, hier muss noch im HKLM angefasst werden. Markus Wälchli, war so nett und hat das gleich mal in einem Script Sample umgesetzt – das würde dann so aussehen:

Import-Module ActiveDirectory

$user=[Environment]::UserName

$UserSID = Get-ADUser $user

$UserSID = $UserSID.SID

$RegPathUser = "HKCU:\Software\Microsoft\AppV\Client\Packages"

$RegPathMachine = "HKLM:\SOFTWARE\Microsoft\AppV\MAV\Configuration\Packages"

$AppVGUIDUser = Get-ChildItem -Path $RegPathUser | Select pschildname

$AppVGUIDUser = $AppVGUIDUser.pschildname

foreach ($i in $AppVGUIDUser)

    {   

Remove-ItemProperty -path $regpathUser\$i -Name AppDataTime

    }

$AppVGUIDMachine = Get-ChildItem -Path $RegPathMachine | Select pschildname

$AppVGUIDMachine = $AppVGUIDMachine.pschildname

foreach ($i in $AppVGUIDMachine)

    {

Remove-Item -Recurse -path $regpathMachine\$i\UserConfigEx\$UserSID

}

 

Danke dafür.

Schönen Gruß

Sebastian Gernert – Escalation Engineer App-V

Comments

  • Anonymous
    July 16, 2014
    Translation (with adjustments): ** Folder Redirection and App-V– always worth telling a story  ** Hello all, After App-V 4 showed occasional problems with folder redirection, therefor such a scenario wasn’t initially supported in App-V 5. As that turned out to be not the best choice either, SP2 for App-V 5 (re) introduced support for folder redirection – but also introduced some problems. Before we start diving into it: ===================================== IMPORTANT: If you are using App-V 5 together with Folder Redirection, it is mandatory to have Roaming Profiles or another solution that saves & restores Registry information. Any other configuration is not supported! ===================================== As most application store their settings in the Registry, the following problem is unveiled never or very late. Example: A user launches Notepad++ ('NPP'). Folder Redirection is enabled for AppdataRoaming and Roaming Profiles are in place for the Registry. The user launches NPP and changes the language from German (Deutsch) to English: [image] NPP’s configuration XML gets stored by App-V underneath LocalAppdata: [image] When NPP gets closed, the compressed ZIP file containing the XML gets written back to Appdata [Note by Falko: roaming, redirected; the App-V client does that]: [image] Opening the XML inside the ZIP shows the right language settings: [image] In theory NPP should launch with an English UI when it is launched for the next time. But this doesn’t happen. [Note by Falko: the following short paragraph is a clarification of the original statement. Not Sebastian, but I am responsible for it. However I backed it up ] The reason is that upon the next logon the (local) appdata folder gets created with a new time stamp – while App-V stored the ‘old’ timestamp in the Registry (and that Registry value was stored and restored by the User Profile solution) HKEY_CURRENT_USERSoftwareMicrosoftAppVClientPackages<GUID>AppDataTime At user logon  it appears to the App-V client that the folder’s time stamp is newer than the one in the Registry – so the folder content gets dropped. Normally, deleting these user keys [Note by Falko: at the right time] should help avoiding the problem, but there are situations where this isn’t enough: Also some machine keys (HKLM) may have to be cleaned up. H. Wälchli was so kind to provide a sample script that does all the required clean-ups: [script] Thanks a lot for that! Conclusion by Falko: It is essential to use a User Profile Management solution along with App-V. In the scenario of Folder Redirection for AppData it should be configured to delete or ignore the ‘timestamp’ values in both, HKCU and HKLM.

  • Anonymous
    July 17, 2014
    Das Script habe ich dann als LogOff-Script über GPO konfiguriert

  • Anonymous
    December 30, 2014
    I cannot reproduce the issue with SP3. Can you confirm this script is no longer necessary?

  • Anonymous
    January 01, 2015
    Hi Michiel, we made changes to SP, which adress this issue. So yes in SP3 this should be fixed. Sebastian