Qt Installer Framework - update remote repo for existing installation
-
Hi all,
I have an application deployed to users using QTIFW online installer.
Now I need to change the remote repo used to deploy updates but I can't find how to do that for existing installation.I know I can add a Repository on config.xml but it add the repo only for new installations.
How to handle this for existing users?
Thanks
-
Hi
you're extremely lucky just this/last week I was forced to deal with the exact same situation!
what you want to do is use the --rcc argument for the binarycreator
That will create an update.rcc file that basically contains your changes config/config.xml and control scriptThan you add a new package e.g com.mycompany.maintenancetool and in the data part you package this update.rcc
in the corresponding install script, hook into the installationStarted "signal" and in there you use DefaultResourceReplacement to overwrite the xml and controllscript of your maintenance tool
installer.setValue("DefaultResourceReplacement", updateRcc);here for more information, the official documentation:
https://doc.qt.io/qtinstallerframework/ifw-updates.html -
Hi,
thanks, this is what I've done but it seems ignored.changed the remote repo endpoint in config.xml:
<RemoteRepositories> <Repository> <Url>https://myrepo.it/repo_2/</Url> <Enabled>1</Enabled> <DisplayName>Repository</DisplayName> </Repository> </RemoteRepositories>Old repo was https://myrepo.it/repo_1/ .
generate the rcc:
binarycreator -c installer/mac/config/config.xml -rccCreated a new component com.company.config and copied on it's data dir the update.rcc file .
create the installscript.qs on meta dir:function Component() { component.ifwVersion = installer.value("FrameworkVersion"); installer.installationStarted.connect(this, Component.prototype.onInstallationStarted); } Component.prototype.onInstallationStarted = function() { if (component.updateRequested() || component.installationRequested()) { var updateResourceFilePath = installer.value("TargetDir") + "/update.rcc"; installer.setValue("DefaultResourceReplacement", updateResourceFilePath); } }Then I created the repo as always using repogen pointing to config.xml and package dir:
repogen -r -p installer/packages $DIR/installer/repo_2and deployed it on old repo_1 url.
After updating I can see it install the config component but at the end it seems it still point to repo_1 while I expected it to point repo_2 .
Where do I wrong?
-
Hello @luca
I just faced the same situation where I thought that updating the maintenance tool using the update.rcc file would replace the default repositories on the system, but it doesn't...
I'm wondering if you ended up finding a solution to your problem.Thanks in advance.