Results 1 to 2 of 2

Thread: Qt Installer Framework - Reading downloaded package version

  1. #1
    Join Date
    Jan 2015
    Location
    Tremp, Spain
    Posts
    14
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Qt Installer Framework - Reading downloaded package version

    Hi all,

    There seems to be very few folks using this tool, but I'll ask before migrating to a third party tool.
    Using QtIFW-1.5.0, so far I am able to generate an online installer for my Win-32 application. The installer downloads the appropriate package from my web server and performs some operations defined in the control script installscript.qs, e.g. writing some keys into registry and creating a desktop shortcut with an icon:

    Qt Code:
    1. Component.prototype.createOperations = function()
    2. {
    3. try {
    4.  
    5. // call the base create operations function
    6.  
    7. component.createOperations();
    8.  
    9. // Add some keys to registry;
    10.  
    11. var userProfile = installer.environmentVariable("USERPROFILE");
    12. installer.setValue("UserProfile", userProfile);
    13. var reg = installer.environmentVariable("SystemRoot") + "\\System32\\reg.exe";
    14. var key= "HKCU\\Software\\Company\\Product";
    15. component.addOperation("Execute", reg, "ADD", key, "/f");
    16. component.addOperation("Execute", reg, "ADD", key, "/v", "productId", "/t", "REG_BINARY");
    17.  
    18. // Add a desktop shortcut with icon:
    19. component.addOperation("CreateShortcut", "@TargetDir@\\MyExecutable.exe", "@UserProfile@\\Desktop\\MyExecutable.lnk",
    20. "workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\MyIcon.ico");
    21.  
    22. } catch (e) {
    23.  
    24. print(e);
    25.  
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 
    All right, but another key I need to write into registry is the package VERSION NUMBER, defined in the installer configuration file config.xml in tag <Version></Version>
    How can I get this value from installscript.qs ? I read --I'd said more: studied-- the docs https://doc-snapshots.qt.io/qtifw-ma...component.html and https://doc-snapshots.qt.io/qtifw-ma...installer.html and I have not found any reference to version.

    So any help would be appreciated.

  2. #2
    Join Date
    Jan 2015
    Location
    Tremp, Spain
    Posts
    14
    Thanks
    6
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Installer Framework - Reading downloaded package version

    This has been solved in this thread.
    Last edited by Laureta; 11th April 2015 at 17:40. Reason: spelling corrections

Similar Threads

  1. Replies: 3
    Last Post: 1st September 2012, 02:41
  2. make installer package
    By babygal in forum Qt Programming
    Replies: 5
    Last Post: 6th June 2011, 06:24
  3. Trojan in Qt 4.7.1 Windows Installer (Non Creator) downloaded from Qt Website
    By Gavin Harper in forum Installation and Deployment
    Replies: 2
    Last Post: 17th November 2010, 21:54
  4. Windows Installer package won't work.
    By rajveer in forum General Programming
    Replies: 0
    Last Post: 3rd November 2008, 09:15
  5. Creating Package Installer
    By AP.Sakkthivel in forum General Programming
    Replies: 3
    Last Post: 18th July 2007, 19:18

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.