Forum Discussion

TheStingPilot's avatar
TheStingPilot
Copper Contributor
Sep 17, 2019
Solved

[MSIX] - Packaging GIMP

Hello,

 

I have created an MSIX from GIMP. When running the application I get approximately 100 error messages that various .dll files cannot be found.

 

What happens:

  1. VFS\ProgramFilesX64\GIMP 2\bin\gimp-2.10.exe is started.
  2. After a while the application VFS\ProgramFilesX64\GIMP 2\lib\gimp\2.0\plug-ins\web-page\web-page.exe is started.
  3. During the startup process, I get an error that the file libgimpui-2.0-0.dll cannot be found. That file is located in VFS\ProgramFilesX64\GIMP 2\bin

To workaround I created a PSF:

  • Modified AppxManifest.xml:
    <Application Id="GIMPTwoOneZero" Executable="PsfLauncher64.exe" EntryPoint="Windows.FullTrustApplication">
  • Created config.json:

    {

    "applications": [
    {
    "id": "GIMPTwoOneZero",
    "executable": "VFS\\ProgramFilesX64\\GIMP 2\\bin\\gimp-2.10.exe",
    "workingDirectory": "VFS\\ProgramFilesX64\\GIMP 2\\bin"
    }
    ],

    "processes": [
    {
    "executable": ".*",
    "fixups": [ { "dll": "PsfRuntime64.dll" } ]
    }
    ]

    }

I created a new MSIX package and signed it. When running the application the 'main' gimp-2.10.exe is started and is closed immediately.

 

My question is what I should do to get this package working.

 

Any feedback is appreciated and with kind regards,

Willem-Jan

  • alexmarin89's avatar
    alexmarin89
    Sep 20, 2019

    pandaysumitroy  Indeed, just tried it now and it doesn't work. Apparently this only suppresses the load failure of the plugins.

    Apparently the GIMP community is also struggling with these issues (also somebody else already tried to put the plugins in System32 and System64 with the same exact results).

     

    However, i did notice something, which i am not sure why is happening like this for the moment. While you capture GIMP, if you install it in other folder than the default one (C:\Test or C:\Gimp or any other folder), when you install the MSIX you won't receive the plugin failures anymore (so no need to copy the dlls in System32 and System64).

     

    From my opinion this has something to do with how GIMP gets the paths and the whole logic of finding/loading plugins.

     

    Still searching for a work around to make it work, will let you know if i have any further progress with this.

  • TheStingPilot 

    1. You need to include the FileRedirectionFixup for this application. 
    2. You do not need to include the reference to PsfRuntime as that is assumed (although it must be included in the package).
    3. The config for the FRF would need to include relevant VFS paths.  If you use PsfTooling to perform the injection, then you only need to ask for the FRF and keep all defaults.  This also fixes up the icon for you so you don't get a blue square for the icon.
  • alexmarin89's avatar
    alexmarin89
    Iron Contributor

    TheStingPilotFound a workarround for this. If we check with procmon what is happening, after gimp is loaded, the plugins are searching for some DLLS in BIN. While the psf redirection works and the plugins then search in the correct directory, for whatever reason gimp.exe fails to start. When it calls to dlls it returns only buffer overflows.

     

    However, if we look closely in procmon, we can see that each and every plugin is searching for the DLL files in 3 directories:

     

    1. The BIN folder

    2. The plugin directory (each plugin searches in its own directory)

    3. System64 (C:\Windows\System32) - For 64bit plugins

    4. System32 (C:\Windows\Syswow64) - For 32bit plugins

     

    I have made a capture of Gimp with Advanced Installer, and, without any redirections, i copied all the DLLs from the BIN folder in System64. After the installation almost everything seems to work (99%), except twain.exe.

     

    To fix twain.exe to throw an error, you must also copy all the DLL files from 32\BIN to System32.

     

    After that everything works correctly and applications starts/loads plugins.

     

    Hope this helps,

    Kind regards.

    • WesleeJKN0487's avatar
      WesleeJKN0487
      Icon for Microsoft rankMicrosoft
      Hi Alex, and how did you figure out which DLLs are 64 bit and which are 32 bit, or you did a try-and-error scenario? I.e. Is there any trick in procmon or logic that if the app first searches in System32 we are talking about 64bit plugins? Thanks for your feedback.
      • TIMOTHY_MANGAN's avatar
        TIMOTHY_MANGAN
        MVP

        WesleeJKN0487  I have that build into TMEditX to automate the fixup, but there is a free cmdline utility you can google called PeInfo that will answer the question of bitness for a particular exe or dll.

    • pandaysumitroy's avatar
      pandaysumitroy
      Copper Contributor

      alexmarin89 Thank you for the workaround, above workaround resolves the startup error however "Plug-In Broswer" is not working.

      You can access Plugin Browser from Help > Plugin Browser, it details list of plugin installed.

      i doubt whether plugin are being loaded correctly.

      PLUGIN BROWSERERROR

       

      • alexmarin89's avatar
        alexmarin89
        Iron Contributor

        pandaysumitroy  Indeed, just tried it now and it doesn't work. Apparently this only suppresses the load failure of the plugins.

        Apparently the GIMP community is also struggling with these issues (also somebody else already tried to put the plugins in System32 and System64 with the same exact results).

         

        However, i did notice something, which i am not sure why is happening like this for the moment. While you capture GIMP, if you install it in other folder than the default one (C:\Test or C:\Gimp or any other folder), when you install the MSIX you won't receive the plugin failures anymore (so no need to copy the dlls in System32 and System64).

         

        From my opinion this has something to do with how GIMP gets the paths and the whole logic of finding/loading plugins.

         

        Still searching for a work around to make it work, will let you know if i have any further progress with this.

  • pandaysumitroy's avatar
    pandaysumitroy
    Copper Contributor

    Best solution is to remove Plugin folder from the VFS.

    Issue is with loading bin folder DLL's.

     

     

    • TheStingPilot's avatar
      TheStingPilot
      Copper Contributor

      pandaysumitroy 

       

      Hello,

       

      Many thanks for your reply. Removing the plugins folder is an idea, but not a very good one. Then I will end up with a version without the plugins. And that is not what I want.

       

      With kind regards,

      Willem

      • pandaysumitroy's avatar
        pandaysumitroy
        Copper Contributor

        TheStingPilot For workaround you can follow below steps .

        You can rename or delete plugin folder from VFS [VFS\UserProgramFiles\GIMP 2\lib\gimp\2.0\plug-ins].

        GIMP will load successfully after disabling plug-ins folder.

        On launch - go to EDIT -> Preference and specify the plugin folder.you can copy the plugin folder from working machine and it can be used to load GIMP plugin.

        No idea why its unable to load plugin from VFS directory.

        i am also stuck with the issue.

         

         

         

         

         

Resources