Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何在Windows 10 IOT core上的Windows UWP应用程序中运行外部win32可执行文件(并能够更新/修改它)?_C++_Windows_Uwp_Windows 10 Iot Core_Windowsiot - Fatal编程技术网

C++ 如何在Windows 10 IOT core上的Windows UWP应用程序中运行外部win32可执行文件(并能够更新/修改它)?

C++ 如何在Windows 10 IOT core上的Windows UWP应用程序中运行外部win32可执行文件(并能够更新/修改它)?,c++,windows,uwp,windows-10-iot-core,windowsiot,C++,Windows,Uwp,Windows 10 Iot Core,Windowsiot,我有Windows UWP应用程序,它将仅在Windows 10 IOT core上运行。 我是每台机器的所有者,它将在其中运行(因此我可以对机器进行任何修改) 应用程序需要下载并运行Win32应用程序。 运行Win32应用程序的解决方案是使用ProcessLauncher::RunToCompletionAsync。 在将exe添加到允许列表之前: reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\

我有Windows UWP应用程序,它将仅在Windows 10 IOT core上运行。 我是每台机器的所有者,它将在其中运行(因此我可以对机器进行任何修改)

应用程序需要下载并运行Win32应用程序。 运行Win32应用程序的解决方案是使用ProcessLauncher::RunToCompletionAsync。 在将exe添加到允许列表之前:

reg.exe ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\EmbeddedMode\ProcessLauncher" /v AllowedExecutableFilesList /t REG_MULTI_SZ /d "c:\PATH TO FILE"
这样就可以正常启动Win32应用程序进程。 但是,此可执行文件使用Windows设备门户上载到Windows 10 IOT核心设备。当Windows UWP应用程序需要更新此Win32可执行文件时,问题就出现了。 它是这样工作的:有时Windows UWP应用程序从internet下载新的可执行文件,取消RunToCompletionAsync返回的异步任务(关闭进程),并将新文件保存到相同的可执行文件路径(从允许列表)。问题是,exe无法运行。似乎exe在使用Windows设备门户保存到计算机上时可以运行,但当UWP应用程序将其保存到计算机本身时,它无法运行

我想出了另一个解决方案,我制作了一个Win32程序,它现在是这样工作的:

Windows UWP应用程序启动器从允许列表中的路径启动Win32中间程序(此程序使用Windows设备门户上载一次,并且从不更改)。Win32中间程序具有从internet下载可执行文件并将其保存在磁盘上的功能,然后使用Win32 API CreateProcess运行此可执行文件。它工作,exe启动。但是,问题是新进程无法将任何文件保存到磁盘(为什么?)


解决办法是什么?我如何使用Windows UWP应用程序下载Win32可执行文件并运行它?

当你说新进程无法写入磁盘时,你观察到了什么?有具体的错误代码吗?你想写信到哪里?请在MSDN论坛()上遵循此线程。