Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt IFW access file name of installer exe
Forum Updated to NodeBB v4.3 + New Features

Qt IFW access file name of installer exe

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
3 Posts 2 Posters 403 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christoph Schaefer
    wrote on 8 Apr 2020, 09:08 last edited by
    #1

    I have an installer that contains a unique ID in its file name. For example, "my-installer-123456.exe". Is there a way to read the original file name during the installation?
    I could not find anything in the Scripting API.

    K 1 Reply Last reply 8 Apr 2020, 09:16
    0
    • C Offline
      C Offline
      Christoph Schaefer
      wrote on 15 Apr 2020, 13:29 last edited by
      #3

      There is a predefined variable "InstallerFilePath" to solve my issue.

      installer.value("InstallerFilePath");
      

      During my search I came across other interesting solutions. For example, you can also list all running processes and then search for your own name via RegEx. Maybe this approach is also interesting for somebody.

      // list the names of all running processes
      var outputArr = installer.execute('cmd.exe', ['/C', 'wmic process get name']);
      var id = "";
      if(outputArr.length == 2) {
        // match the name of "my-installer-123456.exe" and extract the numerical id
        id = outputArr[0].match(/my\-installer\-(\d+)/i)[1];
      }
      
      1 Reply Last reply
      1
      • C Christoph Schaefer
        8 Apr 2020, 09:08

        I have an installer that contains a unique ID in its file name. For example, "my-installer-123456.exe". Is there a way to read the original file name during the installation?
        I could not find anything in the Scripting API.

        K Offline
        K Offline
        koahnig
        wrote on 8 Apr 2020, 09:16 last edited by
        #2

        @Christoph-Schaefer

        This is merely a user forum and responses to IFW are rather scarce. With such a deep-inside question you might have better chances with the Qt developer's mailing list.

        Vote the answer(s) that helped you to solve your issue(s)

        1 Reply Last reply
        0
        • C Offline
          C Offline
          Christoph Schaefer
          wrote on 15 Apr 2020, 13:29 last edited by
          #3

          There is a predefined variable "InstallerFilePath" to solve my issue.

          installer.value("InstallerFilePath");
          

          During my search I came across other interesting solutions. For example, you can also list all running processes and then search for your own name via RegEx. Maybe this approach is also interesting for somebody.

          // list the names of all running processes
          var outputArr = installer.execute('cmd.exe', ['/C', 'wmic process get name']);
          var id = "";
          if(outputArr.length == 2) {
            // match the name of "my-installer-123456.exe" and extract the numerical id
            id = outputArr[0].match(/my\-installer\-(\d+)/i)[1];
          }
          
          1 Reply Last reply
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved