这是我的.pro档案:
TEMPLATE = app
TARGET = myapp
INCLUDEPATH += .
win32 {
RC_FILE = win32/myapp.rc
}
unix {
target.path = /usr/share/myapp/
shortcutfiles.files += unix/myapp.desktop
shortcutfiles.path = /usr/share/applications/
data.files += unix/myapp.png
data.path = /usr/share/pixmaps/
INSTALLS += target
INSTALLS += shortcutfiles
INSTALLS += data
}
SOURCES += myapp.cpp
QT += webkitwidgets
RESOURCES += \
myapp.qrc
Run Code Online (Sandbox Code Playgroud)
在linux下,该make uninstall命令在删除实际安装的文件和文件夹时,尝试删除/usr/share/applications/和/usr/share/pixmaps/文件夹(with rmdir); 并且因为它们不是空文件夹,所以它失败并显示错误代码1(实际上被忽略).
如何修改我的.pro文件以防止make uninstall尝试删除这些系统文件夹?
谢谢.
我正在ubuntu下用i586-mingw32msvc交叉编译一个应用程序.
我很难理解如何嵌入清单文件以使用mingw32要求管理员执行级别.
对于我的例子,我使用了这个hello.c:
int main() {
return 0;
}
Run Code Online (Sandbox Code Playgroud)
这个资源文件hello.rc:
1 Manifest "hello.exe.manifest"
Run Code Online (Sandbox Code Playgroud)
这个清单文件hello.exe.manifest:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="hello" type="win32"/>
<description>Hello World</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Run Code Online (Sandbox Code Playgroud)
我编译我的资源文件:
i586-mingw32msvc-windres hello.rc hello.o
Run Code Online (Sandbox Code Playgroud)
我编译我的最终申请:
i586-mingw32msvc-gcc -O3 -Os -s -o hello.exe hello.c hello.o
Run Code Online (Sandbox Code Playgroud)
SigCheck不显示正在运行的清单文件sigcheck -m hello.exe.
现在,当我在Windows下运行我的应用程序时,它不会触发UAC(=不以管理员身份运行),而当我将hello.exe.manifest文件附加到同一文件夹时,它会触发UAC(如预期的那样).
我错过了什么?
EDIT1:摆弄资源黑客我已经开了Setup.exe,我用NSIS创建的文件,唯一明智的区别是,Manifest写MANIFEST在我hello.exe和 …
有没有办法使用预先填充的sqlite数据库和qwebview?我有一个使用该数据库的JavaScript应用程序.
我启用了离线存储,
QWebSettings::globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
Run Code Online (Sandbox Code Playgroud)
为它设置一个舒适的大小
QWebSettings::setOfflineStorageDefaultQuota(20*1024*1024);
Run Code Online (Sandbox Code Playgroud)
并设置位置:
QWebSettings::globalSettings()->setOfflineStoragePath(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/data/myapp");
Run Code Online (Sandbox Code Playgroud)
将数据库文件从qrc资源文件复制到该位置并不起作用;
QFile::copy(":/mydatabase.db" , QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/data/myapp/mydatabase.db");
Run Code Online (Sandbox Code Playgroud)
如何进行?
谢谢.