How to redistribute vc++ application from visual studio 2008

时间秒杀一切 提交于 2019-12-04 06:23:44

问题


I have developed a application in VC++ (Visual Studio 2008 version '9.0.30729.1SP').

When i just double click on exe file in another machine. it is giving me 'side by side' error.

I have checked that machine does not having anything inside 'C:\Program Files\Microsoft Visual Studio 9.0\VC' folder. (but having framework 3.5 installed)

What i need to do?I am very new in VC++ applications.

Please can anyone explain how can i merge everything into a setup from machine where i have compiled my application.

Even 'C:\Program Files\Microsoft Visual Studio 9.0\VC' folder also.

Please help in this issue.


回答1:


The best thing to do is to create a setup program. It will automatically install all necessary dependencies onto the user's machine, along with your application. You definitely don't want to try to find all of the libraries it depends on by manually scouring your drive. And static linking is generally not a preferred option, as it means your app won't automatically take advantage of updates made to the runtime DLLs.

Visual Studio even has out-of-the-box support for creating an installer for your application. To use it, select File -> New -> New Project. Then expand "Other Project Types" in the dialog, and expand "Setup and Deployment". Click on "Visual Studio Installer", and choose to create a new "Setup Project".

   

Or, if you'd rather not use Visual Studio, the free, full-featured Inno Setup is a fantastic alternative.




回答2:


Install the Visual C++ 2008 Redistributable package on the other machine. This will ensure that all the required CRT libraries are available. If your application needs any other DLLs, they need to be in the same folder (or in the system path) as your application.

If you want to do it properly, I highly recommend Cody's answer. But if you want to quickly run an application which may or may not have external DLLs, then this method will work.



来源:https://stackoverflow.com/questions/5936724/how-to-redistribute-vc-application-from-visual-studio-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!