7

Sometimes when I use the maintenancetool.exe on Windows with "Update components", an error is displayed after the update has been downloaded and installed saying:

Error during installation process (com.myapp.windows_x86_64): Can not write license file: C:\Program Files(x86)/MyApp/Licenses\license.txt

with an option to ignore the error, retry, or quit. I can't figure out how to prevent this error. My package.xml file has the following line:

<Licenses>
    <License name="MyApp Public License Agreement" file="license.txt" />
</Licenses>

and license.txt is stored in the same directory as package.xml as per the instructions in https://doc.qt.io/qtinstallerframework/ifw-tutorial.html#adding-licenses.

Edit: I realized I was inadvertently using qt installer framework version 1, so this may be bug QTIFW-315 as pointed out by Sergio. I have updated to version 3 and that seems to solve the problem.

user1389840
  • 651
  • 9
  • 24
  • I have the same issue with v3.0.4. It happens if installer call gainAdminRights(). But otherwise installer fires to user at least twice with elevation priveledges pop ups. – andrey.s Aug 16 '18 at 12:21

2 Answers2

2

It is a fairly broad question, and it is difficult to reproduce the same specific issue, hence the lack of answers.

I checked in the Qt bug tracker and nobody has reported a similar issue so far. It would be useful to know if this happens with different computers or just with one.

Usually you receive this kind of error messages either if the process doesn't have enough priviledges to write the file or if another process has locked the file. You may check if there is a process locking the license.txt file with utilities like Process Explorer (have a look here).

I hope this helps.

Sergio Monteleone
  • 2,776
  • 9
  • 21
  • It happens with every windows computer when updating, but not when originally installed. I noticed there's a weird mix of forward and backward slashes in the license path in the error message, but the error only occurs when updating. – user1389840 Apr 24 '18 at 15:46
  • I suggest to report this to the Qt bug tracker [here](https://bugreports.qt.io). There was an issue affecting ifw 1.3 ([QTIFW-315](https://bugreports.qt.io/browse/QTIFW-315?jql=text%20~%20%22installer%20path%20windows%20slash%22)). I would also suggest to update your question to include Qt and QT IFW versions you use, and the content of the package.xml. – Sergio Monteleone Apr 24 '18 at 15:56
0

I also got this error. I found out that the problem is the space in the path "C:\Program Files(x86)/MyApp/Licenses\license.txt".

Porous
  • 11
  • 2
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 04 '22 at 14:51