The problem of a .qs file when creating a shortcut



  • Hi all,

    I think you all have experienced this step and for me it's the first time.
    I'm going to create an installer for my Qt app using Qt Installer Framework.
    The scenario is as follows:

    I have a Qt Cal_app.exe file and a package_directory folder on my Windows Desktop with the following contents:

    • The package_directory's contents.

    • The config folder contains a config.xml file.

    • The packages folder contains a subfolder named com.vendor.product. And it, contains two other subfolders named data and meta.

    • The data subfolder contains a file named data.7z.

    • The meta subfolder contains three files: A license.txt file, a package.xml file, and a installscript.qs file.

    By a Command Line, I try to use the binarycreator.exe file to create the installer this way:

    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\Cal_app.exe

    The Command is run well and without any error and it creates an installer (program) named Cal_app on my Desktop.

    When I run that program to install it on my Windows machine, it will be installed and it also (like any usual program) creates a shortcut named Calon the Desktop. Until now everything OK.

    But the problem!
    The problem is that, that shortcut file (Cal) is an unknown file and it shows an error message!

    My question is, what is the problem with the installscript.qs file that creates an "unknown" shortcut, and how to solve it, so that it creates a useful shortcut please?



  • Couple of other questions. Does your software works from the directory where it is installed? Are able to create shortcut for your program manua and does it works ?



  • @tomy

    it sounds like the installer did exactly that, what you told him to do.

    The problem seems to be in the data folder. Here you'll have to place all necessary files and dlls your program needst o run, including your executable.

    If you pack your file to a *.7z file instead of placing them uncompressed into the folder. The installer does not know, that it has to unpack the files in the data folder, and you'll have to tell him, to do so.

    I'm not sure if or how you can tell the QtInstallerframework that the files in data-folder need to be unpacked. I'm afraid, I'm not using the framework often enough myself.



  • @dheerendra

    Does your software works from the directory where it is installed?

    It is installed in the InstallationDirectory directory in the path: C:\Users\CS. (as stated in the config.xml file <TargetDir>@HomeDir@/InstallationDirectory</TargetDir>).

    But the Cal.exe file doesn't work there!

    Are able to create shortcut for your program manua and does it works ?

    I think the problem is about the data subdirectory.

    @J.Hilk

    it sounds like the installer did exactly that, what you told him to do.

    The problem seems to be in the data folder. Here you'll have to place all necessary files and dlls your program needst o run, including your executable.

    If you pack your file to a *.7z file instead of placing them uncompressed into the folder. The installer does not know, that it has to unpack the files in the data folder, and you'll have to tell him, to do so.

    Yes, I, too, think that (as the error message in my previous post stated) the problem is of the data folder.



  • I tried to fix the issue of the data folder this way:

    I firstly placed the Cal.exe with its required .dll files into the data folder in its path:
    C:\Users\CS\Desktop\package_directory\packages\com.vendor.product\data
    I tested the Cal.exe and it worked fine.

    Then I ran the windeployqt on that data folder. The Command created some extra files and folders there. Now once again I went for testing the Cal.exe to see if it works or not. It didn't!!! It didn't work! :(

    Gave this error message.

    If it works after running windeployqt, I will make it a .7z file and go for creating the installer.



  • @tomy

    if it works after running windeployqt, don't make a .7z out of it, just copy the files as they are to the data folder.

    I know it says otherwise in the docu:

    Data Directory
    
    The data directory contains the content that the installer extracts during the installation. You must package the data as a 7zip archive (.7z). You can use either the archivegen tool that is delivered with the Qt Installer Framework or some other tool that generates 7zip archives.
    

    but I did not read that previously and the installer framework works 100% fine and correct for me. This entry might refer to an older version of the installer.



  • @J.Hilk
    Yeah, but the problem is that .exe file works before running the windeployqt, but not after it!! :(

    The data folder can be downloaded from here.



  • @tomy
    mmh
    seems like windeployqt uses outdated dll's.
    the dlls have the qt-versions code of 5.7.0.0 Did you compile for 5.7 or 5.8?

    I replaced the dll's with those from my qt5.8 folder and I could start your programm.



  • @J.Hilk

    sometime ago I was using Qt Creator 5.5.1. But when mrjj suggested using 5.7, I uninstalled 5.5.1 and installed 5.7.

    The program is built rand run using 5.7.
    Do you mean that I should uninstall 5.7 and install 5.8?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.