Re-packaging SketchUp 2019/2020 for MSIX in the Windows Store

Re-packaging SketchUp 2019/2020 for MSIX in the Windows Store

How to fix licensing and DLL issues with the package support framework (PSF)

Challenges

The default installation of Sketchup 2019/2020 requires access to read and write files to the local program data directory on the machine which is not permitted by MSIX. This causes the application to be unable to set/verify the licensing information. Additionally the package requires special access to some DLL files which are not captured during package creation and throw errors on program launch.

Before packaging

Perform a regular desktop installation of SketchUp on your computer. Locate and save the following DLL files into a folder somewhere for later.

  • mfc140u.dll
  • msvcp140.dll
  • msvcp140_1.dll
  • vcruntime140.dll
  • vcruntime140d.dll
  • vcruntime140_1.dll
  • vcruntime140_1d.dll

Download a copy of the Package Support Framework (PSF) for MSIX from Microsoft: https://github.com/microsoft/MSIX-PackageSupportFramework. Specifically we will need to use 2 of the available fix-ups.

  • DynamicLibraryFixup64
  • FileRedirectionFixup64

Packaging

Run the normal SketchUp installation through the MSIX packaging tool and complete all installation steps to output an initial MSIX file, and then modify it using the packaging tool.

Upload all of the package support framework files including fixup dlls to the package root directory. Also upload all of the DLL files collected in the previous step to the root of the package.

PSF Configuration

Create a config.json file in the package root with the below contents.

{
  "applications": [
    {
      "id": "App",
      "executable": "VFS/ProgramFilesX64/SketchUp/SketchUp 2020/SketchUp.exe",
      "workingDirectory": "VFS/ProgramFilesX64/SketchUp/SketchUp 2020"
    },
    {
      "id": "Layout",
      "executable": "VFS/ProgramFilesX64/SketchUp/SketchUp 2020/LayOut/LayOut.exe",
      "workingDirectory": "VFS/ProgramFilesX64/SketchUp/SketchUp 2020/LayOut"
    },
    {
      "id": "Style",
      "executable": "VFS/ProgramFilesX64/SketchUp/SketchUp 2020/Style Builder/Style Builder.exe",
      "workingDirectory": "VFS/ProgramFilesX64/SketchUp/SketchUp 2020/Style Builder"
    }
  ],
  "processes" : [{
    "executable": ".*",
    "fixups": [{
      "dll": "DynamicLibraryFixup64.dll",
      "config": {
        "forcePackageDllUse": true,
        "relativeDllPaths": [
          {
            "name": "mfc140u.dll",
            "filepath": "mfc140u.dll"
          },
          {
            "name": "msvcp140.dll",
            "filepath": "msvcp140.dll"
          },
          {
            "name": "msvcp140_1.dll",
            "filepath": "msvcp140_1.dll"
          },
          {
            "name": "vcruntime140.dll",
            "filepath": "vcruntime140.dll"
          },
          {
            "name": "vcruntime140d.dll",
            "filepath": "vcruntime140d.dll"
          },
          {
            "name": "vcruntime140_1.dll",
            "filepath": "vcruntime140_1.dll"
          },
          {
            "name": "vcruntime140_1d.dll",
            "filepath": "vcruntime140_1d.dll"
          }
        ]
      }
    },{
      "dll": "FileRedirectionFixup64.dll",
      "config": {
          "redirectedPaths": {
            "knownFolders": [
                {
                  "id": "ProgramData",
                  "relativePaths": [
                      {
                        "base": "SketchUp\\SketchUp 2020",
                        "patterns": [
                            ".*\\.txt",
                            ".*\\.lic"
                        ]
                      }
                  ]
                }
            ],
             "packageRelative": [
            {
                "base": "VFS\\Common AppData\\SketchUp\\SketchUp 2020",
                "patterns": [
                    ".*\\.txt",
                    ".*\\.lic"
                ]
            },
            {
                "base": "VFS\\ProgramFilesX64\\SketchUp\\SketchUp 2020\\LayOut",
                "patterns": [
                    ".*\\.txt",
                    ".*\\.lic"
                ]
            },
            {
                "base": "VFS\\ProgramFilesX64\\SketchUp\\SketchUp 2020\\Style Builder",
                "patterns": [
                    ".*\\.txt",
                    ".*\\.lic"
                ]
            }
        ]
          }
      }
  }]
  }]
}

Modify the package manifest to point each application to the PSFLauncher executable

  • manifest.xml (shortened to only show lines needing modification)
<Application Id="App" Executable="PsfLauncher64.exe" EntryPoint="Windows.FullTrustApplication">

<Application Id="Layout" Executable="PsfLauncher64.exe" EntryPoint="Windows.FullTrustApplication">

<Application Id="Style" Executable="PsfLauncher64.exe" EntryPoint="Windows.FullTrustApplication">

Licensing File Fix

Create a new txt file named activation_info.txt and add it to the package under VFS\Common AppData\SketchUp\SketchUp 2020\activation_info.txt

Contents of the file should look like this (use your own serial and auth codes)

{
"serial_number":"VH-00XXXXXXXX", 
"auth_code":"a3c8fXXXXXXX"
}

Save the modified package and you should now have a fully functional MSIX version of Sketchup 2019/2020 that will validate the licensing correctly on launch.