简体   繁体   English

重命名可执行文件会导致运行时出错

[英]Renaming executable causes error when run

I have created a small daemon (basically a console application that hides the console and runs).我创建了一个小型守护程序(基本上是一个隐藏控制台并运行的控制台应用程序)。

I need to send it to a user and have tried renaming the executable with a different extension, emailing it to the user, and having them rename it to the correct name.我需要将其发送给用户并尝试使用不同的扩展名重命名可执行文件,将其通过电子邮件发送给用户,并让他们将其重命名为正确的名称。

This seems to work when I email it to myself to test it.当我对自己进行 email 测试时,这似乎有效。 However, when the user tries to run the executable it produces the following error message:但是,当用户尝试运行可执行文件时,会产生以下错误消息:

This application has failed to start because the application configuration is incorrect.此应用程序无法启动,因为应用程序配置不正确。 Reinstalling the application may fix the problem.重新安装应用程序可能会解决问题。

What am I doing wrong?我究竟做错了什么?

You are missing some dlls.您缺少一些 dll。

You can figure out exactly which ones using dependency walker .您可以使用dependency walker准确找出哪些。

You could also install the Visual Studio Re-distributable package (x86) or Visual Studio Re-distributable package (x64) and that will probably fix your problem too.您还可以安装Visual Studio Re-distributable package (x86)Visual Studio Re-distributable package (x64) ,这也可能解决您的问题。

This is kind of funny... I just hit this error for the first time a few minutes ago at work.这有点好笑......几分钟前我刚在工作中第一次遇到这个错误。 In our case, we were using a C++ application and were trying to run the resultant executable on another computer on the network.在我们的案例中,我们使用的是 C++ 应用程序,并试图在网络上的另一台计算机上运行生成的可执行文件。 You need the Visual C++ Redistributable package .您需要Visual C++ 可再发行 package

I'm assuming here that you're using Visual Studio 2008 -- if it's a different version you may need that.我在这里假设您使用的是 Visual Studio 2008——如果它是不同的版本,您可能需要它。 Alternatively, you can just copy the DLLs with the executable and it will run like that.或者,您可以只复制带有可执行文件的 DLL,它就会像那样运行。

Let me know if this doesn't apply...让我知道这是否不适用...

Have the user verify that the hash of the executable is identical to the one you sent.让用户验证可执行文件的 hash 是否与您发送的相同。 It's not completely unusual for antivirus or other programs to mangle executables in ways that seek to defang malicious software but which also wreck perfectly innocent software.防病毒或其他程序以试图去除恶意软件但也破坏完全无辜软件的方式破坏可执行文件并非完全不寻常。

Also, make sure they have installed any required libraries, like the VC++ redistributable package (including the usual msvcrt*.dll shenaniganry).此外,请确保他们已安装任何所需的库,例如 VC++ 可再发行的 package(包括通常的 msvcrt*.dll 恶作剧)。

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

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