与Inno Setup一起安装时,Python/Qt/SQLite3应用程序无法运行 [英] Python/Qt/SQLite3 application does not run when installed with Inno Setup

查看:67
本文介绍了与Inno Setup一起安装时,Python/Qt/SQLite3应用程序无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Qt中有一个程序.因此,我使用windeployqt.exe . --quick创建了发行​​版,它具有一个SQLite3数据库,一些我用Python编译的模块,一个带有用户指南的帮助文件夹...看起来像这样:

I have a program in Qt. So I created the release with windeployqt.exe . --quick It has an SQLite3 database, some modules I compiled in Python, a help folder with a User guide... it looks like this:

现在,如果我直接从此处运行pymepos.exe,一切正常.数据库是干净的,Python模块被成功调用并执行. 如果我使用Inno Setup为此文件创建了一个安装程序,则在安装自己的程序后,我会发现我以前有一些旧文件存储在数据库中.而且它根本不运行我的Python模块.我在这里瞎了,因为我不知道发生了什么事(我没有任何日志文件或任何东西),如果我分别检查模块,它们似乎可以正常工作,但是主要的Qt程序无法运行它们

Now, if I run pymepos.exe directly from here, everything works fine. The DB is clean and the Python modules are called and executed successfully. If I create an installer with Inno Setup for this files, after installing my own program I noticed I have some old stuff it used to be in the database. Also it doesn't run my Python modules at all. I'm walking blind here since I can't know what's going on (i don't have any log file or anything), if I check my modules separately they seem to work fine, but the main Qt program can't run them.

因此,在这一点上,我重新安装了Inno Setup(认为它可能在某个地方有缓存),将我的发行文件移到了其他地方,并将文件读入了.iss.编译,什么也没有,同样.

So at this point I reinstalled Inno Setup (thinking it might have a cache somewhere), moved my release files somewhere else, readded files to the .iss. Compile and nothing, same thing.

此外,我确实注意到,以管理员身份运行已安装的pymepos.exe时,它将使用应该使用的干净数据库,但是模块似乎仍然无法正常工作. 有任何想法吗?

Also, I did notice that running the installed pymepos.exe as administrator it will use the clean database that it is supposed to use, but still the modules don't seem to work. Any Ideas?

这是我的.iss文件:

Here's my .iss file:

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

[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={{0BA2A484-5F5E-49F5-94AC-5C7410C70B30}
AppName=PYMEPOS
AppVersion=1.0.5
;AppVerName=PYMEPOS 1.0.5
AppPublisher=Cubix Softworks
DefaultDirName={pf}\Cubix506/PYMEPOS
DisableProgramGroupPage=yes
OutputDir=F:\installer_leon
SetupIconFile=D:\Proyectos\QT\PymePOS\project\res\icon.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "F:\release_leon\pymepos.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\D3Dcompiler_47.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\libgcc_s_dw2-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\libGLESV2.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\libstdc++-6.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\libwinpthread-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\opengl32sw.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Network.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Qml.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Quick.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Sql.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Svg.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\Qt5Xml.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "F:\release_leon\db\*"; DestDir: "{app}\db"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\help\*"; DestDir: "{app}\help"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\iconengines\*"; DestDir: "{app}\iconengines"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\imageformats\*"; DestDir: "{app}\imageformats"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\modules\*"; DestDir: "{app}\modules"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\platforms\*"; DestDir: "{app}\platforms"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\qmltooling\*"; DestDir: "{app}\qmltooling"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\sqldrivers\*"; DestDir: "{app}\sqldrivers"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "F:\release_leon\translations\*"; DestDir: "{app}\translations"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\PYMEPOS"; Filename: "{app}\pymepos.exe"
Name: "{commondesktop}\PYMEPOS"; Filename: "{app}\pymepos.exe"; Tasks: desktopicon

[Run]
Filename: "{app}\pymepos.exe"; Description: "{cm:LaunchProgram,PYMEPOS}"; Flags: nowait postinstall skipifsilent

推荐答案

这是一个非常模糊的问题.但是给您一些可能性:

This is pretty vague question. But to give you some possibilities:

  • 您的应用程序并非设计为从文件名(Program Files)中带有空格的路径运行
  • 您的应用程序需要对其安装文件夹具有写权限.从Program Files运行时,它没有的内容.当您以管理员身份运行该应用程序时,您遇到的问题较少,这表明这是问题之一.
  • Your application is not designed to be run from a path with a space in the file name (Program Files)
  • Your application needs a write access to its installation folder. What it does not have, when run from Program Files. The fact that you have less problems, when running the application as an Administrator suggests this is (one of) the problem.

要进行测试,请尝试安装显示为C:\PYMEPOS的应用程序.

For a test, try to install the application to say C:\PYMEPOS.

Ntb,Inno安装程序不缓存任何文件.重新安装Inno安装程序将无法解决任何问题.我认为您的问题实际上与Inno Setup没有任何关系.

Ntb, Inno Setup does not cache any files. Reinstalling the Inno Setup won't fix anything. I do not think your problem has anything to do with the Inno Setup actually.

另请参见通过Inno Setup安装后应用程序无法正常工作.

这篇关于与Inno Setup一起安装时,Python/Qt/SQLite3应用程序无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆