How to make changes to appdata roaming folder?

%3CLINGO-SUB%20id%3D%22lingo-sub-1427762%22%20slang%3D%22en-US%22%3EHow%20to%20make%20changes%20to%20appdata%20roaming%20folder%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1427762%22%20slang%3D%22en-US%22%3E%3CP%3EUsing%201909%20MSIX%20Packaging%20tool%20environment%20from%20Hyper-V%20for%20learning%2Ftesting.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20vendor%20client%20software%20currently%20installed%20on%20machines%20directly%20and%20needed%20to%20install%20the%20new%20version%20of%20the%20software%20isolated%20from%20the%20old.%20New%20software%20version%20accesses%20a%20different%20server.%20Everything%20tested%20great%2C%20was%20able%20to%20use%20both%20separately%20and%20new%20version%20is%20contained.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20the%20software%20is%20installed%20and%20a%20user%20signs%20in%2C%20it%20creates%20a%20folder%20in%20%3CSTRONG%3Eappdata%5Croaming%3C%2FSTRONG%3E.%20I%20usually%20replace%20the%20files%20with%20already%20modified%20ones.%20They%20keep%20the%20server%20info%20in%20them%20so%20the%20user%20doesn't%20have%20to%20input%20it%20when%20they%20login.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20add%20these%20files%20to%20the%20MSIX%20package%20so%20that%20when%20it%20installs%20it%20would%20be%20included%3F%20Or%20is%20it%20possible%20to%20copy%20the%20files%20over%20after%20the%20install%20is%20done%3F%20If%2C%20so%20where%20would%20I%20find%20the%20appdata%20location%20for%20the%20MSIX%20install%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1428546%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20make%20changes%20to%20appdata%20roaming%20folder%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1428546%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F683879%22%20target%3D%22_blank%22%3E%40llawrence611%3C%2FA%3E%20If%20you've%20ever%20done%20this%20with%20App-V%2C%20the%20process%20would%20be%20similar%2C%20just%20more%20complicated.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EA%20summary%20of%20the%20MSIX%20process%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EYou'd%20include%20the%20PSF%20in%20the%20package%2C%20including%20PsfLauncher.exe%20and%20PsfRuntime.dll%20(of%20whichever%20bitness%20is%20appropriate).%3C%2FLI%3E%0A%3CLI%3EModify%20the%20vendor%20shortcut%20to%20have%20PsfLauncher%20become%20the%20target.%26nbsp%3B%3C%2FLI%3E%0A%3CLI%3EIn%20the%20config.json%20file%2C%20you'd%20have%20the%20launcher%20run%20a%20start%20script%2C%20and%20then%20launch%20the%20vendor%20exe.%3C%2FLI%3E%0A%3CLI%3EYou'd%20have%20a%20choice%20to%20mark%20the%20script%20to%20run%20only%20on%20first%20launch%2C%20or%20every%20time%20depending%20on%20if%20you%20think%20the%20data%20on%20the%20share%20might%20change%20after%20deployment.%3C%2FLI%3E%0A%3CLI%3EThere%20are%20two%20choices%2C%20copying%20the%20file%20to%20the%20native%20location%2C%20which%20you%20already%20know%2C%20or%20to%20the%20redirected%20location.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ENATIVE%3A%20%3C%2FSTRONG%3EYou'd%20only%20have%20to%20ensure%20that%20the%20package%20does%20not%20include%20that%20appdata%2Froaming%2Fvendor%20folder.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EREDIRECTED%3A%3C%2FSTRONG%3E%20You'd%20have%20to%20ensure%20the%20package%20does%20include%20that%20folder.%20You%20might%20also%20need%20the%20FileRedirectionFixup%20added%20to%20the%20package%20and%20the%20vender%20exe%20marked%20to%20load%20it.%20The%20script%20is%20easier%20to%20do%20if%20it%20doesn't%20get%20the%20FRF%20loaded.%20In%20that%20case%20it%20would%20need%20to%20determine%20the%20package%20name%3B%20easiest%20to%20do%20in%20powershell.%20With%20that%2C%20the%20folder%20would%26nbsp%3B%20be%20%25localappdata%25%5CPackages%5C%5BPackageName%5D%5C%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3ELocalCache%5CLocal%5CMicrosoft%5CWritablePackageRoot%5CVFS%3C%2FFONT%3E%5CAppData%5Cvendor.%26nbsp%3B%20Otherwise%2C%20inject%20the%20FRF%20into%20the%20script%20exe%20also%20and%20you%20can%20just%20have%20the%20script%20write%20to%20%25appdata%25%5Cvendor%20and%20the%20FRF%20handles%20the%20redirection.%26nbsp%3B%20Personally%2C%20I'd%20prefer%20not%20to%20inject%20the%20FRF%20into%20the%20powershell%20or%20cmd%20or%20whatever%20process%20you%20use%20to%20run%20the%20script.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ESince%20you%20are%20new%20to%20this%20and%20using%20the%20Microsoft%20MSIX%20Packaging%20Tool%2C%20I'd%20suggest%20that%20you%20use%20PsfTooling%20(also%20a%20free%20app%20on%20the%20Microsoft%20Store)%20during%20packaging%20to%20add%20the%20PSF%20to%20your%20package%20while%20installing%20the%20app%20in%20the%20packaging%20tool.%26nbsp%3B%20You%20just%20have%20to%20tell%20it%20what%20components%2C%20point%20to%20your%20shortcut%2C%20and%20add%20your%20script%20and%20it%20takes%20care%20of%20the%20details.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

Using 1909 MSIX Packaging tool environment from Hyper-V for learning/testing.

 

I have a vendor client software currently installed on machines directly and needed to install the new version of the software isolated from the old. New software version accesses a different server. Everything tested great, was able to use both separately and new version is contained.

 

When the software is installed and a user signs in, it creates a folder in appdata\roaming. I usually replace the files with already modified ones. They keep the server info in them so the user doesn't have to input it when they login.

 

Is it possible to add these files to the MSIX package so that when it installs it would be included? Or is it possible to copy the files over after the install is done? If, so where would I find the appdata location for the MSIX install?

1 Reply
Highlighted

@llawrence611 If you've ever done this with App-V, the process would be similar, just more complicated.

 

A summary of the MSIX process:

  • You'd include the PSF in the package, including PsfLauncher.exe and PsfRuntime.dll (of whichever bitness is appropriate).
  • Modify the vendor shortcut to have PsfLauncher become the target. 
  • In the config.json file, you'd have the launcher run a start script, and then launch the vendor exe.
  • You'd have a choice to mark the script to run only on first launch, or every time depending on if you think the data on the share might change after deployment.
  • There are two choices, copying the file to the native location, which you already know, or to the redirected location.
  • NATIVE: You'd only have to ensure that the package does not include that appdata/roaming/vendor folder.
  • REDIRECTED: You'd have to ensure the package does include that folder. You might also need the FileRedirectionFixup added to the package and the vender exe marked to load it. The script is easier to do if it doesn't get the FRF loaded. In that case it would need to determine the package name; easiest to do in powershell. With that, the folder would  be %localappdata%\Packages\[PackageName]\LocalCache\Local\Microsoft\WritablePackageRoot\VFS\AppData\vendor.  Otherwise, inject the FRF into the script exe also and you can just have the script write to %appdata%\vendor and the FRF handles the redirection.  Personally, I'd prefer not to inject the FRF into the powershell or cmd or whatever process you use to run the script.

Since you are new to this and using the Microsoft MSIX Packaging Tool, I'd suggest that you use PsfTooling (also a free app on the Microsoft Store) during packaging to add the PSF to your package while installing the app in the packaging tool.  You just have to tell it what components, point to your shortcut, and add your script and it takes care of the details.