Prepare exe for distribution

May I ask you for some recommendations?

Development machine – Windows 7 64bit IDE – Delphi 7 pro (with 7.1 update) Target machine for install – Windows XP (SP3) – NB this is the Win 7 Virtual Machine 

I created a small application, nothing more than a test application. Grid, TADOConnection, connected to MS accdb file and several TADOTables. Using Inno Setup, I also created an installer. I promise this is a very simple application.

When I install the application on the XP virtual machine, everything goes according to plan, that is, an error message and the installer terminates. However, the application does not start. On the same XP virtual machine, I installed D7 and, where it is strange, if the IDE is running, my application will start without problems. If I close the IDE, it, my application, will not work again.

All I get is an hourglass for a second or two, and it’s not ... an error message, not a single horrible MS dialog asking me if I want to send them information about this terrible application, in fact I do not receive no reviews.

NB. Regardless of whether it is running from the IDE or outside the IDE on the Win 7 computer, the application works fine.

I am clearly missing something completely obvious, but I lost. I even tried ....

 program Project1; uses Dialogs, Forms, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} begin Application.Initialize; ShowMessage('Starting'); Application.CreateForm(TForm1, Form1); Application.Run; end. 

But I do not see the ShowMessage dialog box.

I read a lot of "Hello World tutorials". Got a lot of knowledge from generous SO contributors (thanks). But there should be another tutorial that teaches me what to do to β€œprepare my application for inclusion in the installer. I thought that if I uncheckedβ€œ Build with runtime packages in Project Options ”and then Project> Project Build, I could would create a file with everything I need to run the application outside of the IDE.

May I ask if someone can point me to the last piece of the puzzle, please?

By the way, is there a way to debug the executable file outside the IDE? Maybe some kind of switch in Delphi that will create a log file when the application starts ... or try.

Thank you for your time?

Regards, John.

EDIT . I mentioned earlier that the file will work outside of the IDE on my W7 machine. I got it wrong ... it will not work if D7 is not working and not working. In addition, I made a copy of the source folder with this file and started messing around with the project options switches. Suddenly, a new file is twice the size and works fine. Problem ... I cannot reproduce everything that I changed in the source file / project to know exactly what I did, this is the reason / fix.

Edit 2 - OK - the problem is definitely related to different file sizes. I created a folder on the XP volume and dropped a copy of all my BPLs from the Output directory in Win 7 Delphi install. Threw my exe (a file that does NOT run outside of the IDE) there, as well as my accdb file. Double click and ... Hey Presto - it works. the grid displays my sample data ... beautiful.

Here's the thing ... Project> Options> Packages> Build with runtime packages not verified. This should create a LARGE exe file for me - (that's right), but it creates a relatively small exe that needs a BPL !!!!

Will do some more tests ...

+4
source share
1 answer

You probably have a connection related to the idea.

This allows you to see how everything will look like with real data in the IDE, but now when you start the application, it tries to connect right at the beginning, when, perhaps, not everything is configured correctly.

One possible solution is to disconnect the connection component and connect at a later stage, for example, using the "connect" button.

At the very least, it will be easier to handle such exceptions correctly.

0
source

All Articles