Rebuild add-ons.cfg via command line switch argument?

SDK supports Prepar3D’s philosophy of an open development architecture and encourages third parties to bring new innovations with improved add-ons and training content.
Locked
Nick M
Posts: 11
Joined: Mon Jun 12, 2017 9:36 am

Rebuild add-ons.cfg via command line switch argument?

Post by Nick M »

Hi,

I'm working on an installer system for an add-on package. The installer uses the "-Configure: Category=Add-on Package, Operation=Add, Title=MyAddon, Path=[APPDIR]" command line switch argument if the user chooses a custom add-on directory and this works fine to update the ProgramData "add-ons.cfg" file.

The installer also needs to detect if the user has already installed any add-ons by the same developer, and if so where. To do this it reads the "path=" entry from the relevant line in the "add-ons.cfg" and this also works well.

However, a minor issue arises if the customer installs a product for the first time, then decides they'd prefer a different installation path and so uninstalls. In this case, the entry still remains in the "add-ons.cfg" and is not removed until the user launches the simulator, whereupon the "add-ons.cfg" file is rebuilt without the entries in question.

My question: is it possible to trigger this rebuild of the "add-ons.cfg" files via a command line switch argument rather than by actually launching the sim?

Many thanks,
Nick
Clifton Crane
Lockheed Martin
Posts: 1207
Joined: Tue Sep 25, 2012 2:34 pm

Re: Rebuild add-ons.cfg via command line switch argument?

Post by Clifton Crane »

Hi Nick M,

Have you tried using the Remove operation during the uninstall:

Prepar3D.exe "-Configure: Category=Add-on Package, Operation=Remove, Title=My Add-on"

Thanks.
Clifton Crane
Prepar3D® Software Engineer Sr.
Nick M
Posts: 11
Joined: Mon Jun 12, 2017 9:36 am

Re: Rebuild add-ons.cfg via command line switch argument?

Post by Nick M »

Hi Clifton,

Thanks for your reply.

I have considered using the remove argument, but the difficulty is that the add-on package uses various components shared with other add-ons by the same developer. Because of this, using the remove operation when one-add is uninstalled will disable all of them.

The operation which Prepar3D seems to perform upon initialisation (deleting an add-on.cfg entry if the relevant directory is not found) is perfect, but it doesn't seem possible to invoke this via the command line.

Regards,
Nick
Locked