1

I deploying an application built with runtime packages.

Is there any way to catch the error exception for missing packages files?

enter image description here

I would like to change the text and display some more system information.

As the application won't even start cause it depends on this file i don't know how to catch these kind of exceptions.

bummi
  • 27,123
  • 14
  • 62
  • 101
Schill
  • 35
  • 4

2 Answers2

1

There is nothing you could catch, as your program will not start running without the BPL file present. When you enable the option to Link with Runtime Packages, you have to ensure that all needed BPL files are available for your program. Usually you would place them in the same folder as your program, or place them in a shared folder that is included in the environment PATH if you want to distribute additional programs that use the same BPL files.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
bummi
  • 27,123
  • 14
  • 62
  • 101
  • I was hoping for atleast editing the diplayed text but i guess i'll have to live with it. Hopefully it is at least localized. Thanks for embedding the image btw :) – Schill Oct 27 '14 at 20:28
  • 1
    If you don't want to deploy BPL files, then turn off the `Link with Runtime Packages` option. – Remy Lebeau Oct 28 '14 at 03:55
  • @Schill All you need to do is make sure that you have a decent installation program that deploys the necessary files. It's not something that you need to be very worried about. – David Heffernan Oct 29 '14 at 11:18
  • @RemyLebeau Thanks, but i am aware of that. My programs architecture is designed to work with runtime packages. – Schill Oct 31 '14 at 18:37
  • @DavidHeffernan That's what i ended up doing. I tested my setup on serveral virtual machines (OSX Yosemite and Windows 7 - 10) and it works just fine. – Schill Oct 31 '14 at 18:39
1

You can create small app that checks all of needed BPL's for your main app and show Display warning as you want. If all is ok your app just run main app.

RainBoy
  • 27
  • 1
  • Well you could do this but it's probably not a good idea. Now you have an extra process, and the complexity that goes with it. You'd need to forward any command line arguments. And what if the invoking program waited for the process to terminate. Would you keep your bootstrapper alive until the real process finished? – David Heffernan Oct 29 '14 at 11:20
  • You have an extra process just for a moment of time. Also, it is very easy to resend all of the command line arguments. I'm not sure we have some problems with invokers right here, because it was not specified. There are no additional ways to replace info about missing bpl's in main program as i know. – RainBoy Oct 29 '14 at 15:23
  • And if the process was started with a call to `CreateProcess` and the parent process wants to wait until the process is finished, it cannot do so, because the process it started is not the real process. And the loader may fail for reasons other than there being missing .bpl files. So this mechanism won't detect all such failures. Isn't it just simplest to deploy the program correctly. – David Heffernan Oct 29 '14 at 15:25