Best Practice - Deleting User Content on Exit? RRS feed

  • Question

  • Hi All,

    Quiet here these days :)

    Autodesk 2020 application troubles and any help appreciated. There are a number of constraints around what I can do with the AdSSO folder. Appears to be linked to the Autodesk Licensing Service. 

    This AdSSO folder is being generated in "%LocalAppData%\Microsoft\AppV\Client\VFS\Package_GUID\Common AppData\Autodesk" on first run. If I leave this as is any further opens of the App are massively delayed.

    I believe I can delete this folder on Exiting the App without any negative impact for End Users however I am struggling to work out the most efficient way to do this. I assume using a script in the Deployment Config User but with the Package_GUID? Any help appreciated. 

    Thanks in advance.

    Friday, February 14, 2020 5:32 PM

All replies

  • Hi.
    I think you have to create this folder with scripting during the "add package" or "publish package" phase into the local filesystem. I have done a similar thing in a previous blogpost.

     # creating folders that's missing
        if (!(Test-Path "C:\folder\")) { New-Item "C:\folder\" -Itemtype directory -Force }

    Then you can set merge with local in your package (put a dummy file into the directory), during sequencing mode so you can see the local folder and delete all files that exist in that folder and put them into the script directory.
    They then have to be scripted into the folder during add/publish phase.
    If you are going to let users delete the files/folder you must check that your user have the needed access with

    # changing permissions
        icacls '"c:\folder" /inheritance:e /grant "builtin\users":(OI)(CI)F' or a security group in AD.

    Guids can be automated into your script if you use powershell and the $PSScriptRoot variable or the older $scriptPath = split-path -parent $MyInvocation.MyCommand.Definition until you have both your package guid and versionguid as variables.

    Userremovalscript should be easy enough if you want the whole folder gone:
    if exist "%SystemDrive%\folder" rmdir /s /q "%SystemDrive%\folder"

    Hope this help :)

    Monday, February 24, 2020 10:30 AM
  • Hi Andrew,

    Still having fun with AutoCAD I see!

    If you close the app, check to see if the virtual environment closes down with it, or if it stays as 'in use'. If it closes down successfully, you can add a 'TerminateVirtualEnvironment' script. The services might continue to run though and keep the VE open. You can also try messing around with the terminate child processes (https://packageology.com/app-v/app-v-5-0-and-terminatechildprocesses).

    There is also an ExitProcess script trigger, but this might not be safe to run if the user might launch multiple instances of the application. I haven't tested this but would assume the script would run at the close of each individual instance rather than when the last one is closed.

    Another option is to wipe the folder at StartVirtualEnvironment! But this might not work out if the VE never closes down in between application launches.


    Friday, February 28, 2020 9:53 AM
  • Apologies for not replying sooner. I appreciate the detail you have gone to in your reply. I am not 100% I fully comprehend the solution though. Maybe I wasn't clear enough originally.

    What I understand is that if I do a Repair on the Application in the App-V client it deletes the user generated content in "%LocalAppData%\Microsoft\AppV\Client\VFS\Package_GUID" and the Application launches fine next time. I also know that if I delve into this a little deeper there is a single folder within Common AppData called AdSSO that if I delete manually after exiting the package the app will start up fine next time. The files in this folder are not fixed though as they relate to the Licensing of the product so I don't think I can add them into the package itself to Scripts. 

    Are you saying that if I create the folder and stick a file in there during sequencing, and then merge the folder at package creation, I should be able to delete the contents of the folder at the above location which appears to be the crux of my problem?

    My PS skills are very limited but I think I can get the same results with a .bat using %~dp0. Would that be your understanding too? But that doesn't help me with my first point unfortunately.

    Friday, March 6, 2020 3:44 PM
  • Dan - VE closes fine. I have Exit Process Script ending the 2 processes it is just how to delete this folder I am struggling with as in I can't work out the text to get to it due to the Package Guid. I know how to physically to add to scripts during sequencing but working out how to path to here - I am stumped

    C:\Users\USERID\AppData\Local\Microsoft\AppV\Client\VFS\PACKAGE_GUID\Common AppData\Autodesk\AdSSO

    Or what I am trying to do is impossible and I have to go deeper a la Arne route above?

    Friday, March 6, 2020 4:29 PM
  • You know the PackageGuid, so whats the problem putting it into the script? If you want to retrieve the guid dynamically, you could create a powershell script to retrieve it from the AppxManifest.xml. Scripts always runs from within the script folder so something like:
    $Guid = ([xml]$(get-content ..\AppxManifest.xml)).package.Identity.PackageId

    Roy Essers

    Thursday, March 26, 2020 11:00 PM