I'm interested in distributing an application I've written in C++. What I want to end up with is basically the old method of distributing CDs and having an autorun file do most of the work; I want to be able to send files that non-tech-savvy people can use to compile/install my .cpp source code on their machines and end up with a functioning .exe file.

I'm looking into programs for creating installation packages, based on suggestions I've read here on similar matters. I've read some tutorials on NSIS in particular and I'm somewhat confused as to what precisely these programs actually do. The tutorials make it seem trivially easy to create packages to install .txt files on other machines, but that seems pointless; .txt documents don't need to be compiled to be read, and there's no particular reason they should require an installation package for distribution. Do NSIS and related programs simply automate copy and pasting? What I'm looking for is a program that can take my .cpp source code and compile/install it on other machines that may not already have a C++ compiler, and to do so as conveniently as possible in case the recipient isn't tech-savvy (preferably just by running some sort of setup.exe). Do NSIS and similar programs have this capability, or are they only good for sending someone my source code in its uncompiled format? Should I be looking elsewhere instead?

I'm using Visual Studio 2010 Express, but without the support for installation packages. Bad timing on my part, apparently.

Additionally, can I do this in such a way that the recipient of the package will not be able to read the contents of my source code, like if the program I've written implements RSA encryption and I don't want users to know what block size or modulus I've chosen?

Thank you kindly for your help.

有帮助吗?

解决方案

Packages normally contain the executable code, not the sources. You would compile your code for the target machine, then package it up, so that the user can install it. It is a bit more than copying and pasting, since ideally it would also make necessary changes to the system configuration, as well as record enough information to be able to remove the installed files later.

(Think of it this way: if you install Visual Studio, you're not compiling it, as you have nothing to compile it with at the time of the installation. And yet, it comes in a package.)

The last point is thus obvious: if you don't package up your source codes, people will not be able to read them. However, do not rely on "security by obscurity" - if someone has sufficient skill, they can disassemble or decompile your program.

其他提示

No. Installers (at least for Windows) contain all the files you'll need on the target system, usually in compressed form. It's still your responsibility to create these files, e.g. by compiling them.

Installers aren't always needed. Sometimes on Windows you'll see the term XCOPY install or XCOPY deployment. This refers to the XCOPY utility which can copy an entire directory structure. Many programs will run if you just copy the whole program directory to the appropriate Program Files directory.

However, even in those simple cases installers can help figuring out where that Program Files directory is, where to add shortcuts for the Start menu, and how to deal with uninstallation.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top