-1

I'm new to Delphi (having previously used Visual Studio at a low level) and am struggling to understand how to compile a project into a final application/installer. I have downloaded Inno setup which I think is a step in the right direction. I use XE3.

Any help appreciated.

Warren P
  • 65,725
  • 40
  • 181
  • 316
user1365875
  • 139
  • 2
  • 4
  • 15
  • 1
    It's unclear for me. You want to know how to compile, or create a setup for your project? (You said compile in the title, and in the question you're asking for setup instructions) – Javid Apr 04 '13 at 12:01
  • I don't think there's any need to close this question, as it is pretty clear what's being asked here. – Thorsten Dittmar Apr 04 '13 at 12:02
  • 2
    @Javid: That's exactly what should be pointed out - in Visual Studio, you can add "Installer Projects" to your solution, which are compiled during the normal compilation process. Result is an MSI which installs the application. This, however, can not be done in Delphi that easily. – Thorsten Dittmar Apr 04 '13 at 12:03
  • I just don't understand how to create an installer/final application for your project. Or even how to turn it into an exe? – user1365875 Apr 04 '13 at 12:41
  • Ah Ok I'm getting somewhere. So When you've compiled the exe you create an installer using something like inno? – user1365875 Apr 04 '13 at 12:44
  • Did older versions came shipped with an installer or am I wrong? – Bogdan Doicin Apr 04 '13 at 13:37
  • @Bogdan: Yes, there used to be InstallShield Express, but that had to be installed separately and also did not integrate with Delphi. – Thorsten Dittmar Apr 04 '13 at 13:42
  • @user1365875: Yes! You compile your project and then use third party software to create an installer. Something like a built-in setup project does not exist in Delphi. – Thorsten Dittmar Apr 04 '13 at 13:43
  • However since Delphi EXEs can be run by themselves without any runtime dependencies, generally, you could even do without an installer. Unzip, and run. :-) – Warren P Apr 05 '13 at 03:38

2 Answers2

5

Delphi is not able to compile an InnoSetup project (EDIT The Delphi compiler itself can't compile an InnoSetup project. The Delphi IDE can do about anything using Post Build events) and as far as I can remember my Delphi days, there is no such thing as an "Installer Project" in Delphi like there is in Visual Studio.

A Delphi project is compiled into an exe/dll. You then use an InnoSetup script to describe how InnoSetup should install your application. Then you use the InnoSetup compiler to compile the script and your required other files into a setup.

Edit
To clarify what I'm trying to say:

There's no such thing as a "Setup Project" in Delphi, while it exists in Visual Studio. However, you can of course compile a setup script for a third party setup creator (like Inno Setup) in the project's Post Build event.

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139
  • Sure it is, if you want to. You can make an install script, which you'll build through the InnoSetup's command line compiler from Delphi's post build event. – TLama Apr 04 '13 at 12:57
  • Of course you can do anything from a post build event. But that is not the same as adding an Installer Project in Visual Studio. Also, I didn't say it is not possible to *build* an Installer Project, I said it is not possible to *add something like an Installer Project in Visual Studio*, which is something completely different. – Thorsten Dittmar Apr 04 '13 at 13:03
  • Well, at least *"Delphi is not able to compile an InnoSetup project"* is quite misleading because of those Delphi post build events and ability of InnoSetup compile script from command line. – TLama Apr 04 '13 at 13:21
  • I agree that this question can be clarified by adding that a post-build event can be used to create a final installer. – Leonardo Herrera Apr 04 '13 at 13:39
  • I tried to clarify my answer to make things easier to understand. I hope we can agree on the new version? – Thorsten Dittmar Apr 04 '13 at 13:46
  • @Thorsten, that looks better! [+1] – TLama Apr 05 '13 at 09:15
0

EDIT: the original post asked for a way to compile a Delphi project. The new redaction of the question makes this answer look silly.

once you have Delphi installer, you might simply compile your project by invoking the command-line compiler

DCC64 project

this will recompile all the required units, if needed, and generate the resulting EXE file.

PA.
  • 28,486
  • 9
  • 71
  • 95
  • 2
    Surely you mean msbuild rather than dcc64 – David Heffernan Apr 04 '13 at 11:54
  • I meant DCC64 for compiling a Delphi project, I could have misunderstood the question. – PA. Apr 04 '13 at 14:57
  • @PA, AFAIK since Delphi 2005 MSBuild is supported and IMHO the easiest way to compile a Delphi project. Since you mention DCC64 and not DCC32, you're thinking on XE2+ so you may be outdated on how to compile a project nowadays. At the end DCC32/64 is called, but MSBuild takes care of how to call it. – jachguate Apr 05 '13 at 03:44