Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Qt installer framework: installer have problem create License folder during the installation
Forum Updated to NodeBB v4.3 + New Features

Qt installer framework: installer have problem create License folder during the installation

Scheduled Pinned Locked Moved Solved Installation and Deployment
2 Posts 1 Posters 1.4k Views
  • 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.
  • Q Offline
    Q Offline
    qtLove
    wrote on last edited by
    #1

    My package.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <Package>
        <DisplayName>DisplayName</DisplayName>
        <Description>Install the application.</Description>
        <Version>version</Version>
        <ReleaseDate>build_date</ReleaseDate>
        <Name>product name</Name>
        <Licenses>
            <License name="License Agreement" file="license.htm" />
        </Licenses>
        <Default>true</Default>
        <Script>installscript.qs</Script>
        <UserInterfaces>
                <UserInterface>aGUI.ui</UserInterface>
        </UserInterfaces>
    </Package>
    

    When I tried to install the program with the installer, all other files and folders are created successfully.
    Except the license file,
    I got the error message window pop up and said:

    Error during installation process. Can not write license file "C:\Program Files\<default installation folder>Licenses\license.html
    

    I have gain admin right with installer.gainAdminRights() and have checked it return true.

    I did a bit testing and found if the <default installation folder> is created beforehand then this issue wont happen.
    But if the <default installation folder> is created by the installer which is how it suppose to be, the error happen.

    I assume that this have something to do with the admin right? but I should have gained it and there is no problem for creating other files and folders.
    Have anyone encounter this before?
    Thank you for the comment and time

    1 Reply Last reply
    1
    • Q Offline
      Q Offline
      qtLove
      wrote on last edited by
      #2

      I found solution for this later.
      By adding

      <RequiresAdminRights>true</RequiresAdminRights>
      

      into package.xml
      and using

      component.addElevatedOperation("License");
      

      in the installscript.qs

      so the installer gain admin right for real.

      I was using installer.gainAdminRights() in the installscript.qs, but it did not really gain the admin right,
      so the error pop up during the installation.

      The other thing I can add is that if you have both adding the tag and the installer.gainAdminRights() in the script it will give a not enough memory error during the installation.

      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