Forum Discussion

Shashank450's avatar
Shashank450
Copper Contributor
Jun 09, 2020
Solved

MSIX - Permissions to App Folder?

I have an application which creates a log file in the application install directory (e.g. C:\Program Files\xyz\) upon shortcut launch. This can achieved well by granting permissions to the folder xyz under C:\Program Files using a custom action script with a traditional WI approach. Well with the MSIX, how can we achieve this?

  • This is a classic challenge where PSF (Package Support Framework) can help you, more specifically one of its fixups called File Redirection:

    https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/fixups/FileRedirectionFixup

     

    You cannot set the permissions though, the MSIX has a built-in tamper protection, and prevents you from changing anything in the install directory. Instead, what PSF does for you is to redirect these calls to a place where there is a write grant (a special folder in local app data), and ensures that there is a transparent redirection on subsequent calls.

     

    Some basic regular expression knowledge may be required to achieve the desired results (depending on the pattern for the files to be redirected). A step-by-step instruction is here:

    https://docs.microsoft.com/en-us/windows/msix/psf/package-support-framework

     

    Depending on the tooling you use, the support for PSF runtime from GUI may be also there, most of key players have already implemented it either way.

    • c2wak's avatar
      c2wak
      Copper Contributor

      Bogdan Mitrache Thanks so much for the video it was very usefull!. However i have noticed that if you try to do any redirections, advanced installer says you need the Architect Edition is that right? You seem to suggest you can do this using the Express edition?

      • Bogdan Mitrache's avatar
        Bogdan Mitrache
        Steel Contributor
        Yes, the last time I checked the file redirection fixup was included in the Express edition too.

        Please note that the Express edition is a separate download. You need to get it from the Store. If you downloaded Advanced Installer from our website (advancedinstaller.com) than you have the commercial edition, which will ask for a license or switch to trial mode.
  • This is a classic challenge where PSF (Package Support Framework) can help you, more specifically one of its fixups called File Redirection:

    https://github.com/Microsoft/MSIX-PackageSupportFramework/tree/master/fixups/FileRedirectionFixup

     

    You cannot set the permissions though, the MSIX has a built-in tamper protection, and prevents you from changing anything in the install directory. Instead, what PSF does for you is to redirect these calls to a place where there is a write grant (a special folder in local app data), and ensures that there is a transparent redirection on subsequent calls.

     

    Some basic regular expression knowledge may be required to achieve the desired results (depending on the pattern for the files to be redirected). A step-by-step instruction is here:

    https://docs.microsoft.com/en-us/windows/msix/psf/package-support-framework

     

    Depending on the tooling you use, the support for PSF runtime from GUI may be also there, most of key players have already implemented it either way.

Resources