How to make changes to appdata roaming folder?

Copper Contributor

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

@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.