简体   繁体   English

自定义 exe 在 WinPE 上立即完成,不显示任何 output

[英]Custom exe completes instantly on WinPE without displaying any output

I have a C++ executable (built for x64) that is a command line program to capture some information about the machine it is running on.我有一个 C++ 可执行文件(为 x64 构建),它是一个命令行程序,用于捕获有关它正在运行的机器的一些信息。 I am trying to run it in a WinPE environment for the first time, the exe completes almost instantaneously without generating any text on the console or writing to a log file it is supposed to create.我第一次尝试在 WinPE 环境中运行它,exe 几乎立即完成,而不会在控制台上生成任何文本或写入它应该创建的日志文件。

This is what I did:这就是我所做的:

  • Followed instructions here to created a bootable WinPE USB flashdrive按照此处的说明创建可启动的 WinPE USB 闪存驱动器
  • Followed instructions here to add custom binaries, including the exe, to the image按照此处的说明将自定义二进制文件(包括 exe)添加到图像
  • Booted a machine into WinPE using the flash drive and executed my exe使用 flash 驱动器将机器引导到 WinPE 并执行我的 exe

The program runs fine on regular Windows, so I know there's nothing obviously wrong with it.该程序在常规 Windows 上运行良好,所以我知道它没有明显的问题。 I am wondering if there is something peculiar to WinPE or if I could be overlooking something else.我想知道 WinPE 是否有一些特殊的东西,或者我是否可以忽略其他东西。

I recently had the same issue and was able to figure out the problem.我最近遇到了同样的问题,并且能够找出问题所在。 The issue is there are some dependencies in the binaries that are not available in WinPE image.问题是二进制文件中有一些在 WinPE 映像中不可用的依赖项。

I use this tool https://github.com/lucasg/Dependencies to view the dependencies of the binaries and check the availability of the dependencies in WinPE image (windows\system32<dependency>).我使用这个工具https://github.com/lucasg/Dependencies来查看二进制文件的依赖关系并检查 WinPE 映像(windows\system32<dependency>)中依赖关系的可用性。 The program should run by coping the missing dll into WinPE or editing the build config to remove the dependencies from the binay.该程序应该通过将缺少的 dll 处理到 WinPE 或编辑构建配置以从二进制文件中删除依赖项来运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM