• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSXA Automatically Activating Scenery...

Messages
1,964
Country
unitedkingdom
What does it take to activate a scenery after installing it? And deactivate it before uninstallation. Can a script be run like an NSIS installer?
 
Yes, my NSIS installer adds it to the Scenery.cfg. It is a tricky business, though, you really need to test that sort of thing a lot, as nothing loses customers like a script which scrambles your scenery.cfg...
I give a choice, so those who like to manage their own scenery library can bypass this part of the install.
 
Ah thanks. Well, can't actually tell in the scenery.cfg where my activated sceneries are. There's just numbers and layers.
 
If you try to modify the scenery.cfg and fail, it will cause utter chaos.
 
It can be done. However, I use Inno.

It installs the scenery folder (main folder, Scenery and Textures subfolders) with a single line; a flag that tells it to delete on exit.

If you search these forums, you will eventually run across a small, free, app that will auto install the scenery. I'm sorry I don't remember the thread.

2 steps:

1 - Installation: You install the scenery to your folder, load the app, install the app, run the app (the scenery config file is updated) and then have the installer remove the app when done (part of the install process). In Inno this is 3 lines, one to install the app, one to install the config file to that points the app to the scenery folder, and one to run the app, with a flag set to delete both files when done.

2- Un-install: This is a more work. Inno supports Pascal scripting…which is what you must do. But first let give all credit for this method to my colleague & mentor, Fermin Fernandez of FSWidgets. I gave t a good try however, he had to come to the rescue

You essentially write a Pascal based sub routine that takes the EXACT name of your file area as a constant string. You also need an integer variable.

You first use Inno/pascal commands to find the directory where the Scenery.cfg lives. Then you start a do loop function that reads each section of the file, incrementing the integer variable each loop, until it finds the section that matches your file area (the string constant), - it then deletes the section (using the integer value as the section identifier) and drops out. of the Loop. If you have added scenery areas after the one you are deleting, no problem, FSX doesn't care if the list has a gap.

I'm on my MacBook Air so I don't have the code in front of me. If you decide to use Inno, let me know and I'll post it.
 
This is way beyond me atm. But I'll have a read into it when I get the chance. Thanks for sharing!
 
Back
Top