File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
qgis_deployment_toolbelt/commands Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 14
14
import argparse
15
15
import json
16
16
import logging
17
+ import sys
17
18
from os import getenv
18
19
from pathlib import Path
19
20
from sys import platform as opersys
25
26
26
27
# submodules
27
28
from qgis_deployment_toolbelt .__about__ import (
29
+ __package_name__ ,
28
30
__title__ ,
29
31
__title_clean__ ,
30
32
__uri_repository__ ,
@@ -61,7 +63,7 @@ def get_download_url_for_os(
61
63
to get a download URL for a specific OS. Defaults to None.
62
64
63
65
Returns:
64
- tuple[str, str]: tuple containgin asset download URL (browser_download_url) and
66
+ tuple[str, str]: tuple containing asset download URL (browser_download_url) and
65
67
content-type (barely defined)
66
68
"""
67
69
opersys_code = opersys
@@ -232,6 +234,15 @@ def run(args: argparse.Namespace):
232
234
)
233
235
234
236
# -- DOWNLOAD ------------------------------------------------------------
237
+ # check if we are in frozen mode (typically PyInstaller) or as "normal" Python
238
+ if not (getattr (sys , "frozen" , False ) and hasattr (sys , "_MEIPASS" )):
239
+ logger .debug ("Running in a normal Python process." )
240
+ print (
241
+ "\n \n To get the latest version, run (adapt command to your environment):"
242
+ f"\n \n python -m pip install -U { __package_name__ } "
243
+ )
244
+ sys .exit (0 )
245
+
235
246
print (f"Downloading newer version of executable for { opersys } : { latest_version } " )
236
247
237
248
# select remote download URL
You can’t perform that action at this time.
0 commit comments