A Qt spreadsheet app shows stored files like unknown ones - c++

Here is the program and below is the screenshot of the issue.
I using Qt Installer Framework (QtIFW2.0.1) created an installer for that Qt app (the spreadsheet). Then installed it on my PC. Now when I create a New File and then save it on the Desktop (Windows 7 x64), the app handles the file but its shape is like unknown files!
Here are some samples:
I searched on the web and did these:
I edited the package.xml file and changed all #component.addOperation to #component.addElevatedOperation in the installscript file.
There were three operations all for creating shortcuts.
Now I seemingly should add this line of code into the code:
addElevatedOperation("GlobalConfig", "SystemScope", "Company", "App", "key", "value")
My question is, is it sufficient to solve the issue? And if so, where in the code, what .h or .cpp file to use it into, please?
If any other file is needed I will pleasantly upload it.

Related

To Determine if a .exe file is an setup file

I need to write a c/c++/kernel driver program where I can check if an .exe file is an Setup file where I can install new application in my computer (Like an .MSI file) or an normal application (For Example: If I Open an .exe file which is named as chorme.exe then it is an normal window application which only opens chrome browser , but if I Open an .exe file which is chromeinstaller.exe it is an installer which installs chrome browser in my computer).
Is there any way to determine if it's a setup file or just a application.
Microsoft itself tried to solve this with "Installer Detection" , and from their solution it becomes obvious that there is no hard solution. They look for:
Filename includes keywords like "install," "setup," "update," etc.
Keywords in the following Versioning Resource fields: Vendor, Company Name, Product Name, File Description, Original Filename, Internal Name, and Export Name.
Keywords in the side-by-side manifest embedded in the executable.
Keywords in specific StringTable entries linked in the executable.
Key attributes in the RC data linked in the executable.
Targeted sequences of bytes within the executable.
We can safely assume they're doing this because there is no ready-made solution.

import adobe xd file to c++ project

so im working on a bot and made an interface for it in adobe xd. My question is: can I import it to a c++ project somehow to be an executable. Im asking this because Ive only seen it used in webpages and not in an actual exe
The AdobeXd project file is an actual zip file. If you rename it to a ".zip" you can open it and see a bunch of json files, folders and images.
The artboards are in the manifest file and each will have a PATH value
Each artboard is in artwork/PATH/graphics/graphicContent.agc
The symbols/components are in the resources/graphics/graphicContent.agc file
The images are in the resources folder
Unless you're willing to write a parser for the Adobe XD file format, code to render it and code to process events to this gui, you should consider it "not possible".

Make a Qt/C++ program show its file types as known on Windows

Using Qt 5.9 I codded a spreadsheet program and then created an installer for it by Qt Installer Framework (QtIFW2.0.1). Then I sent the program to many of my friends. They installed the app on their Windows machine and now using it, but they have all have a common problem:
when they save files of the app, those files are shown as "unknown" files on Desktop.
The problem is only with the shape and appearance of the stored files not their functionality, and they are opened by the app if double clicked.
The question is, what changes in the code is needed to have the program make its files' shape/appearance shown known?
For example, we offer the code a specific shape using an image file or like that, to be mapped on the stored files and that way they are shown known.
This has actually nothing to do with Qt or C++ itself. You just need to register your file extension in Windows shell, so it can be understood by other Windows components/shells.
Here is general information about File Types and File Associations under windows.
You need to make some Windows Registry entries which look like this:
example.reg:
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\myfirm.myapp.v1\shell\open\command]
#="c:\path\to\your\app.exe \"%1\""
[HKEY_CURRENT_USER\Software\Classes\.myextension]
#="myfirm.myapp.v1"
Here you can read how it works in general
change myfirm.myapp.v1, .myextension and path to your .exe to your prefered names.
Now Windows will know what the files with extension .myextension should be opened by your app. And if you double click on this files your app will be run with path to file as an argument. You can get it in your main() function
To set icon for your extension add Registry entry in Software\\Classes\\.myextension\\DefaultIcon and set it default value to the full path to your app, so windows can get an icon for extension from your .exe app file.
You can also do it at runtime directly in your app:
QSettings s("HKEY_CURRENT_USER\\SOFTWARE\\CLASSES", QSettings::NativeFormat);
QString path = QDir::toNativeSeparators(qApp->applicationFilePath());
s.setValue(".myextension/DefaultIcon/.", path);
s.setValue(".myextension/.","myfirm.myapp.v1");
s.setValue("myfirm.myapp.v1/shell/open/command/.", QStringLiteral("\"%1\"").arg(path) + " \"%1\"");
EDIT: One more, to do it with Qt Installer look at the answers here

Errors I face at the final step of creating an installer for my Qt app

EDITED:
Hi all,
I used the Qt Documentations for creating an installer for my Qt app using Qt Installer Framework.
I think I'm at the final step. Please have a look at the issue:
I have a package_directory folder on my Windows Desktop with these sub-folders. The config.xml file contains this. The data subfolder contains the data.7z file. I then created a licens.txt file on my Desktop. The meta subfolder contains a package.xml file with this content.
Then I created a folder named Result on my Desktop and pasted the Cal.exe file from the Release folder onto it.
And finally Ran the following command:
C:\Qt\QtIFW2.0.3\bin\binarycreator.exe -c C:\Users\CS\Desktop\package_directory\config\config.xml -p C:\Users\CS\Desktop\package_directory\packages C:\Users\CS\Desktop\Result\Cal.exe
The installer was created in the Result folder. But I got the following message from the command line:
Warning: The <Name> tag in the 'C:/Users/CS/Desktop/package_directory/packag
es/com.vendor.product/meta/package.xml' is ignored - the installer uses the path
element right before the 'meta' ('com.vendor.product').
C:\Qt\QtIFW2.0.3\bin>
Should I ignore it? If not how to solve it, too, please?
The installer file exists in the Result folder on Desktop. When I install it and select a folder on Start Menu (say Accessories or Start Up) to have the shortcut of the program, no shortcut will be created or saved there!! :(
What is the reason for that problem and how should I solve it please?

Trouble getting a Qt Reference Document program to work(Minehunt)... its just blank when run... no errors though?

http://docs.huihoo.com/qt/4.7/demos-declarative-minehunt.html
When I build and run... I just get a blank white rectangle... game is MineHunt.
The source code is in the URL. I created files and copied and pasted into Qt Creator 4.7.
Running in Linux.
No need to downvote. Deploying qml apps does not seem to be easy for beginners. jdl, I don't know if I can help you. Currently I am only on Linux. But what I did:
I copied the whole folder minehunt in my destination folder (/tmp/mine). When I ran qmake I got:
WARNING: Include file
/tmp/mine/helper/qmlapplicationviewer/qmlapplicationviewer.pri not
found
So I also copied the examples/declarative/helper folder into /tmp/mine.
Looked like this:
/tmp
/mine
/minehunt
/helper
Then I changed into minhunt, did 'qmake' and 'make'. A few seconds later I had a working minehunt binary in /tmp/mine/minehunt/.
I'll try tomorrow the Windows build.
Edit: Ok, tried now under Windows 7. Qt4.
QtCreator opened.
Project ...qt\demos\declarative\minehunt\minehunt.pro
loaded. Normally in release mode compiled. No problem. A file minehunt.exe was created in ....qt\demos\declarative\minehunt\release. Started: White screen. Exactly as you described it. In ...qt\demos\declarative\minehunt I found a folder 'qml'. I moved this folder and the minehunt.exe into another folder (myMineFolder). Simulating a simple deployment this way. Clicked on minehunt.exe -> worked like a charm.
So my folder layout:
myMineFolder
qml
minehunt.exe
But of course, I have set my PATH variable correctly to my Qt installation.