When running Windows MSIX package (using Flutter), Cryptlex functions hang

I’m using the LexActivator Flutter package. For the Mac OS build I was able to get it working by installing the dylib file in XCode manually, linking it, etc. On Windows I’m able to run/debug the app in Visual Studio Code, and all of the LexActivator package features work. However, after creating an MSIX package of our app, and installing & running it, the LexActivator functions hang. For instance, this hangs:

LexActivator.SetProductData("my long string");

I’ve turned off all of the Windows Firewalls, and changed the capabilities for the MSIX package creation tool (GitHub - YehudaKremer/msix: Create Msix installer for flutter windows-build files.) to the following:

internetClientServer,fileSystem,privateNetworkClientServer, runFullTrust

I’ve tried several variations on the capabilities with no luck.

Is there anything else I can try? Thanks in advance.

Is VS2015 or above runtime installed on the machine where you are trying to use the app?

I believe it is. I have both Visual Studio Code and Visual Studio 2022 installed on the machine. I’m not sure if this is what you’re asking, but the Visual C++ 2015-2022 Redistributable is installed as well as .NET 7.0 Runtime.

C:\Users\blake\Documents\test\virtual-score>dotnet --list-sdks
7.0.202 [C:\Program Files\dotnet\sdk]

C:\Users\blake\Documents\test\virtual-score>dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.15 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

We will check this and get back to you.

Can you check the installation folder after the app is installed through msix folder, and see if it contains the LexActivator dll.

I’m having a hard time locating where the application gets installed using the MSIX package. It’s not installed in the usual C:\ProgramFiles… folder. A folder gets created here:

C:\Users\blake\AppData\Local\Packages\ScoreBuddyLLC.ScoreBuddyVideoboard_nygy5x5x71j3p

But there are no .dll nor .exe files there.

If I change the .msix file to .zip and decompress it, I can see there are several .dlls inside, including: LexActivator.dll and lexactivator_plugin.dll. I’ve attached a screenshot showing the contents of the msix folder. I’m not sure if this helps?

This is also something we suspected. The LexActivator.dll file is essential for the program to run on Windows. When packaging, you have to ensure that the file is available for the program to use in its execution path.

Can you try using a different method for packaging the application and get back?

Edit: Since I suspect the issue to be with the msix packaging step, you could also try looking into the configuration for the msix package to ensure that the dll is being shipped with your application.

I think I figured it out. In the LexActivator Dart package, is this function:

static DynamicLibrary loadLib() {
    final libraryPathURI = File(Platform.resolvedExecutable).parent.uri;

    if (Platform.isLinux) {
      return DynamicLibrary.open(
          libraryPathURI.resolve('lib/libLexActivator.so').path);
    } else if (Platform.isWindows) {
      return DynamicLibrary.open(Platform.script
         .resolve("build/windows/Runner/Debug/LexActivator.dll")
         .toFilePath(windows: true));
    } else if (Platform.isMacOS) {
      return DynamicLibrary.open('libLexActivator.dylib');
    } else if (Platform.isAndroid) {
      return DynamicLibrary.open('libLexActivator.dylib');
    } else if (Platform.isAndroid) {
      return DynamicLibrary.open('libLexActivator.dylib');
    } else {
      throw Exception();
    }
  }

The path build/windows/Runner/Debug/LexActivator.dll doesn’t exist in the packaged MSIX. This works in debug mode, because that path does exist. Changing it to just LexActivator.dll instead seems to fix the issue in both modes.

I appreciate the help.

Thanks for letting us know. We will fix this in the package.

1 Like