Using add-on.xml

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.
User avatar
aeronauta
Posts: 1661
Joined: Sun Oct 23, 2011 1:56 am
Location: Melbourne, Australia

Re: Using add-on.xml

Post by aeronauta »

ahuimanu if you installed scenery or anything else using add-on.xml in C:\Users\aero\Documents\Prepar3D v4 Add-ons the way to enable /disable it is via the Menu>Options>Add-Ons and tick/untick the corresponding box..

Addons added this way will not place an entry in the scenery.cfg.. or addons.cfg , only in addons.xml.

Jorge
Jorge Roldan
OZx Developer (aero) - Hovercontrol Helicopter Certified Pilot - Spad.Next Beta Tester - VATPAC Pilot PR
System i9-9990 4.7Ghz 32GB W11 Nvidia GeForce RTX 2080 8GB
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Re: Using add-on.xml

Post by virtuali »

aeronauta wrote: Mon Jun 05, 2017 5:14 amAddons added this way will not place an entry in the scenery.cfg.. or addons.cfg , only in addons.xml.

Not exactly:

- Addons that use the add-on.xml file method, by just creating a folder for them in the Documents\Prepar3d add-ons folder, will trigger the add-on discovery, so the users will be prompted by the sim to enable the addon at the next start. If the user accepts it, the add-on WILL be listed in the add-ons.cfg file under %APPDATA%\Lockheed Martin\Prepar3d.

It's really a good idea that addons would use this folder to place the add-on.xml file, so it won't be required to re-run the add-installer in case the sim is reinstalled from scratch. Unless, the installer must do something unusual, or must change something in the main sim folder.

- Addons that use the add-on.xml file method AND call up Prepar3d.exe from the command line (usually when installing) with the "Add" option, will be added to the add-ons.cfg file under %PROGRAMDATA%\Lockheed Martin\Prepar3d. Doing this won't trigger the activation question.
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
User avatar
aeronauta
Posts: 1661
Joined: Sun Oct 23, 2011 1:56 am
Location: Melbourne, Australia

Re: Using add-on.xml

Post by aeronauta »

Hi Umberto, I have many scenery add ons using the add-ons folder in C:\Users\aero\Documents\Prepar3D v4 Add-ons all request activation the first time and NONE has placed an entry in the C:\ProgramData\Lockheed Martin\Prepar3D v4\add-ons.cfg. All these add ons are listed in C:\ProgramData\Lockheed Martin\Prepar3D v4\scenery-_add-ons.xml, scenery.cfg does not list any of them.
Your second comment seems starnge as you cannot use add-on.xml method and call Prepar3d.exe , to call the prepar3d.exe you must not be running P3D... a contradiction, if you run the command line method , P3D must not be running , the add ons are listed in the scenery.cfg and depending on your setting of required / active will be possible to remove or move them in the Library GUI.

Jorge

PS I agree with you , ideally all add ons should be made via the Documents folder as recommended by LM.. tyey must sure have their reason , unfortunately some developers (ORBX) chose to not follow this to their own peril...
Jorge Roldan
OZx Developer (aero) - Hovercontrol Helicopter Certified Pilot - Spad.Next Beta Tester - VATPAC Pilot PR
System i9-9990 4.7Ghz 32GB W11 Nvidia GeForce RTX 2080 8GB
User avatar
kevinfirth
Posts: 191
Joined: Wed May 15, 2013 11:24 am
Location: Kidderminster, UK
Contact:

Re: Using add-on.xml

Post by kevinfirth »

WarpD wrote: Mon Jun 05, 2017 1:35 am
kevinfirth wrote: Thu Jun 01, 2017 10:00 pm
WarpD wrote: Thu Jun 01, 2017 9:51 pm Ok, I have no idea what is inside the folders you are referencing. Scenery tends to have two folders: Scenery and Texture. So, is that what is inside the folders you're referencing?
Yes just scenery folders with bgl's in them :)
So the folder PROC_SIDs has multiple Scenery folders in it?
No just one in each of the scenery folders.
Should note I've fixed this now and been able to add multiple sceneries.
The problem seemed to stem from the file encoding. I copied over an add-on.xml file from another product and altered the entries accordingly. Subsequent testing has shown that scenery entries _require_ a layer setting, and also a name. What confused me a bit was that without the name element P3D4 threw out a content error report saying TITLE was required. The disparity between the error report and the name element threw me for a short time..

Many thanks for your help! K
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Re: Using add-on.xml

Post by virtuali »

aeronauta wrote: Tue Jun 06, 2017 7:13 amHi Umberto, I have many scenery add ons using the add-ons folder in C:\Users\aero\Documents\Prepar3D v4 Add-ons all request activation the first time and NONE has placed an entry in the C:\ProgramData\Lockheed Martin\Prepar3D v4\add-ons.cfg.

That's precisely what I've said. Re-ready my post: I said that those with an add-on.xml in a sub-folder of the Documents\Prepar3d v4 Add-on folder, will trigger a request from the sim to activate the add-on on the next start, and if the user agrees, they will be listed in the add-ons.cfg file under %APPDATA%\Lockheed Martin\Prepar3D v4 NOT Programdata!!

There are possibly two copies of the add-ons.cfg: the one in %APPDATA% lists the add-ons that have been activated following an auto-discovery and a request to the user to activate them, while the one in %PROGRAMDATA% list the ones that were activated by an installer that started Prepar3d.exe from the command line with the "Add" command.

If none of these add-ons called Prepar3d.exe from the command line from their installer, it's normal they won't appear in the add-ons.cfg under %PROGRAMDATA%: they will be auto-discovered by the sim on the next startup, so they'll appear in the add-on.cfg file in %APPDATA% instead.
Your second comment seems starnge as you cannot use add-on.xml method and call Prepar3d.exe , to call the prepar3d.exe you must not be running P3D... a contradiction, if you run the command line method , P3D must not be running , the add ons are listed in the scenery.cfg and depending on your setting of required / active will be possible to remove or move them in the Library GUI.

Again, please re-read my post more carefully: I said calling Prepar3d.exe from the command line that way, it's *usually* done by an installer, so P3D is clearly not running at that time. And, calling Prepar3d.exe from the command line, won't load the whole sim: just the service to activate the add-on, so it's a very quick process, one that has been designed to be called from an installer.
PS I agree with you , ideally all add ons should be made via the Documents folder as recommended by LM.. tyey must sure have their reason , unfortunately some developers (ORBX) chose to not follow this to their own peril...

It's not really an issue, depending what else their installation requires.

The add-on.xml can be anywhere but, placing it in the Documents folder would trigger auto-discovery, which would help in case the user reinstall the sim from scratch, since all the add-ons still in the Documents folder would then trigger auto-discovery from the sim, so the user would just have to reply Yes to all the reactivation requests, instead of re-running an installer (which would, most likely, call Prepar3d from the command line to reactivate the addon).

So, by doing that, they forfeited the convenience of auto-discovery but, it might be or not an issue, depending what else the installer must be doing. If the installer would have to do something *else* to configure the sim, which cannot be achieved in any other way, for example copying/changing files in the root of the sim that would disappear if the user reinstalled the sim from scratch, NOT using auto-discovery might be best, so users won't risk activating add-ons not fully configured yet.
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
User avatar
aeronauta
Posts: 1661
Joined: Sun Oct 23, 2011 1:56 am
Location: Melbourne, Australia

Re: Using add-on.xml

Post by aeronauta »

Umberto, this is my last post on this issue, you read your post again and compare it with what I sad and see.
. Thankyou have a good day.

Jorge
Jorge Roldan
OZx Developer (aero) - Hovercontrol Helicopter Certified Pilot - Spad.Next Beta Tester - VATPAC Pilot PR
System i9-9990 4.7Ghz 32GB W11 Nvidia GeForce RTX 2080 8GB
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Re: Using add-on.xml

Post by virtuali »

aeronauta wrote: Wed Jun 07, 2017 10:09 amUmberto, this is my last post on this issue, you read your post again and compare it with what I sad and see.
This what you said:
I have many scenery add ons using the add-ons folder in C:\Users\aero\Documents\Prepar3D v4 Add-ons all request activation the first time and NONE has placed an entry in the C:\ProgramData\Lockheed Martin\Prepar3D v4\add-ons.cfg. All these add ons are listed in C:\ProgramData\Lockheed Martin\Prepar3D v4\scenery-_add-ons.xml, scenery.cfg does not list any of them.

To that, I replied that it's entirely NORMAL those might not be listed in the add-on.cfg in %PROGRAMDATA%\Lockheed Martin\Prepar3D v4\add-ons.cfg because, in order to appear THERE, something or someone must have launched Prepar3d.exe from the Command line with the "Add" command. As I've said, this is *usually* made by an installer.

If no installer or you personally did this, the sim will ASK if you want to activate them, and if you say Yes, they will appear in the %APPDATA%\Lockheed Martin\Prepar3D v4\add-ons.cfg INSTEAD.

The scenery_addons.xml file will contain those sceneries regardless if they have been added from the add-ons.cfg under %PROGRAMDATA% or the one in %APPDATA% so, there are 3 different files involved in the addition of such scenery:

1) The add-on.xml package, usually located in the Documents folder to allow auto-discovery. This is the only file that must be created by the user, or by the scenery developer.

2) The add-on.CFG file, either in %PROGRAMDATA% or %APPDATA%, depending how the scenery was activated (Prepar3d.exe from the command line, or confirming the activation at start). This doesn't need to be created manually, because the sim will create itself after the scenery is activated.

3) The scenery_addons.xml file, which is handled by the sim itself, to keep an updated list of all the areas not in the scenery.cfg

Then, you said:
Your second comment seems starnge as you cannot use add-on.xml method and call Prepar3d.exe , to call the prepar3d.exe you must not be running P3D... a contradiction, if you run the command line method , P3D must not be running

What's exactly "strange" or contradictory about this ? As I've said, the Prepar3d.exe is launched from the Command line usually from an installer, but this won't load the whole sim, it will just reconfigure the b]%PROGRAMDATA%[/b]\Lockheed Martin\Prepar3D v4\add-ons.cfg file, and will exit immediately.

How else do you think we do all our installers ? I swear we don't touch the add-on.cfg file directly, why doing that, when Prepar3d.exe itself can do that for you ?
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
User avatar
Grand_Pubah
Posts: 27
Joined: Tue Sep 09, 2014 6:37 pm
Location: Sacramento, California

Re: Using add-on.xml

Post by Grand_Pubah »

Is there a way to properly change the order the addons are placed? For example I want to move fsAerodata to the top of the list, but it currently shows at the bottom.
Keith (Grand_Pubah}
i7 13700k 3.4ghz MSI MPG Z790 Gaming Carbon Wifi Nvidia RTX 4080 FE 16gb CORSAIR VENGEANCE DDR5 RAM 64GB DDR5 5600MHz Windows 11 Pro (23H2) Prepar3D v5.4.9.28482 / v6.1.11 LG 34" Ultrawide Curved / ASUS 32" Curved
virtuali
Posts: 598
Joined: Tue Sep 27, 2011 12:51 pm

Re: Using add-on.xml

Post by virtuali »

Grand_Pubah wrote: Sat Jun 10, 2017 4:22 pmIs there a way to properly change the order the addons are placed? For example I want to move fsAerodata to the top of the list, but it currently shows at the bottom.
If you reorder them in the add-ons.cfg file by their Package number, the whole addon priority will be swapped. Or, if you want to reorder only a single area (addons can have more than one), you should add a <Layer>NNN</Layer> tag in their add-on.xml
Umberto Colapicchioni - VIRTUALI Sagl
http://www.fsdreamteam.com
Locked