Optimize plugin loading

This commit is contained in:
zhaoyafan 2025-02-13 00:17:22 +08:00
parent 490fec0dfb
commit 40cba2bb53
2 changed files with 24 additions and 19 deletions

View File

@ -4,6 +4,7 @@
#define MyAppName "%APPNAME%"
#define MyAppExec "%APPEXEC%"
#define MyAppVersion "%APPVERSION%"
#define MyAppBuildDate "%APPBUILDDATE%"
[Code]
function IsProcessRunning(ExeFileName: string): Boolean;
@ -38,7 +39,7 @@ end;
AppId={{225A7526-BAB4-4DBE-B5F6-9CE1BEACCB36}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion} ({#MyAppBuildDate})
VersionInfoProductName={#MyAppName}
VersionInfoProductTextVersion={#MyAppVersion}
VersionInfoProductVersion={#MyAppVersion}

View File

@ -1648,9 +1648,10 @@ class BrowserManager:
plugin_dict[plugin_id] = plugin_class
def load_plugins_from_external_module(self):
module_home = os.path.join(os.path.dirname(__file__), 'Packages')
module_home_list = [os.path.join(os.path.dirname(__file__), 'Packages'), os.path.join(self.runner.app_data, 'Packages')]
for module_home in module_home_list:
if (not os.path.exists(module_home)) == 1:
return None
continue
try:
plugins_classes_site = []
module_list = glob.glob(os.path.join(module_home, 'Plugin*.py'))
@ -2397,6 +2398,9 @@ class MainRunner:
).replace(
'%APPVERSION%',
self.app_version
).replace(
'%APPBUILDDATE%',
time.strftime('%Y%m%d', time.localtime())
).replace(
'%DISABLEX64%',
'' if platform.architecture()[0] == '64bit' else '; '