To compile an executable version of MSFS Mobile Companion App using pyinstaller follow these 4 steps:
Change line 54 from:
app = Flask(__name__)
into:
if getattr(sys, 'frozen', False):
template_folder = os.path.join(sys._MEIPASS, 'templates')
static_folder = os.path.join(sys._MEIPASS, 'static')
app = Flask(__name__, template_folder=template_folder, static_folder=static_folder)
else:
app = Flask(__name__)
Rename the SimConnect.dll file into SimConnect.dllc.
Use the following pyinstaller settings to compile MSFS Mobile Companion App:
pyinstaller -F --onefile --add-data "templates;templates" --add-data "static;static" --add-data "SimConnect;SimConnect" glass_server.py