tags:

views:

116

answers:

5

how do i turn my VC++ 2008 program into something i can get to run on other computers. i have tryed using the .exe it makes in the debug but it will say that im missing some files and lists all of my .cpp file names and .h files(if i use it on other computers). i wanted something so i could encrypt my files because one of them is about encrypting passwords/other stuff so i can't have someone just open my files. also i would very much like someway to make them accept the terms and conditions so they can't sue me if they lose something, that would be very very nice. ^^

i only have Microsoft virtual c++ 2008 express edition that i got from their web site.

o also if i make something on windows 7 will it run in xp or vista?

A: 

if you are compiling using .NET 3.5 in Win 7 it should work in xp and vista as well (provided .NET 3.5 framework is installed on them).

aggietech
i don't think there's an easy to redistribute your app using the express edition of visual studio ... there are some tools out there but you'll need to know what libraries are needed for your app.See this thread : http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/af1b898e-d882-4695-b0d0-09e3285436e2
aggietech
InstallSheid :| huh i have heard about it but it costs money right?i was making free software.. so i did not really want to pay for.. it because i was going to keep updateing it so i would have to keep making new ones :|
blood
+1  A: 

You will need the redist pack for the binary to run on another machine (if it does not already have the pack installed).

dirkgently
Right. You usually add it into your Deployment Project as a merge module. Or he could statically link to the RTL to avoid this.
Steven Sudit
^^ tyvm, and it's very nice of you to add the link it is very helpfull
blood
+1  A: 

You need to make a Deployment Project that generates an MSI, but I'm not sure your Express edition does that. As for encryption, compilation doesn't do that, and nothing stops people from disassembling your code. Finally, you probably should not be writing your own encryption algorithms, since most people get those wrong most of the time. Use something out of the box.

Steven Sudit
:| err ... i know what im doing... mostly. it's somewhat a project for school and i have always wanted to do this so :| ty.. but..
blood
+1  A: 

You generally can't and almost never should distribute debug builds to client machines. At least three reasons.

  1. Client machines will not have the debug versions of your dependant libraries, like the VC runtime (msvcrtd.dll), so they won't be able to run your app.
  2. When compiling in debug, your code will in many ways run unoptimized. For one thing, you don't let an optimizing compiler optimize when you compile in debug, so it will run slower and/or fatter. For another, there are debug version of things like operator new which allocate much more than you ask for, which is used in runtime integrity checking etc. So your program runs fatter & slower once more.
  3. When you compile in debug it is easier to reverse-engineer your code.

UPDATE:

And to answer your question if a Win7-compiled app will run on XP/Vista, the answer is 'yes' so long as you don't use any Win7 features.

John Dibling
A: 

The first part is already answered (release build, include redistributable C++ DLLs).

The second part, running on Vista/XP is not that trivial.

If you write a pure C++ program, it will run on XP and Vista, unconditionally. But once you include <windows.h>, you introduce a dependency on a minimum Windows version. The default today is still XP. That means that you cannot use any Vista or W7 feature directly, and therefore your program can run on XP.

But if you #define WINVER 0x0600 before including <windows.h>, then you can use Vista-specific functions. The price you pay for using those Vista functions is that your program won't start on XP anymore. Similarly, #define WINVER 0x0601 also gives you access to Windows 7 functions, on top of the XP and Vista functions. And again, using a Windows 7 function stops you from running on XP or Vista.

There are some tricks that allow you to use Windows 7 functions if available. Basically, they all boil down to calling GetProcAddress("some_windows7_function") and somehow handling the case where it returns NULL.

MSalters