Когда я запускаю исполняемый файл, созданный непосредственно PyInstaller, он работает правильно.
Однако после упаковки той же сборки с помощью Inno setup установленное приложение не запускается со следующим ошибка:
Код: Выделить всё
Failed to load Python DLL
'C:\Program Files\server.manager\_internal\python310.dll'
LoadLibrary: The specified module could not be found.
команда сборки:
Код: Выделить всё
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
; Non-commercial use only
#define MyAppName "server.manager Beta 1.0"
#define MyAppVersion "1.0 Beta"
#define MyAppPublisher "Minjae Software "
#define MyAppExeName "server.manager.exe"
#define MyAppAssocName MyAppName + " File"
#define MyAppAssocExt ".myp"
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{D02C21AB-0CD9-47EB-80B1-190B4C28A9FD}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
UninstallDisplayIcon={app}\{#MyAppExeName}
; "ArchitecturesAllowed=x64compatible" specifies that Setup cannot run
; on anything but x64 and Windows 11 on Arm.
ArchitecturesAllowed=x64compatible
; "ArchitecturesInstallIn64BitMode=x64compatible" requests that the
; install be done in "64-bit mode" on x64 or Windows 11 on Arm,
; meaning it should use the native 64-bit Program Files directory and
; the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64compatible
ChangesAssociations=yes
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only).
;PrivilegesRequired=lowest
OutputDir=C:\Program Files (x86)
SolidCompression=yes
WizardStyle=modern dark windows11
[Languages]
Name: "korean"; MessagesFile: "compiler:Languages\Korean.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "C:\dev\server.manager\dist\server.manager\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent- Версия Python: 3.10.10 (64-разрядная версия)
- Версия PyInstaller: X.Y.Z
- Режим сборки: onedir (или onefile — укажите)
- ОС: Windows 10/11 64-разрядная версия
- Каталог _internal существует после установки
- присутствует в этом каталоге
Код: Выделить всё
python310.dll - Исполняемый файл работает правильно до упаковки NSIS
- Копирование python310.dll вручную
- Восстановление с чистым кешем PyInstaller
- Запуск установленного приложения от имени администратора
Почему исполняемый файл не загружает python310.dll только после упаковки с помощью NSIS и как это можно исправить?
Подробнее здесь: https://stackoverflow.com/questions/798 ... -failed-to
Мобильная версия