Asaaj
Asaaj

Reputation: 272

Running C++ program on other machines

So I know it is a common question. I want to be able to run C++ programs on other Windows machines without installing Visual Studio on them. Naturally, I get the error message about a missing dll file. I was wondering if I could create an installer to just install that dll and then be able to run the program. Would that work or are there other needed files? If would, how would I do such a thing? It sure would be nice to have an automatic installer. Thanks

Upvotes: 1

Views: 105

Answers (4)

Jirka Hanika
Jirka Hanika

Reputation: 13539

Did you know that you do not have to install the whole VS to run your app there, but just the VS redistributable package that is probably even smaller (~5 MB) than your statically compiled application? You can also use the deployment bootstrapper if you want your app including prerequisites to appear to be made of one piece.

However, statical linking is also a good option, especially if your program does not consist of too many binary files and is performing a very simple task.

Upvotes: 0

Nepoxx
Nepoxx

Reputation: 5358

If you know exactly what dll files are missing, you could simply provide them next to your application, in a .zip file for instance.

Making a installer for windows is not an easy task. You might want to look into software that does it for you, such as Setup Factory (paid) or Nullsoft Scriptable Install System (free). These software will allow you to create professional looking installations pretty easily.

Upvotes: 0

Jerry Coffin
Jerry Coffin

Reputation: 490438

The usual way to figure out what DLLs (and controls, etc.) you need is with Dependency Walker.

Upvotes: 1

peeyush
peeyush

Reputation: 2931

See if there is any static compile option. There should be. So that you can compile your program statically, what would put all the necessary dll files in executable, so that you can move exe file on other windows platform, without install VS.

Upvotes: 1

Related Questions