Auto-fill SDK Path property when installing armory.py through setup guide.
Unfortunately, I think the only way to achieve this is to rename armory.py into __init__.py and zip the SDK folder so it is copied into Blender's addon directory too. Also, preferences.addons["armory"] would then have to be changed to preferences.addons[__package__], there might be even more to change.
The problem is that Blender first copies (and extracts if required) the selected file (.py or .zip) to it's addon/scripts directory and registers it only after that, so there is no way of getting the original location of the installed addon file.
I don't know if installing a .zip instead is a good solution, Blender will also take a while to unpack a ~670MB SDK. But as the SDK comes zipped anyway, we could give the user a choice. Either install the whole .zip or the __init__.py only, the latter would still require the user to point to the SDK path. Maybe this is too complicated and we should just keep things the way they are. It is not that much of an issue to copy the SDK path into the addon preferences after installation.
Just my two cents on this topic.
I discovered one possibility - upon installing armory.py, Blender will log a message into info window:
Info: Modules Installed () from 'C:\Users\lubos\Downloads\ArmorySDK\armory.py' into 'C:\Users\lubos\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons'
Afterwards, calling bpy.ops.ui.reports_to_textblock() will dump the info window contents into text data block which we should be able to read and retrieve the path.
Implemented in https://github.com/armory3d/armsdk/pull/8. Thanks for the hint to reports_to_textblock() :)
Holy smokes! Amazing, nicer setup incoming in Armory 2019.11.
Included in ArmorySDK1911 + updated wiki.
Most helpful comment
Implemented in https://github.com/armory3d/armsdk/pull/8. Thanks for the hint to
reports_to_textblock():)