Forum Discussion

Sleeping_Developer's avatar
Sleeping_Developer
Copper Contributor
Feb 24, 2020

Can we have multiple fixes at the same time

Dear Experts,

 

Assume i have a msix package that needs multiple fixes like

1)FRF

2)Registry

3)Trace

 

Can we have the three fixes together ?

 

i have been trying this but was not lucky enough..

 

Below is the config.json i was trying

 

{
    "applications": [
        {
            "id""MyPackagex64",
            "executable""VFS/ProgramFilesX64/ConEmu/MyPackage64.exe",
            "workingDirectory""VFS/ProgramFilesX64/MyPackage"
        },
        {
            "id""ConEmuAAx64A1",
            "executable""VFS/ProgramFilesX64/ConEmu/MyPackage64.exe",
            "workingDirectory""VFS/ProgramFilesX64/MyPackage"
        }
    ],
    "processes": [
        {
            "executable""MyPackage64",
            "fixups": [
                {
                    "dll""FileRedirectionFixup64.dll",
                    "config": {
                        "redirectedPaths": {
                            "knownFolders": [
                                {
                                    "id""ProgramFilesX64",
                                    "relativePaths": [
                                        {
                                            "base""MyPackage/",
                                            "patterns": [
                                                ".*"
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                },
                {
                    "dll""TraceFixup64.dll",
                        "config": {
                            "traceMethod""outputDebugString",
                            "traceLevels": {
                                "default""always"
                            },
                            "breakOn": {
                                "filesystem""unexpectedFailures"
                            }
                        }
                    }
            ]
        },
        {
            "executable""MyPackage64",
            "fixups": [
                {
                    "dll""FileRedirectionFixup64.dll",
                    "config": {
                        "redirectedPaths": {
                            "knownFolders": [
                                {
                                    "id""ProgramFilesX64",
                                    "relativePaths": [
                                        {
                                            "base""MyPackage/",
                                            "patterns": [
                                                ".*"
                                            ]
                                        }
                                    ]
                                }
                            ]
                        }
                    }
                },
                {
                    "dll""TraceFixup64.dll",
                        "config": {
                            "traceMethod""outputDebugString",
                            "traceLevels": {
                                "default""always"
                            },
                            "breakOn": {
                                "filesystem""unexpectedFailures"
                            }
                        }
                    }
            ]
        }
    ]
}
  • Hey Sleeping_Developer ,

     

    I took a look at your supplied Json.config file.  First off there are no json syntax errors, that is good.

     

    Besides the syntax I see you declared fixups for the same process, was that expected?

     

    The syntax for the config sections look good as well.  Tell me, for the FRF work fine on it's own?

     

    Also, to answer your question, it is okay to declare multiple fixups for the same process.

    • Sleeping_Developer's avatar
      Sleeping_Developer
      Copper Contributor

      Darren_Hoehna Thank you for the reply,

      1)File redirection fix up didn't work for me

      2)Yeah, i am trying to applying both fix up for the same process, is there any problem if i do so ?

       

      Please help me if there is another way to apply fix ups.

      • Tim Mangan's avatar
        Tim Mangan
        MVP

        Sleeping_Developer In general, multiple fixups should work, but I would not want to attempt two fixups that attempt to intercept the same Windows API functions. 

        So for example, the FRF and DynamicLibrary fixups address distinct sets of the API and work well together if needed. The Trace and FRF fixups intercept the same calls (Trace might be a considered a superset), and I would anticipate issues.

         

        I use the trace fixup only to determine what might be required by seeing what the application is attempting to do and how the runtime without the FRF responds.  When using the FRF without trace but wanting tracability, you should probably use the debug build version of the FRF.  This will output considerable detail to the debug port, which you can view using something like the Microsoft Sysinternals tool DbgView.

         

        If you are creating your MSIX package by repackaging using the Microsoft MSIX Packaging Tool, you can use PsfTooling (free app in the Microsoft Store) to inject the debug version of the PSF into your package.  The tool has two shortcuts (PsfTooling and PsfToolingD), one for the release build and the second for the debug build of the PSF.

         

        If building your package as a developer, just include the debug build of the FRF the same way you are doing now, just without the trace.

Resources