QtIFW Always create registry entry

左心房为你撑大大i 提交于 2020-01-24 12:29:06

问题


I'm currently using the Qt-Installer-Framework to create a setup for my application. Everything works fine for now except one thing:

If I install it to any location but C:\Program Files\MyApp, the installer won't create the registry entry for Programs and Features!

Is there a way to tell the installer to always do this?

Edit:
After trying out vairous different combinations, I do know now where the problem comes from:

If I try to install as current user only (set the AllUsers variable to false), it will always work and create an entry in HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID}.

If I install for all users, however, it will try to create a key in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{GUID}. This will only work, if the installer has to elevate it's operations during installation (because I chose a directory I need admin rights for).

So, the error is: The installer won't elevate itself to create the "global" registry entry and thus fails to create it. Any ideas on how to fix it?


回答1:


Here the link which has answer to this question.

Add the following line to your component's package xml file:

@<RequiresAdminRights>true</RequiresAdminRights>@

And use this line in your script file:

@component.addElevatedOperation("Execute", "someCommand");@

instead of

@component.addOperation("Execute", "someCommand");@



来源:https://stackoverflow.com/questions/34863638/qtifw-always-create-registry-entry

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!