Closed tototo23 closed 7 months ago
Hello @tototo23
Can you try call the .exe file like that: await File('${File(Platform.resolvedExecutable).parent.path}\myAssets\file.exe')......
After testing that is working, here more details.
var pathToCsharpExecutableFile =
'${File(Platform.resolvedExecutable).parent.path}\\ExeFolder\\TeoFlutterPoc.exe';
dart run msix:create
and test your app.Hi @YehudaKremer, thank you very much for that very fast answer and tests !
Actually, in my case, the issue doesnt come from the call of the app in Flutter, but the files hierarchy :
My built Windows project looks like :
Windows Release folder |- myMainApp.exe |- otherFilesLikeDLLEtc |- ... |- data/ | |- flutter_assets/ | | |- assets/ | | | |- ..|- .../ myOtherProgramToBeCalled.exe
Once this structure is packed in the msix, and then installed in Windows,
I can find the same tree in C:\Program Files\WindowsApps\
The result is :
I have the same result inmy Flutter app : this asset file is totally found, but the execution is forbidden because of execution permission of the file itself
Hey
Windows block you from using other exe files other then the main one.
But, you can execute secondary exe files by open them from the main one code:
Process secondaryExe = await Process.start(secondaryExePath, []);
Thank you again @YehudaKremer
Actually it works before the MSIX, but not after. Event if it is not an exe calling an other exe :
In my example, i have the .exe file in data/flutter_assets/assets/.../secondary.exe
SO my problem a problem of calling the .exe from the main .exe, but the execution privilege of the .exe file installed via the MSIX -> it loses the execution permission only once installed as MSIX
Again
For MSIX app, windows uses virtual folders tree, and block any access you the app files.
if you want to use msix format, you open your secondary exe files through the main app process
:speech_balloon: Description
I create a windows app in Flutter with an advanced UI, and at some point, my app calls an internal .exe file in the asset folder. When launching my app in dev, release, it works perfectly. But when installed with MSIX, it has rights issues :
C:\Program Files\WindowsApps\\data\flutter_assets\assets\software\App\
Always returns en exit code 1 in my Flutter app, because of access denied.
:question: Platform
Is there a wey to say to MSIX builder that there is an other .exe that should have the execution rights? Or is there a way to run a "post install bat script"? Or an other way to have the possibility to run make this embbeded .exe file runnable?